<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">The decode example(<a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/examples/decode_video.c">https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/examples/decode_video.c</a>) intend to decode raw stream rather than muxed .mp4 file.     </div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000">You may better to follow the input part of the transcoder example(<a href="https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/examples/transcoding.c">https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/doc/examples/transcoding.c</a>) to use `<span style="color:rgb(1,1,129);font-family:monospace;font-size:12px;white-space:pre">avformat_open_input/</span><span style="color:rgb(1,1,129);font-family:monospace;font-size:12px;white-space:pre">avcodec_find_decoder</span>` for demuxer/decoder initializing, then use `av_read_frame` to get demuxed frame, after that same logic in decode/transcode example to use `avcodec_send_packet/avcodec_receive_frame` for decoding. Output part of the transcode example could be ignored if you don't need it.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:#000000"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 10, 2022 at 3:54 PM Kanzler Mike <<a href="mailto:halcom@gmx.de">halcom@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>Hi,</div>

<div> </div>

<div>i want to use ffmpeg/libav to decode h264/h265 videos (sound not needed) on Windows 10, Visual Studio 2019.</div>

<div> </div>

<div>I used the precompiled Windows Libraries from <a href="http://gyan.dev" target="_blank">gyan.dev</a> (latest release 5.0.1 Full).</div>

<div>As example videos i used the <a href="https://test-videos.co.uk/bigbuckbunny/mp4-h264" target="_blank">https://test-videos.co.uk/bigbuckbunny/mp4-h264</a> in 1280x720 (and also the h256 version).</div>

<div> </div>

<div>I think i have to change the codec to:</div>

<div>
<pre style="margin:0px;text-indent:0px">codec<span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span>avcodec_find_decoder(AV_CODEC_ID_H264);</pre>

<div> </div>

<div>My problem is that the av_parser_parse2 method seems not to find a packet or loads the whole file as one packet which i cant decode.</div>

<div> </div>

<div>I tried other codec like
<pre style="margin:0px;text-indent:0px"><span style="font-weight:700">AV_CODEC_ID_MPEG4, </span></pre>

<pre style="margin:0px;text-indent:0px"><span style="font-weight:700">AV_CODEC_ID_HEVC,</span></pre>

<div>
<pre style="margin:0px;text-indent:0px"><span style="font-weight:700">AV_CODEC_ID_H265</span></pre>

<div> </div>

<div><span style="font-weight:700">None of that works for me. </span>I also used an older version off ffmpeg that i used for video encoding years before, that also wont work.</div>

<div> </div>

<div>What did i miss? Or is this a bug?</div>

<div> </div>

<div>Best Regards</div>

<div> </div>
</div>
</div>
</div>

<div> </div></div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
</blockquote></div>