Stefano Sabatini
b2a4316287
examples/decoding_encoding: check av_samples_get_buffer_size() for a negative value
...
Fix broken != 0 check.
11 years ago
Timothy Gu
c65fe9e982
examples/decoding_encoding: check av_samples_get_buffer_size() return code
...
Fixes CID1135756.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
11 years ago
Timothy Gu
b242c156e5
examples/resample_audio: check av_samples_get_buffer_size() return code
...
Fixes CID1135757.
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
11 years ago
Clément Bœsch
b02d87936b
examples/demuxing_decoding: print the decoding error when it happens.
11 years ago
Even Wiik Thomassen
43f116d162
examples/demuxing_decoding: return error when no codec found
...
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>
11 years ago
Anton Khirnov
eb891b3114
Replace all uses of avcodec_free_frame with av_frame_free().
11 years ago
Michael Niedermayer
210a78aeb5
doc/examples/filtering_audio: init packet0.data
...
Fixes use of uinitialized data and crash
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Stefano Sabatini
c490cd4c1a
doc/examples/filtering_audio: fix chunked audio decoding
...
Support the case when multiple frames are contained in a single packet.
In particular, fix fate-samples/lossless-audio/luckynight-partial.shn
sample decoding.
11 years ago
Stefano Sabatini
893f33e7f0
doc/examples/filtering_audio: fix style
11 years ago
Stefano Sabatini
c7a99d99bd
doc/examples/filtering_video: do not make use of AVBufferSinkParams
...
Set the value on the filter context instead. Simplify.
11 years ago
Stefano Sabatini
3aa6018010
doc/examples/filtering_video: add some error handling in init_filters()
11 years ago
Stefano Sabatini
a12bf9f50f
doc/examples/README: fix typo
11 years ago
Stefano Sabatini
55c57658d2
doc/examples/filtering_audio: add more error checks
11 years ago
Stefano Sabatini
82e74ee6e4
doc/examples/filtering: make use of av_err2str()
...
Simplify.
11 years ago
Clément Bœsch
0d2c832445
doc/examples: update README.
11 years ago
Clément Bœsch
a8ac2a1530
doc/examples: make fill_samples static.
...
This is required to build with FFmpeg compilation options.
11 years ago
Clément Bœsch
e5102feb6b
doc/examples: add transcode_aac to local Makefile.
11 years ago
Michael Niedermayer
ba728c1a25
doc/examples/transcode_aac: remove non converted codepath
...
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>
11 years ago
Michael Niedermayer
7497c894cd
doc/examples/transcode_aac: switch to swresample
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
02abc905cd
doc/examples/transcode_aac: fix project name
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Andreas Unterweger
10421bcf0a
Add an audio transcoding example.
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Diego Biurrun
ab81f24ad4
build: Integrate multilibrary examples into the build system
...
This includes moving libavformat/output-example to doc/examples/output.
11 years ago
Stefano Sabatini
50a28b1393
doc/examples: do not check NULL values for avcodec_close()
...
avcodec_close() does nothing in case the argument is NULL. Simplify.
11 years ago
Clément Bœsch
1f7b7d5447
doc/examples: fix mem issues in filtering_video.
11 years ago
Clément Bœsch
fb10b43fc4
doc/examples: rename demuxing to demuxing_decoding.
...
That example shows how the decoding process works, not only the
demuxing.
11 years ago
Clément Bœsch
d10b1a200d
doc/examples/demuxing: show how to use the reference counting system.
11 years ago
Clément Bœsch
0c6bb53bb2
doc/examples/demuxing: reset got_frame.
...
Fix infinite loop at flushing.
11 years ago
Clément Bœsch
dc8f732292
doc/examples: fix lib math dep for resampling_audio.
...
It uses at least sin()
11 years ago
Clément Bœsch
98b9bbb787
doc/examples: remove extra "the".
...
"into the doc/examples directory" vs "into doc/examples".
11 years ago
Michael Niedermayer
f187390907
doc/examples/filtering_audio: make const arrays also static
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
wm4
72f5a6d067
examples: demuxing: print ffplay command even if sample format is planar
...
Adjust the code so that a working ffplay command is printed in the
planar audio case.
12 years ago
wm4
9f31c1608c
examples: demuxing: simplify audio output
...
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.
12 years ago
wm4
06b269dacb
examples: demuxing: do partial audio packet decoding
...
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.
12 years ago
Stefano Sabatini
2aa2b4ac65
examples/muxing: add support to audio resampling
...
Allows to encode to output in case the destination sample format is
different from AV_SAMPLE_FMT_S16.
12 years ago
Stefano Sabatini
838bd73139
lavfi: create Libav-API compatibility layer for avfilter_graph_parse() at the next bump
...
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 .
12 years ago
Stefano Sabatini
759dfd5684
examples/muxing: make more compact audio/video_time computation
12 years ago
Stefano Sabatini
80b56a7bdd
examples/muxing: rename audio/video_pts to audio/video_time
...
The new name is less confusing, since the variables represent times
rather than timestamps.
12 years ago
Stefano Sabatini
c58d535b2f
examples/Makefile: disable -O2 optimizations
...
There is no much point in optimizing example code, and the -O2 flag is
annoying when debugging.
12 years ago
Stefano Sabatini
3aa57e1582
examples/muxing: remove useless instruction
...
Simpler and less confusing.
12 years ago
Stefano Sabatini
4b6cf1ce0e
examples/muxing: vertically align
12 years ago
Nicolas George
300ca0763b
examples/filtering_audio: fix frame leak.
...
The frame is not used after being added to the filter
graph, there is no need to keep the reference.
12 years ago
Pavel Koshevoy
e5644313c5
examples/filtering_audio: get rid of AVABufferSinkParams
...
AVABufferSinkParams are ignored by avfilter_graph_create_filter,
therefore the example is misleading. Use av_opt_set_int_list to
configure abuffersink directly.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
f2619cbd61
examples/filtering_audio: enable ref counted frames
...
Fixes accessing freed memory
Signe-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
9ab221f8d8
lavfi: deprecate aconvert.
...
This filter is not required anymore with aformat. Drop it at next bump.
12 years ago
Stefano Sabatini
66c92a1575
examples/resampling_audio: make use of av_samples_alloc_array_and_samples()
...
Simplify.
12 years ago
Stefano Sabatini
9bb25dbd13
examples/filtering_*: constify AVFrame * for print_frame() and display_frame() functions
12 years ago
Stefano Sabatini
9076a6a943
examples/filtering_audio: update to new API
...
In particular, fix crash.
12 years ago
Stefano Sabatini
f0da370a52
examples/filtering_video: update to new API
...
In particular, fix crash.
12 years ago
Nicolas George
ceac5c54dd
Remove references to the "ff" variant of buffersink.
12 years ago
Clément Bœsch
5e4bc96415
doc: fix examples.
12 years ago