Re: UMS on Ubuntu 24.10
Posted: Tue Mar 18, 2025 7:18 am
I can see that the transcode command will use the GPU as it has the option h264_nvenc now
I think the main problem is the resolution of this video as it is trying to re-scale the double height 4320 down to 2160 and it could be this part that is causing FFmpeg to fail.
For this video it would have to be streamed for the 3D to work properly assuming the TV handles this, or it might only be suitable for playing in a VR headset and there is some options in UMS to allow this.
(its strange the error is 234 as the error code FFmpeg gives is -22)
As this is a test for a worst case video it may be better to get something more common to work properly first before pushing it.
See if you have anything 1080p, maybe using h265 so that it will need to be transcoded according to the supported formats in this conf.
Once this is confirmed to work then we can focus on 4K and the the oddball resolutions.
You could also do logs while playing in the web player as this will transcode everything to one standard format that it can play well using HLS.
This may still use a lot of CPU, at least initially, as it has to split the video into tiny chunks to be transcoded separately and this will need more CPU to set this up.
GPU usage may actually not show much change as it will only be using a small part of the GPU and because of the start stop nature of HLS there will only be spikes of activity so the average usage will be very low.
This is what it looks like playing for me with a GTX 1650 on windows according to Task Manager and Process Explorer
Also try with setting to use the FFmpeg version installed by UMS as this has the HLS feature enabled along with some others it might need.
This should also have the Nvidia headers included in the build.
Code: Select all
Starting /usr/bin/ffmpeg -y -loglevel info -i "/media/dave/Godzilla/Short Videos/bbb_sunflower_2160p_30fps_stereo_abl.mp4" -filter_complex [0:v]scale=iw*min(3840/iw\,2160/ih):ih*min(3840/iw\,2160/ih),[0:v]pad=ceil(iw/4)*4:ceil(ih/4)*4:(ow-iw)/2:(oh-ih)/2 -bufsize 1000000k -maxrate 999000k -crf 19 -ab 448k -c:a ac3 -c:v h264_nvenc -preset llhp -pix_fmt yuv420p -f mpegts /tmp/UMS-dave/ffmpegvideo_113_1742211237728
For this video it would have to be streamed for the 3D to work properly assuming the TV handles this, or it might only be suitable for playing in a VR headset and there is some options in UMS to allow this.
Code: Select all
[ffmpeg-2-2] net.pms.io.OutputTextLogger [h264_nvenc @ 0x624b68908080] InitializeEncoder failed: invalid param (8): Invalid Level.
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:0/h264_nvenc @ 0x624b68945a80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[ffmpeg-2-2] net.pms.io.OutputTextLogger [fc#0 @ 0x624b688fb080] Error sending frames to consumers: Invalid argument
[ffmpeg-2-2] net.pms.io.OutputTextLogger [fc#0 @ 0x624b688fb080] Task finished with error code: -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [fc#0 @ 0x624b688fb080] Terminating thread with return code -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:0/h264_nvenc @ 0x624b68945a80] Could not open encoder before EOF
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:0/h264_nvenc @ 0x624b68945a80] Task finished with error code: -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:0/h264_nvenc @ 0x624b68945a80] Terminating thread with return code -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:1/h264_nvenc @ 0x624b68946580] Could not open encoder before EOF
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:1/h264_nvenc @ 0x624b68946580] Task finished with error code: -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [vost#0:1/h264_nvenc @ 0x624b68946580] Terminating thread with return code -22 (Invalid argument)
[ffmpeg-2-2] net.pms.io.OutputTextLogger [out#0/mpegts @ 0x624b68943f80] Nothing was written into output file, because at least one of its streams received no packets.
[ffmpeg-2-2] net.pms.io.OutputTextLogger frame= 0 fps=0.0 q=0.0 Lq=0.0 size= 0KiB time=N/A bitrate=N/A speed=N/A
[ffmpeg-2-2] net.pms.io.OutputTextLogger Conversion failed!
[ffmpeg-2] net.pms.io.BufferedOutputFileImpl EOF
[ffmpeg-2] net.pms.io.ProcessWrapperImpl Process /usr/bin/ffmpeg has a return code of 234! Maybe an error occurred... check the log file
As this is a test for a worst case video it may be better to get something more common to work properly first before pushing it.
See if you have anything 1080p, maybe using h265 so that it will need to be transcoded according to the supported formats in this conf.
Once this is confirmed to work then we can focus on 4K and the the oddball resolutions.
You could also do logs while playing in the web player as this will transcode everything to one standard format that it can play well using HLS.
This may still use a lot of CPU, at least initially, as it has to split the video into tiny chunks to be transcoded separately and this will need more CPU to set this up.
GPU usage may actually not show much change as it will only be using a small part of the GPU and because of the start stop nature of HLS there will only be spikes of activity so the average usage will be very low.
This is what it looks like playing for me with a GTX 1650 on windows according to Task Manager and Process Explorer
Code: Select all
Starting "C:\Program Files\Universal Media Server\bin\ffmpeg.exe" -y -loglevel info -t 6.0 -sn -i C:\Users\Mik\Videos\video.mkv -sn -dn -copyts -c:v h264_nvenc -keyint_min 25 -profile:v high -level 41 -pix_fmt yuv420p -c:a aac -ac 6 -ab 320000 -f mpegts -skip_estimate_duration_from_pts 1 -use_wallclock_as_timestamps 1 -movflags frag_keyframe \\.\pipe\ffmpeghlsvideo_67_1742047834493
This should also have the Nvidia headers included in the build.