[FFmpeg-devel] [PATCH] avcodec/nvenc: Add support for H.265 encoding

Ali KIZIL alikizil at gmail.com
Wed Mar 25 22:52:54 CET 2015


Philip Langdale <philipl <at> overt.org> writes:

> 
> On Tue, 24 Mar 2015 09:54:13 +0100
> Timo Rothenpieler <timo <at> rothenpieler.org> wrote:
> 
> > Yes, I did exactly that in my implementation:
> > 
> > https://github.com/BtbN/FFmpeg/commits/nvenc
> > 
> > The code i wrote there is completely untested(Except that h264 still 
> > works), because i don't have any compatible hardware, so the one you 
> > tested is clearly the one that should be prefered.
> > 
> > Dropping SDK <5 support is fine with me, as long as it's not
> > backported to 2.6. The primary gain from supporting the old SDK is
> > that it works with much older nvidia driver versions.
> > 
> > I'll submit the patch that drops the old API support, so you can
> > rebase your patch on top of it.
> > 
> > Looks good to merge otherwise.
> > 
> 
> I've taken your logic to check the SM version - I had been
> wondering how old hardware should be detected and excluded.
> 
> I've also noticed that the profile handling code is completely broken 
-
> you can't set a profile using -profile:v - it appears we're handling
> this in an incorrect way - but I'm not sure what correct is. libx264
> has its own profile option which appears to be necessary but then I
> don't understand what sets avctx->profile.
> 
> Anyway, that's a separate problem we can solve independently of h.265.
> 
> Thanks!
> 
> --phil
> 

The update broken the general usage:

./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc -preset hp 
-fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k -bufsize 
48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt yuv420p -
acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k -flush_packets 0 -
packetsize 188 -y -f mpegts out.ts

./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc_h265 -
preset hp -fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k -
bufsize 48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt 
yuv420p -acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k -flush_packets 0 
-packetsize 188 -y -f mpegts out.ts

FFmpeg stucks, does not work for both. 

Before with nvenc work working fine with above commands. It looks like -
g parameter, -muxrate, -flush_packtes stuck FFmpeg with this update. 

Below line works:

./ffmpeg -loglevel verbose -i /root/bunny.mp4 -vcodec nvenc_h265 -preset 
hp -r 50  -y -f mpegts out.ts






More information about the ffmpeg-devel mailing list