Ffmpeg-devel : Video Decoder Acceleration (vda Hwaccel
Hardware video acceleration makes it possible for the video card to decode/encode video, thus offloading the CPU and saving power. There are several ways to achieve this on Linux: Video Acceleration API (VA-API) is a specification and open source library to provide both hardware accelerated video encoding and decoding, developed by Intel. Hardware acceleration in Libav. Depending on the specific hwaccel implementation, it could be bound to the gpu and use the gpu memory. It had been done for vda. – the decoder wants to get the data only when the hardware buffers require more and that would require at least a queue.
Hello, I'm testing the vda hw accelerated decoder of ffmpeg, but no luck so far. The command line I use is this:./ffmpeg -hwaccel vda -i /Downloads/bigbuckbunny720psurround.avi -c:v rawvideo -pixfmt yuv420p out.yuv (the input video can be downloaded here: ) but it uses the sw decoder, instead of the requested vda hw decoder. I debugged ffmpeg.c, and found out that in the function getformat: if (!(desc-flags & AVPIXFMTFLAGHWACCEL)) break; the desc-flag isn't set with AVPIXFMTFLAGHWACCEL, so it skips the hw acceleration initialization. The reason is because the pixfmt is set to AVPIXFMTNONE for some reason, instead of yuv420p as specified by the command.
I then changed the command to this:./ffmpeg -hwaccel vda -i /Downloads/bigbuckbunny720psurround.avi -c:v rawvideo -pixfmt vdavld out.yuv but what I got was: Impossible to convert between the formats supported by the filter 'format' and the filter 'auto-inserted scaler 0' Error opening filters! Can you please show me an example of using ffmpeg to dump the above video into yuv using the vda hw decoder? Thank you very much! ffmpeg-user mailing list. This is what happened. Funny that the reason I wanted to try ffmpeg vda is because I want to use vda in my code with libavcodec.
But I had no luck. I cold emailed Xidorn who is the author of the h264vdadec.c file. This was the answer: Hi Shi, I'm not very surprised that the VDA decoder cannot be properly inited here. I guess you probably eventually have to remux your video to use MP4 or MKV container. I don't know exactly what happens there, but according to my experience playing with VDA framework before, that framework had quite a few limitations.
I guess the limitation you met might be that, it required some extra data of the video to init the decoder, which made it support only some of the containers. I forget what the exact name of that extra data, but AFAIK, only MP4-compatible container could provide that. Regards, Xidorn I quickly tried a mp4 file, which worked.
Ffplay Hwaccel
ffmpeg-user mailing list.
Ffmpeg Hardware Acceleration
So basically I have implemented what we described above here: However when running./build/mpv -hwdec=videotoolbox with a sample H.264 video I got: Playing: /Users/jjgod/Downloads/712hdlowenergyhighperformancecompressionandaccelerate.mp4 (+) Video -vid=1 (.) (h264) (+) Audio -aid=1 -alang=und (.) (aac) Using hardware decoding. FYI, I rebased the videotoolbox patch for FFmpeg and updated it to target the new HWAccel API:) I forked mpv to add a development branch of videotoolbox to support ffmpeg hwaccel vt module. You're right, the glhwdecvda.c is a good candidate to render frame buffer of videotoolbox. That's said I've encountered some difficulties to share the source between the vda-gl and the videotoolbox-gl in the build process. But I just discovered waf build system after cloning mpv;) Then in my dev steps I manually disabled VDA from my own FFmpeg build. Thanks for CC:) Nice job, I'm really impressed by the ease of use of mpv.