0

ffmpeg -framerate 29.97 -hwaccel cuda -start_number 200000 -i %06d.tif -c:v libx264 -preset veryslow -tune film -profile:v high -pix_fmt yuv420p -level 4.1 -crf 17 -r 29.97 -threads 2 -frames:v 5000 ade-20000_202559_ArtemisHQ_tiff.mkv

I’m using the above command line to join together TIFF files that have been produced by a video enhance program, to produce a final video. I’m using a 2080ti GPU on Linux ver 20. Ffmpeg has been compiled using an online tutorial for Nvidia video encoding. My problem is that running the command with the -hwaccel cuda doesn’t increase the speed of processing much. I have used NVTOP to check that the GPU is being used. It shows 1% GPU and 200% CPU. Without the -hwaccel cuda NVTOP obviously doesn’t show any data.

Yes, it is to speed up the encoding. As the second answer says, maybe it can't be done because of the frequent read of files. I will still try the replacement with the nvenc command.

Thanks for all three prompt replies.

So I tried:

ffmpeg -framerate 29.97 -hwaccel cuda -start_number 200000 -i %06d.tif -c:v h264_nvenc -preset veryslow -tune film -profile:v high -pix_fmt yuv420p -level 4.1 -crf 17 -r 29.97 -threads 2 -frames:v 5000 ade-20000_202559_ArtemisHQ_tiff.mkv I got:

Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (ade-20000_202559_ArtemisHQ_tiff.mkv) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. Codec AVOption tune (Tune the encoding to a specific scenario) specified for output file #0 (ade-20000_202559_ArtemisHQ_tiff.mkv) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. When the command ran I got:

[h264_nvenc @ 0x559577472b40] [Eval @ 0x7ffd3759cc40] Undefined constant or missing '(' in 'veryslow' [h264_nvenc @ 0x559577472b40] Unable to parse option value "veryslow" [h264_nvenc @ 0x559577472b40] Error setting option preset to value veryslow. 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!


So I tried:

ffmpeg -framerate 29.97 -hwaccel cuda -start_number 200000 -i \%06d.tif  -c:v h264_nvenc -preset veryslow -tune film -profile:v high -pix_fmt yuv420p -level 4.1 -crf 17 -r 29.97 -threads 2 -frames:v 5000 ade-20000_202559_ArtemisHQ_tiff.mkv

I got:

Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 (ade-20000_202559_ArtemisHQ_tiff.mkv) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Codec AVOption tune (Tune the encoding to a specific scenario) specified for output file #0 (ade-20000_202559_ArtemisHQ_tiff.mkv) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

When the command ran I got:

[h264_nvenc @ 0x559577472b40] [Eval @ 0x7ffd3759cc40] Undefined constant or missing '(' in 'veryslow'
[h264_nvenc @ 0x559577472b40] Unable to parse option value "veryslow"
[h264_nvenc @ 0x559577472b40] Error setting option preset to value veryslow.
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!

Could this be where I've placed the command? You'll probably guess that I am not good at Linux or ffmpeg.

New contributor
madderek is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • Is your goal perhaps to have the GPU do the H264 encoding?
    – Daniel B
    14 hours ago
  • You're reading (a) large file(s) off the HDD frequently; I would guess that is what takes most time, and it simply can't be done / accelerated with the GPU. CPU speed is in nanosecods, HDD in ms - with a limping comparison.
    – Hannu
    13 hours ago
  • 1
    you will want to replace -c:v libx264 with something along the lines of -c:v h264_nvenc or one of the other hardware accelerated codecs in order to use your GPU. libx264 is a CPU encoder not a GPU one.
    – Mokubai
    13 hours ago
  • In addition to what Mokubai wrote, keep in mind that different codecs have different options. libx264 is a feature-rich H264 codec. If affords this flexibility by using the CPU. Your GPU’s H264 encoder probably has way fewer features. You can find them using ffmpeg -h encoder=h264_nvenc.
    – Daniel B
    12 hours ago

0

Browse other questions tagged or ask your own question.