title: ffmpeg decode example using vda acceleration?
body: <p>I'm testing the vda hw accelerated decoder of ffmpeg, but have no luck so far.</p>
  
  <p>the command line I use is this:</p>
  
  <pre><code>./ffmpeg -hwaccel vda -i ~/Downloads/big_buck_bunny_720p_surround.avi -c:v rawvideo -pix_fmt yuv420p out.yuv
  </code></pre>
  
  <p>(the input video can be downloaded here: <a href="http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi" rel="nofollow">http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi</a>)</p>
  
  <p>but it uses the sw decoder, instead of the requested vda hw decoder.</p>
  
  <p>I debugged ffmpeg.c, and found out that in the function get_format:</p>
  
  <pre><code>if (!(desc-&gt;flags &amp; AV_PIX_FMT_FLAG_HWACCEL))
      break;
  </code></pre>
  
  <p>the desc->flag isn't set with AV_PIX_FMT_FLAG_HWACCEL, so it skips the hw acceleration initialization.</p>
  
  <p>the reason is because the pix_fmt is set to AV_PIX_FMT_NONE for some reason, instead of yuv420p as specified by the command.</p>
  
  <p>I then changed the command to this:</p>
  
  <pre><code>./ffmpeg -hwaccel vda -i ~/Downloads/big_buck_bunny_720p_surround.avi -c:v rawvideo -pix_fmt vda_vld out.yuv
  </code></pre>
  
  <p>but what I got was:</p>
  
  <pre><code>Impossible to convert between the formats supported by the filter 'format' and the filter 'auto-inserted scaler 0'
  
  
  Error opening filters!
  </code></pre>
  
  <p>Can you please show me an example of using ffmpeg to dump the above video into yuv using the vda hw decoder?</p>
  
  <p>UPDATE from the ffmpeg mailist.</p>
  
  <p>I was told to try the following command instead:</p>
  
  <pre><code>    ./ffmpeg -vcodec h264_vda -i ~/Downloads/big_buck_bunny_720p_surround.avi out.yuv
  </code></pre>
  
  <p>but this is what I got:</p>
  
  <pre><code>./ffmpeg -vcodec h264_vda -i ~/Downloads/big_buck_bunny_720p_surround.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 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  [10:20:50.169] vtDecompressionDuctCreate signalled err=-8973 (err) (Could not select and open decoder instance) at /SourceCache/CoreMedia_frameworks/CoreMedia-1562.107/Sources/VideoToolbox/VTDecompressionSession.c line 1181
  [h264_vda @ 0x7f9feb034600] Failed to init VDA decoder: -12473.
  [avi @ 0x7f9feb00da00] Failed to open codec in av_find_stream_info
  [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/CoreMedia_frameworks/CoreMedia-1562.107/Sources/VideoToolbox/VTDecompressionSession.c line 1181
  [h264_vda @ 0x7f9feb034600] Failed to init VDA decoder: -12473.
  [NULL @ 0x7f9feb034600] missing picture in access unit with size 457
  </code></pre>
  
  <p>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.</p>