Hi all,
First time here, so nice to meet you all
Seems like you are having an awesome community, happy to find this forum.
Regarding my question:
I'm building a small software that merge images into a video using FFMPEG.
Using this command ({injected parameters}):
I've manage to do so, but it's super slow 🐌 with my CPU.Code:ffmpeg -r {newFPS} -f image2 -s {_resolution} -start_number {totalImagesMerged + 1} -i \"{_outputAllFramesPath}{_outputAllFramesFilePattern}\" -vframes {chunkFramesCount} -vcodec libx264 -crf 25 -pix_fmt yuv420p \"{_outputAllVideoChunksPath}Chunk_{chunkNumber}.mp4\"
I would like to take advantage of my GPU (RTX 3080) capabilities to do so in order to get a better performance 🐅 regarding compute time.
I'm using windows and get some problems following this guide on how to compile FFMPEG with the right Nvidia flags, and recently encounter this Reddit post about using Nvidia flag with the pre compiled version.
Flags like:I tried to use some of them in my command above but failed, I'm not sure I'm using them as expected.Code:hevc_nvenc , -hwaccel cuda, -hwaccel_output_format cuda
How can I tweak the command above to use my GPU? Can I do it without recompiling FFMPEG?
I'll appreciate any help
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
Can I do it without recompiling FFMPEG?
No clue how it is with the default builds that come with most Linux distributions or MacOS. If your ffmpeg version isn't build with nvenc support, you can't use it.
If you want to use nvenc instead of libx264 here's an example call, where I tried to adjust your call:
Code:ffmpeg -y -noautorotate -nostdin -hwaccel cuda -hwaccel_output_format cuda -threads 1 -r {newFPS} -f image2 -s {_resolution} -start_number {totalImagesMerged + 1} -i \"{_outputAllFramesPath}{_outputAllFramesFilePattern}\" -vframes {chunkFramesCount} -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p -vsync 0 -vcodec hevc_nvenc -profile:v 1 -level 0 -tier main -cq 18.00 -b:v 0k -2pass 0 -qmin 0 -qmax 51 -surfaces 32 -nonref_p 1 -strict_gop 1 \"{_outputAllVideoChunksPath}Chunk_{chunkNumber}.mp4\"
Here's also an example where I convert a 10bit AVC source to 10bit HEVC
Code:ffmpeg -y -noautorotate -nostdin -hwaccel cuda -hwaccel_output_format cuda -threads 1 -i "G:\TestClips&Co\files\10bit Test.mkv" -map 0:0 -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -vcodec hevc_nvenc -profile:v 1 -level 0 -tier main -cq 18.00 -b:v 0k -2pass 0 -qmin 0 -qmax 51 -surfaces 32 -nonref_p 1 -strict_gop 1 "E:\Output\10bit Testmp4"
Cu Selurusers currently on my ignore list: deadrats, Stears555 -
Thanks Cu Selur,
When i tried to run :
Code:ffmpeg -y -noautorotate -nostdin -hwaccel cuda -hwaccel_output_format cuda -threads 1 -r {newFPS} -f image2 -s {_resolution} -start_number {totalImagesMerged + 1} -i \"{_outputAllFramesPath}{_outputAllFramesFilePattern}\" -vframes {chunkFramesCount} -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p -vsync 0 -vcodec hevc_nvenc -profile:v 1 -level 0 -tier main -cq 18.00 -b:v 0k -2pass 0 -qmin 0 -qmax 51 -surfaces 32 -nonref_p 1 -strict_gop 1 \"{_outputAllVideoChunksPath}Chunk_{chunkNumber}.mp4\"
Code:br, 30 tbn Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (hevc_nvenc)) Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed!
-
Any thoughts?
2. remove "-vf zscale=rangein=tv:range=tv" and see if it works.
You should also read up on vui signaling and properly signal color matrix&co in the output.users currently on my ignore list: deadrats, Stears555 -
Thanks for the input,
I finally got it working
Just realized that my params order was wrong,
+ I've added bitrate and got an amazing results 🤩🤩 using this command:
Code:ffmpeg -r 30 -f image2 -s 4000x2000 -start_number 1 -i "D:\AllFrames\out-%d.jpg" -vframes 119 -vcodec h264_nvenc -preset slow -b:v 100M -pix_fmt yuv420p "D:\Output\Chunk_1.mp4"
-
well I need them both
But in this specific scenario yep, encoding it is
Thanks for the help man
Similar Threads
-
Leawo Video Converter GPU NVIDIA Faster than handbrake GPU NVIDIA.
By artkazuma in forum Newbie / General discussionsReplies: 3Last Post: 24th Apr 2020, 04:30 -
GPU or CPU encoding?
By m00511 in forum Newbie / General discussionsReplies: 44Last Post: 17th Nov 2019, 20:03 -
GPU Accelerated AV Converter multi-formats for nVidia CUDA Hardware.
By sev7en in forum Newbie / General discussionsReplies: 0Last Post: 21st Oct 2019, 03:29 -
NVEncC by rigaya - NVIDIA GPU encoding
By Selur in forum Video ConversionReplies: 87Last Post: 2nd Aug 2018, 20:24 -
There is too much about GPU vs CPU encoding, but how about GPU filters?
By Bernix in forum Newbie / General discussionsReplies: 24Last Post: 16th Feb 2018, 17:17