On Sat, 3 May 2014 23:25:31 +1000 Jean-Yves Avenard <[email protected]> wrote:
> Hi.. > > Currently updating our vdpau code that was written many moons ago, to > use the newish hwaccel API instead... > > Previously, we would specifically use the vdpau equivalent codec. > > So for example, say were going to open a h264 video, we would instead > use and open the "h264_vdpau" codec. > > Since using the hwaccel_context / hwaccel in AVCodecContext, that > method of searching explicitly the vdpau equivalent codec only works > with mpeg1/2, h264 and vc1 fail... If I explicitly use the h264_vdpau > codec, I get lots of errors. There is no h264_vdpau codec anymore (except maybe the old legacy implementation that was removed from Libav, but not FFmpeg yet). Instead, you're supposed to use the hwaccel feature. This is the defacto-documentation how to use it: https://git.videolan.org/?p=ffmpeg.git;a=blob;f=ffmpeg_vdpau.c The trick is that you open the normal h264 codec, but select a vdpau pixelformat when the get_format callback is used. > If I simply open the h264 codec as-is; it works, and I can see I have > a very low CPU usage (eg 5-6% vs 90%). That tells me it all works. > > But in the logs, all entries are with [h264] rather than [h264_vdpau], > making it hard to know if I'm using vdpau or not, or if it's not > optimal. > > playing the file with mplayer (updated as-of today), the log do > contain [h264_vdpau], so obviously they do something rather > differently. I don't know what they're doing currently, but they still could be using the "old" API, or emulating it. > The main reason I'm asking, is that I'm not 100% sure vdpau is properly used. > > With high-complexity codec like h264 or vc1 it's easy to see if it's > using vdpau: just look at the CPU usage, the difference being > significant enough. > > But with things like old wmp3 or mpeg, you can't really tell the > difference on a modern CPU. Well, there's nothing magic about the "new" API, it's just the old one slightly changed. I still have no idea why it was changed at all. > As I'm trying to prevent any regressions, I wanted to be sure. > > Is it okay to simply open the codec found by default in my stream > as-is, and FFmpeg will see automatically that hwaccel is set and do > what needs to be done? > > thanks. > _______________________________________________ > Libav-user mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/libav-user _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
