Using the VDA decoding wrapper crashes with all h264/mp4 files. This is probably a regression. $ ffplay -codec:v h264vda nordlandsbanen.winter.sync.1920x1080.h264.nrk.mp4 ffplay version 1.1.git Copyright (c) 2003-2013 the FFmpeg developers built on Feb 20 2013 00:14:39 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) configuration: -prefix=/usr/local/Cellar/ffmpeg/HEAD -enable-shared -enable-pthreads -enable-gpl -enable-version3 -enable-nonfree -enable-hardcoded-tables -enable-avresample -cc=cc -host-cflags= -host-ldflags= -enable-libx264 -enable-libfaac -enable-libmp3lame -enable-libxvid -enable-ffplay libavutil 52.
Ffmpeg Hwaccel Command
17.102 libavcodec 54. 92.100 libavformat 54. 63.100 libavdevice 54. 3.103 libavfilter 3. 38.103 libswscale 2. 2.100 libswresample 0.
Is used automatically whenever a qsv decoder is selected), but accelerated: transcoding, without copying the frames into the system memory. For it to work, both the decoder and the encoder must support QSV acceleration: and no filters must be used. @end table: This option has no effect if the selected hwaccel is not available or not. Tweet get VideoToolbox to MacBook High Sierra [FFmpeg-devel] [PATCH]. Example to use VDA hw decoder on mac with ffmpeg? FFmpeg is the gold standard for media conversion, - VideoToolbox HEVC encoder and hwaccel. VAAPI, DXVA2, VDA and VideoToolbox video decoding acceleration. What is the difference between hwaccels cuda and cuvid? Hi, Can someone explain please what is the difference between hwaccels cuda and cuvid? Which one should be used in which cases?
17.102 libpostproc 52. Replying to: The patch caused a compilation error: with patchvda.diff applied on git.
New patch attached, please (ask for a) test. A 'non-shared' ffmpeg is apparently doesn't give more information.
That is hard to believe, but please ignore. Cehoyos: please provide a command line for testing this with ffmpeg. I am sorry but I don't know how to reproduce this crash (I don't have a sufficiently new OSX hardware), but I suggest to try again with the original (crashing) command line.
(I don't have OSX myself and I'm just relaying what a user is reporting.) Any reason why the user does not want to report the problem himself? I ran some tests which hopefully will help with this. This is the BT I'm getting: Switching to process 64824 thread 0xad03 0x00007fff8e4b412b in memset (gdb) bt #0 0x00007fff8e4b412b in memset #1 0x4bf44b in avprivcolorframe (frame=0x103042e00, c=0x10977e760) at string.h:83 git bisect shows this dece584a639c9fd0815e8397b3b617 is the first bad commit commit dece584a639c9fd0815e8397b3b617 Author: Michael Niedermayer Date: Sun Feb 17 20: +0100 h264: avoid calling getformat multiple times Some applications do not like that. Fixes VDA Reduces noise for VDPAU Tested-by: Guillaume POIRIER Tested-by: Carl Eugen Hoyos Signed-off-by: Michael Niedermayer By the way, even on good commits I ged a LOT of spam from ffplay in this form. That's probably for another bug though. h264vda @ 0x7f8e21830a00 Reinit context to 1920x832, pixfmt: 81 h264vda @ 0x7f8e21830a00 Missing reference picture, default is 0 h264vda @ 0x7f8e21830a00 decodesliceheader error.
Sorry, you are right. I trusted the previous comments in this thread to be right. Your second patch seems to fix the crash in avprivcolorframe but this reveals a new crash: Here's the bt Program received signal EXCBADACCESS, Could not access memory. Reason: KERNINVALIDADDRESS at address: 0x000000 Switching to process 5087 thread 0xae03 0x29f350 in ffh264predinit (gdb) bt #0 0x29f350 in ffh264predinit #1 0x000010 in?? Can I do something to get amore meaningful backtrace? So many info missing. Yes crashes as well.
Here's the bt on ffmpegg Program received signal EXCBADACCESS, Could not access memory. Reason: KERNINVALIDADDRESS at address: 0x000000 pred8x8128dc8c (src=0x0, stride=0) at h264predtemplate.c:559 559 FUNCC(pred8x8128dc)(src+8.stride, stride); (gdb) bt #0 pred8x8128dc8c (src=0x0, stride=0) at h264predtemplate.c:559 #1 0x230366 in hldecodembsimple8 (h=0x101464000) at h264mbtemplate.c:161 Previous frame inner to this frame (gdb could not unwind past this frame) Current language: auto; currently minimal (gdb).
I'm testing the vda hw accelerated decoder of ffmpeg, but have 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? UPDATE from the ffmpeg mailist. I was told to try the following command instead:./ffmpeg -vcodec h264vda -i /Downloads/bigbuckbunny720psurround.avi out.yuv but this is what I got:./ffmpeg -vcodec h264vda -i /Downloads/bigbuckbunny720psurround.avi out.yuv ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) configuration: libavutil 54. 20.100 libavcodec 56. 26.100 libavformat 56. 25.101 libavdevice 56. 4.100 libavfilter 5.
11.102 libswscale 3. 1.101 libswresample 1. 1.100 10:20:50.169 vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMediaframeworks/CoreMedia-1562.107/Sources/VideoToolbox/VTDecompressionSession.c line 1181 h264vda @ 0x7f9feb034600 Failed to init VDA decoder: -12473. avi @ 0x7f9feb00da00 Failed to open codec in avfindstreaminfo NULL @ 0x7f9feb034600 missing picture in access unit with size 9960 10:20:50.252 vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMediaframeworks/CoreMedia-1562.107/Sources/VideoToolbox/VTDecompressionSession.c line 1181 h264vda @ 0x7f9feb034600 Failed to init VDA decoder: -12473. NULL @ 0x7f9feb034600 missing picture in access unit with size 457 the reason I wanted to try this was because I wanted to use vda with libavcodec in the first place.
But the problem I saw was exactly the above. Looks like ffmpeg has the same issue. I cold emailed the author of libavcodec/vdah264dec.c who replied with the following message: 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.
I also remember mp4 has an extradata field, but I don't know what it is. I quickly tried the following command, it worked:./ffmpeg -hwaccel vda -i /Downloads/bigbuckbunny.mp4 -c:v rawvideo -pixfmt yuv420p out.yuv.