hardware acceleration for ffmpeg is not working - ffmpeg

I download cuda driver for my nvidia
but it still does not use my GPU, it still using cpu.
how can i make it use GPU.
i heard about hardware acceleration as well but thats not working.
It has to be h.264

Your question is not very clear.
From what I have read, it looks like you are trying to do h.264 encoding using your Nvidia GPU card.
Try this command and add your other codec or change the codec you use.
But usually, this will encode a file you have to mp4 using GPU.
ffmpeg -hwaccel cuvid -i input.mp4 -c:v h264_nvenc -pix_fmt yuv420p -preset slow output.mp4

Related

ffmpeg low speed on AMD encoder

I'm encoding some videos with ffmpeg, if I use only CPU the speed it's about 1x, so as I have an AMD RX580 I tried with amd encoding, but only increased the speed to 1.5x. Is this ok? Should it go faster?
My command is:
ffmpeg -i 5.mp4 -c:v h264_amf -lavfi "[0:v]scale=1920:1080,boxblur=luma_radius=min(h\,w)/8:luma_power=1:chroma_radius=min(cw\,ch)/8:chroma_power=1[bg];[0:v]scale=-1:1080[ov];[bg][ov]overlay=(W-w)/2:(H-h)/2,crop=w=1920:h=1080" output.mp4
Can I do anything to increase the speed?
Thanks

FFMPEG screen capture outputting very poor and inconsistent framerate as webm with no audio

I've been testing different parameters to capture my desktop video and audio (desktop audio, not mic) and I find that no matter what settings I have, the resulting webm file's framerate is around 5fps and is horribly inconsistent. It starts at around 20fps and slowly drops over time until about 4-5fps. I'm not really sure what I'm doing wrong, but here is the basic command I'm using:
ffmpeg -y -video_size 1920x1080 -f gdigrab -framerate 60 -i desktop -c:v libvpx-vp9 -acodec libvorbis -c:a libopus -b:v 2M -threads 4 output.webm
I've tried anywhere between 30-60 fps and tested different bitrates but nothing seems to affect the output framerate.
Also, I know that acodec and c:a are for audio but I'm not sure how to specify the audio device to use.
So my issues are horrible framerate for webm and how to include desktop audio in the recording.
You can use arecord and pipe it through stdout and ffmpeg can read it from stdin.
aplay piping to arecord using a file instead of stdin and stdout
Replacing the aplay command with your ffmpeg. Dont forget to add '-i -' in ffmpeg.
A doubt: why are you defining audio encoder two times?
It's impossible to say why the video frame rate is low from the question. It can be an issue with encoder. Or issue in reading input. Remove the video encoding option. See if the issue persists. If it's working fine, try some other encoders.
Use -c:v libx264 instead of -c:v libvpx-vp9. libvpx-vp9's realtime encoding quality is really bad, even regular libvpx (i.e. VP8) is much better. If you insist on using libvpx, use options like -deadline realtime and -cpu-used -4

ffmpeg NVENC Encoding with -flags:v +ildct shows "No NVENC capable devices found"

So far I use NVENC with ffmpeg for all my encoding successfully. Today I got a new Zotac nVidia GEForce GTX 1660 6GB card.
I get "No NVENC capable devices found" error from ffmpeg. Only if I use -flags:v +ildct flag. Without ildct flag no issues except the output is progressive.
I 100% need Interlaced output and I tried most of the Interlaced flags like, -vf tinterlace=interleave_top,fieldorder=tff -x264opts tff=1 Nothing is giving me Interlaced output except -flags +ildct But with "Zotac nVidia GEForce GTX 1660" ffmpeg shows:
No NVENC capable devices found
I even tried all latest nVidia drivers. Nothing helped me.
My pseudo ffmpeg command line is as below:
ffmpeg -i SourceFile.mkv -codec:v h264_nvenc -preset:v slow -flags:v +ildct+cgop -s:v 1920x1080 -ac 2 -ar 48000 -codec:a mp2 -b:a 384k -r 25 -f mp4 -y NewFile.mp4
Is it a bug with nVidia driver or ffmpeg ? Is latest nVidia Turing technology doesn't support Interlaced (very Bad) ?
Could some one help me ?
nVidia inexplicably disabled interlaced encoding on Turing GPU's. See here and here.
I'm waiting for fix, too.

x264: Encoded videos need lots of CPU to play

My computer (Intel Core 2 Duo T9300, 2.5GHz) can usually play any Full HD file, and Blu-Rays perfectly.
However, when I encode a Full HD file myself, the CPU is struggling and frames are dropped.
Here's my command line:
ffmpeg.exe -r 24 -f concat -i list_of_png_files.txt -i w:\audio.wav -acodec copy -c:v libx264 -preset medium -b:v 10000k -shortest output.avi
I tried adding -maxrate 13000k after "-preset medium". However, x264 doesn't seem to honor this - the framerate still reaches 20MBit at parts.
How can I encode videos in such a way as to reduce CPU usage during decoding?
There is an x264 tuning option for exactly this purpose. I believe -tune fastdecode is what you are looking for. But this will disable some compression features, so the video may not look as good without increasing the bitrate.

Create MP4 video using FFMPEG and JPEG2000 frames

I'm trying to create an MP4 video with ffmpeg using JPEG2000 images as frames.
It works when the JPEG2000 is 8bpp, but I need it to work for at least 12 bits (ideally 12, but could be 16). The images are grayscale.
This is the command I'm using:
ffmpeg.exe -i imagen.jp2 video1.mp4
If I try to use -pix_fmt it says it's not supported by the encoder (it doesn't matter which format I use).
Some sample images can be found here:
http://ioingresodemanda.com/jp2.rar
I could also use any other tool, it doesn't need to be ffmpeg.
UPDATE: Adding ffmpeg output - http://pastebin.com/NyY3vgpz
Thanks in advance
If you are ok with mp4 file having a different video format the following will work
ffmpeg -strict -2 -i 12bit.jp2 -vcodec libx264 -an out.mp4
ffmpeg -strict -2 -i 12bit.jp2 -vcodec mpeg4 -an out.mp4
ffmpeg doesn't support 12-bit color. Most of the H264 profiles only support 8-bit color; a few support 10-bit, and only the super-obscure lossless Hi444PP profile supports 14-bit color. The x264 encoder does support some of the profiles with 10-bit color, but that's as far as it goes, and you have to explicitly enable it using the --bit-depth option:
http://git.videolan.org/?p=x264.git;a=commit;h=d058f37d9af8fc425fa0626695a190eb3aa032af
As noted in the commit, you may also want to keep in mind that "very few H.264 decoders support >8 bit depth currently".

Resources