Fixes use of the example with encoders which use tha AVFrame w/h/pix_fmt fields
FFV1 is one of these codecs
We cannot easily workaround the not set fields in common code because the API
has AVFrame constant for the encoders.
Alternatives would be to fix the API or to duplicate the struct and fill in
missing fields. Or as is to require all user apps to set this correctly and
maybe simplify for that case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fix PTS set on the frame when encoding, which must be specified in the
encoder timebase or this will confuse the encoder.
When muxing the packet, the PTS/DTS generated by the encoder is then
rescaled to the stream timebase.
- do not allocate resample dst buffer when resample is off
- free sample buffers in addition to freeing data pointer arrays
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Hi list! Since my last patch (fix 2 memleaks in doc/examples/muxing.c)
I found more problems to fix.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The open_codec_context function, when it fails to find a codec, now
return AVERROR(EINVAL) to signal an error.
Before it would return the stream index, which was always >= 0, and
continue as if a codec was found. This change make it fail faster,
instead of repeated failed tries to decode frames with no codec.
Signed-off-by: Even Wiik Thomassen <e.thomassen@sportradar.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
Support the case when multiple frames are contained in a single packet.
In particular, fix fate-samples/lossless-audio/luckynight-partial.shn
sample decoding.
This codepath is not implemented and just crashes, also its simpler
without special cases, which makes sense for an example
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
There is no reason why this should copy the audio data in a very
complicated way. Also, strictly write the first plane, instead of
writing the whole buffer. This is more helpful in context of the
example. This way a user can clearly confirm that it works by playing
the written data as raw audio.
This assumes one audio packet is decoded one time. This is not true:
packets can be partially decoded. Then you have to "adjust" the packet
and pass the undecoded part of the packet to the decode function again.
Add function avfilter_graph_parse_ptr() and favor it in place of
avfilter_graph_parse(), which will be restored with the old/Libav
signature at the next bump.
If HAVE_INCOMPATIBLE_LIBAV_API is enabled it will use the
Libav-compatible signature for avfilter_graph_parse().
At the next major bump the current implementation of
avfilter_graph_parse() should be dropped in favor of the Libav/old
implementation.
Should address trac ticket #2672.