mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.5k stars 206 forks source link

Error converting file #1676

Closed andrerxavier closed 9 months ago

andrerxavier commented 10 months ago

Describe the bug Hello @mdhiggins! In another post, you helped me configure my script, and 4k transcoding with HDR worked. Now, I'm having an issue when trying to use the GPU to transcode to mp4. Here are all the details and the log. I'm using a GTX 1060.

Command or context you are trying to run For manual.py include the full command, for integrated commands please include relavent logs from those programs (IE for postSonarr.py please include relevant Sonarr logs)

autoProcess.ini settings autoProcess.ini

Log files sma.log

FFMpeg headers

ffmpeg ffmpeg version N-112160-g284d1a8a6a Copyright (c) 2000-2023 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --enable-gpl --enable-libx264 --enable-libx265 libavutil 58. 25.100 / 58. 25.100 libavcodec 60. 27.100 / 60. 27.100 libavformat 60. 13.100 / 60. 13.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get full help or, even better, run 'man ffmpeg

ffmpeg -encoders | grep nvenc ffmpeg version N-112160-g284d1a8a6a Copyright (c) 2000-2023 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --enable-gpl --enable-libx264 --enable-libx265 libavutil 58. 25.100 / 58. 25.100 libavcodec 60. 27.100 / 60. 27.100 libavformat 60. 13.100 / 60. 13.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 V....D av1_nvenc NVIDIA NVENC av1 encoder (codec av1) V....D h264_nvenc NVIDIA NVENC H.264 encoder (codec h264) V....D hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)

ffmpeg -hwaccels ffmpeg version N-112160-g284d1a8a6a Copyright (c) 2000-2023 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --enable-gpl --enable-libx264 --enable-libx265 libavutil 58. 25.100 / 58. 25.100 libavcodec 60. 27.100 / 60. 27.100 libavformat 60. 13.100 / 60. 13.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 Hardware acceleration methods: vdpau cuda

ffmpeg -f lavfi -i nullsrc -c:v h264_nvenc -gpu list -f null - ffmpeg version N-112160-g284d1a8a6a Copyright (c) 2000-2023 the FFmpeg developers built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2) configuration: --enable-gpl --enable-libx264 --enable-libx265 libavutil 58. 25.100 / 58. 25.100 libavcodec 60. 27.100 / 60. 27.100 libavformat 60. 13.100 / 60. 13.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 3.100 / 7. 3.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 Input #0, lavfi, from 'nullsrc': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: wrapped_avframe, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_nvenc)) Press [q] to stop, [?] for help [h264_nvenc @ 0x55d8446c5780] [ GPU #0 - < NVIDIA GeForce GTX 1060 3GB > has Compute SM 6.1 ] [vost#0:0/h264_nvenc @ 0x55d8446c54c0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. Error while filtering: Immediate exit requested [out#0/null @ 0x55d8446c4300] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A

System Information

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

Issues posted without any logs or autoProcess settings will be closed

mdhiggins commented 10 months ago

Are you sure you're using the same FFMPEG build compared to what you're using to generate your test commands?

You're trying to use h264_nvenc but manual.py is throwing lots of errors that you don't have this encoder and that's ultimately the FFMPEG error that's thrown as well, though your output from -encoders seems to show it

2023-09-23 00:42:40 - MANUAL - WARNING - ===========WARNING===========
2023-09-23 00:42:40 - MANUAL - WARNING - The encoder you have chosen h264_nvenc (h264_nvenc) is not listed as supported in your FFMPEG build, conversion will likely fail, please use a build of FFMPEG that supports h264_nvenc or choose a different encoder.
2023-09-23 00:42:40 - MANUAL - WARNING - Other encoders your current FFMPEG build does support for codec h264:
2023-09-23 00:42:40 - MANUAL - WARNING - ['libx264', 'libx264rgb', 'h264_omx', 'h264_v4l2m2m', 'h264_vaapi']
2023-09-23 00:42:40 - MANUAL - WARNING - ===========WARNING===========
Unknown encoder 'h264_nvenc'

You're also getting errors on your test command too

[h264_nvenc @ 0x55d8446c5780] [ GPU #0 - < NVIDIA GeForce GTX 1060 3GB > has Compute SM 6.1 ]
[vost#0:0/h264_nvenc @ 0x55d8446c54c0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Error while filtering: Immediate exit requested
[out#0/null @ 0x55d8446c4300] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A

Finally, it looks like you're mixing a VAAPI decoder and NVENC encoder which isn't a great practice, maybe remove that decoder if you're going with NVENC

mdhiggins commented 10 months ago

Another way to see if you have full support for the encoder is to run ffmpeg -codecs and then look for the listed encoders and decoders

 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_qsv h264_cuvid ) (encoders: libx264 libx264rgb h264_amf h264_mf h264_nvenc h264_qsv )
andrerxavier commented 10 months ago

ffmpeg had already been installed and then I followed the installation from this link https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/

ffmpeg -codecs

mdhiggins commented 10 months ago

So I guess that begs the question is SMA using the correct FFMPEG binary or do you have multiple cause your -codecs output is how the script checks if h264_nvenc is present, in your case its saying its not so it might be worse investigating that

andrerxavier commented 9 months ago

Now yes, the problem was actually installing ffmpeg. Thanks