Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

[RESOLVED] How to change h264_nvenc to libx264?


Recommended Posts

Posted

Hi all,

For the embedded "Create videos" feature, I would like to know how to change the default ffmpeg codec "h264_nvenc" to, for exemple, "libx264" because I don't have an Nvidia gpu so h264_nvenc can't work for me.

Regards,

Kaléo

 

Posted
1 hour ago, Kaleo said:

Hi all,

For the embedded "Create videos" feature, I would like to know how to change the default ffmpeg codec "h264_nvenc" to, for exemple, "libx264" because I don't have an Nvidia gpu so h264_nvenc can't work for me.

Regards,

Kaléo

 

Hi Kaleo,

I think during initialize of pbx, it will check your video card. If it is nvidia it will use the h264_nvenc , otherwise just the libx264.

Make a video and check your log.txt file to confirm

Posted

No, it's not working like that, or there was an error while I installed pinballx.

I never had an NVidia card.

log.txt says:

22:54:22.75  18/04/2020:  GPU 1: AMD Radeon R7 200 Series
22:54:22.76  18/04/2020:  Displays: 2
...
22:54:25.81  18/04/2020:  C:\PinballX\vpauto.exe 
22:54:58.58  18/04/2020:  Recording videos
22:55:01.26  18/04/2020:  FFMPEG.exe -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size 1920x1080 -t 00:00:45 -i desktop -c:v h264_nvenc -an -qp 21 -pix_fmt yuv420p -movflags +faststart "C:\PinballX\MEDIA\Visual Pinball X\Table Videos\RollerGames (Williams 1990) VPX 1.01a.mp4"
22:55:02.73  18/04/2020:  Playfield video capture failure
22:55:02.76  18/04/2020:  Backglass video already exists. Not recording.

...

So I tried this command lines and of course it said:

Stream #0:0 -> #0:0 (bmp (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[h264_nvenc @ 000002086aadf780] Cannot load nvcuda.dll
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

If I change h264_nvenc in the command line, it's ok.

is it serious Doctor?

More over, it would be good to be able to set all parameters as for rotated screens, video_size is wrong.

Kaléo.

Posted

Unfortunately, it solve the problem... sometime, and somtime not.

 

15:19:36.11  19/04/2020:  PinballX - Version 4.24 x64
15:19:36.34  19/04/2020:  Windows 10 Famille 64 bits (8GB)
15:19:36.35  19/04/2020:  Loading Settings
15:19:36.37  19/04/2020:  Launching Startup Program: display.exe
15:19:36.38  19/04/2020:  C:\Program Files (x86)\Disp\display.exe /device:2 /rotate:180
15:19:36.76  19/04/2020:  Initialize Component
15:19:36.95  19/04/2020:  Initialize Display
15:19:37.48  19/04/2020:  Testing Flash engine.
15:19:39.25  19/04/2020:  Loading PlugIns
15:19:39.53  19/04/2020:  Loaded Plugin:"DirectOutput PinballX Plugin" Version 1 By Swisslizard
15:19:44.30  19/04/2020:  PlugIn: "DirectOutput PinballX Plugin" Initialized OK
15:19:44.31  19/04/2020:  Using Plugin System Version: 1
15:19:44.60  19/04/2020:  Created DirectX BackGlass Window
15:19:44.61  19/04/2020:  Looking for startup images
15:19:44.87  19/04/2020:  Hiding Cursor
15:19:44.90  19/04/2020:  Hiding Taskbar
15:19:44.93  19/04/2020:  Getting GPU and CPU Information
15:19:44.97  19/04/2020:  CPU:  Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz
15:19:44.98  19/04/2020:  4 cores, 4 threads
15:19:44.98  19/04/2020:  GPU 1: AMD Radeon R7 200 Series
15:19:44.99  19/04/2020:  Displays: 2
15:19:45.00  19/04/2020:  Load Game List
15:19:45.10  19/04/2020:  Loading Database: Pinball FX3
15:19:45.16  19/04/2020:  Loading Database: Visual Pinball
15:19:45.17  19/04/2020:  Loading Database: Visual Pinball Phys Mod
15:19:45.19  19/04/2020:  Loading Database: Visual Pinball X
15:19:45.21  19/04/2020:  Initial load gamelist took: 109ms
15:19:45.31  19/04/2020:  Finding and matching artwork and videos
15:19:45.82  19/04/2020:  Took: 500ms
15:19:45.83  19/04/2020:  Loading Game Statistics and Scores
15:19:45.87  19/04/2020:  Real DMD Initialized
15:19:45.90  19/04/2020:  Main display running full screen windowed.
15:19:45.97  19/04/2020:  Loading Surfaces
15:19:46.10  19/04/2020:  Finished Loading Surfaces
15:19:46.11  19/04/2020:  Initialize Audio
15:19:46.20  19/04/2020:  Set Keyboard Controls
15:19:46.22  19/04/2020:  Initialize Joystick
15:19:46.38  19/04/2020:  3 Joysticks Attached
15:19:46.39  19/04/2020:  Started
15:19:46.68  19/04/2020:  Launch System
15:19:46.70  19/04/2020:  Hide DMD
15:19:46.71  19/04/2020:  Hide Backglass
15:19:46.72  19/04/2020:  Waiting for threads
15:19:47.06  19/04/2020:  Disposing display
15:19:47.80  19/04/2020:  C:\Visual Pinball\VPinball99_PhysMod5.exe /play -"C:\Visual Pinball\TablesPhysMod\Star Wars Shoopity PhysMod.vpt"
15:19:47.92  19/04/2020:  C:\PinballX\vpauto.exe 
15:20:08.60  19/04/2020:  Visual Pinball Player window foreground
15:20:10.20  19/04/2020:  Recording videos
15:21:06.07  19/04/2020:  Playfield video driver capture failure
15:21:06.11  19/04/2020:  FFMPEG.exe -f gdigrab -framerate 30 -offset_x 0 -offset_y 0 -video_size 1920x1080 -t 00:00:45 -i desktop -c:v h264_nvenc -an -rc vbr_hq -qmin 0 -cq 20 -b:v 8000k -maxrate:v 24000k -pix_fmt yuv420p -movflags +faststart "C:\PinballX\MEDIA\Visual Pinball Phys Mod\Table Videos\Star Wars Shoopity PhysMod.mp4"
15:21:07.96  19/04/2020:  Playfield video capture failure
15:21:07.98  19/04/2020:  Backglass video already exists. Not recording.
15:21:08.04  19/04/2020:  Exit System Control Pressed
15:21:17.40  19/04/2020:  Exiting
15:21:17.49  19/04/2020:  Showing Taskbar
15:21:17.50  19/04/2020:  Unhiding Mouse Cursor
15:21:17.53  19/04/2020:  Launching Exit Program: display.exe
15:21:17.54  19/04/2020:  C:\Program Files (x86)\Disp\display.exe /device:2 /rotate:270
15:21:17.57  19/04/2020:  Disposing Plugins
15:21:17.59  19/04/2020:  Saving Settings
15:21:17.63  19/04/2020:  Waiting for Online Thread
15:21:22.49  19/04/2020:  Bye

Moreover, when it's ok:

- the recording now consider the good size of my rotated screen... but for my pincab it is recorded at 180° :-(

- recording playfield launch a dialogbox in my table asking for adding or removing a ball (????)

According to the diversity of our computers, it would be definitly interesting to be able to tweak the parameters, Pinballx could offer some standard settings that we could change, in the setting app or in an ini file for exemple.

Kaléo


 

Posted

Install v4.25 and attach copies of your log.txt and pinballx.ini file (no copy and paste please) to see if it is fixed for you.

Posted
1 hour ago, Draco1962 said:

Install v4.25 and attach copies of your log.txt and pinballx.ini file (no copy and paste please) to see if it is fixed for you.

I should say, download v4.26. Think that has the fix in it

Posted

Hi,

Yes! It's working with GPU off, even if I see in log a line with h264_nvenc. Maybe it is not called.

You're right, in my case the rotation is not good. As I said, for our many pincab configurations it would be good to be able to change manully the settings (an advanced++ mode?). Isn't it the purpose of PinballX to fit all Pincab?

It would also enable users to change encoder for futur improvements without hardcore changes in pinballx.

For now, my video are not fluid. This is not related to pinballx but to my computer. I will try to find the best balance bitween fps and quality.

Many thanks for this work. (think about this  :-) ? ->

log.txt

Kaléo.

Posted

It's because my screen is 180° from standard pincab. So I turn PinballX 180° at the beginning.

I can deal with this. In the time, I found a better way to record good quality video -> embedded windows 10/Xbox recording app -> Win+G.

It produce big but good files. I can compress them in a second time.

Regards,

Kaléo.

Posted
6 hours ago, Kaleo said:

It's because my screen is 180° from standard pincab. So I turn PinballX 180° at the beginning.

I can deal with this. In the time, I found a better way to record good quality video -> embedded windows 10/Xbox recording app -> Win+G.

It produce big but good files. I can compress them in a second time.

Regards,

Kaléo.

Is it an option to rotate your screen 180° in Windows itself ? Or is that not possible ?

Posted

In fact, this is what I do with display.exe.

[StartupProgram]
Enabled=True
WorkingPath=C:\Program Files (x86)\Disp
Executable=display.exe
Paramaters=
HideWindow=true
WaitForExit=True
Parameters=/device:2 /rotate:180

 

Posted

 

 

23 minutes ago, Kaleo said:

In fact, this is what I display.exe do.


[StartupProgram]
Enabled=True
WorkingPath=C:\Program Files (x86)\Disp
Executable=display.exe
Paramaters=
HideWindow=true
WaitForExit=True
Parameters=/device:2 /rotate:180

 

Thanks. Will try something tomorrow on my cab.

I see you first rotate to 180°. In the ini you rotate at start 270°. On exit you rotate 270° again. I'm a bit confused by that:wacko:

I will tey what happen. 

Posted

Your head turns to much? :P

In fact, It is not "Rotate", it is the orientation.

So, on windows startup, I rotate the screen for pinball (180°=reverse landscape) and on exit, I rotate to 270°(reverse portrait) to have my screen right to work as PC.

Posted

Ah gotcha ! Sorry, thought rotate was exactly  rotate. Hmm .. that should work. But in the settings.exe it rotates back at start to 270.

Or am I mistaken ?

Posted

You're right. The reason is that most FS tables (VP9,PhysMod,VPX) have a rotation of 270° according to the normal landscape orientation.

180° at start (before Pinballx start, "reverse landscape") put my display in the "standard" orientation for Visual Pinball (as my screen/TV is turned at 180° in my pincab, sorry I missed this point when I builded it, I can't change until I build a new one (in project)).

Setting.exe rotates PinballX at 270°... like all my FullScreen Visual Pinball tables and everybody is in the good orientation for me.

If I stop using the Pincab and go back to the PC, the orientation of the display was 180°(reverse landscape), so I change it to 270°(reverse portrait) and all is ok.

The other way would be: turn the screen at 270° at the begining (PC mode for me), turn Pinballx à 90°(easy to do), change the parameters (XY Rotation, X scale, Y scale, offsets...) of all my tables (maybe not VPX? But shure for VP9 and PhysMod, and this is not easy to do).

I think here, you have the all story :D

 

Posted

Thanks for the explanation.  I already had an idea about the above. And good to tell the whole story. I hardley use vp9 tables , but thought only the resolution.txt (or something) was needed to change. And thats from the directb2s server to copy to the tables dir.

Btw. Just to be sure Im not sure why, but pbx videos are always 180° rotated when checking with a video player. When running pbx it rotates the video180° to play it correctly.

Posted

Its a legacy thing to ma

27 minutes ago, Mike_da_Spike said:

 

Btw. Just to be sure Im not sure why, but pbx videos are always 180° rotated when checking with a video player. When running pbx it rotates the video180° to play it correctly.

Its a legacy thing to maintain compatibility with HyperPin.

PinnballX is supposed to pick up portrait mode when recording but I guess this unusual setup is confusing it. As a developer I would always rather make something automatic then make the user choose, right?

I think things work pretty well for 99.5% of setups and that's probably the best I can hope for. There will always be the odd person things don't work for. There was a US president who had a famous line that applies a little.

  • Haha 1
Posted

@Tom Speirs: You're right, it's ok for me. If the recording is working well, I can deal with the rotation in post treatement. Anyway, as I said, Recording with Windows 10 (Win+G) work really well also.

9 hours ago, Tom Speirs said:

As a developer I would always rather make something automatic then make the user choose, right?

You're right here too. Even if a powerfull program is able to do both. -> Note that I don't ask for this. Once again, it's ok now for me, thanks.

Regards.

Guest
This topic is now closed to further replies.
×
×
  • Create New...