Michael Niedermayer
341639fe80
doc/examples: remove pathes from doxy examples
...
This makes the examples page less cluttered
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Stefano Sabatini
35fe88bb51
examples/muxing: reindent after previous commit
11 years ago
Stefano Sabatini
c92d2f98db
examples/muxing: flush encoders at the end
11 years ago
Stefano Sabatini
e34ad128a3
examples/muxing: reduce duration, remove wrong and misleading comment
...
Set duration to 10 seconds, after it was increased from 5 to 200 seconds
in 8d80f3cb87
.
200 seconds will generate too much data which is annoying especially when
testing.
11 years ago
Stefano Sabatini
9ab8f3738a
examples/muxing: remove redundant {}
11 years ago
Stefano Sabatini
b933c72b5e
examples/muxing: change error checks, from "ret != 0" to "ret < 0"
...
More consistent and more future-proof.
11 years ago
Stefano Sabatini
d72c742d47
examples/muxing: factorize write_interleave code
...
Also log output packet information.
11 years ago
Stefano Sabatini
d497141b85
examples/muxing: simplify video PTS setting
...
Rely on frame_count. Also more consistent with audio path.
11 years ago
Andre Anjos
23ffc4c70d
doc/examples/muxing: Fixes frame initialization.
...
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>
11 years ago
Stefano Sabatini
094c500caf
examples/muxing: set timestamps in output audio packet
...
In particular, fix trac ticket #3231 .
11 years ago
Stefano Sabatini
8d22d37e54
examples/muxing: use av_frame_free() in place of av_free()
11 years ago
Stefano Sabatini
9abe4a10fd
examples/muxing: reuse global audio frame
...
Simplify logic, avoid multiple unnecessary alloc/free operations.
11 years ago
Stefano Sabatini
80bca6eabe
examples/muxing: honour distinction between encoder PTS timebase and stream timebase
...
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.
11 years ago
Stefano Sabatini
eadc421259
examples/muxing: set sample formats from list of codec supported sample formats
...
Avoid the need of tweaking, also show how to get list of supported sample
formats.
11 years ago
Ilya Basin
d1b8e01ef1
examples/muxing: fix memleaks in resampler
...
- 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>
11 years ago
Ilya Basin
7d1d0b3ecf
examples/muxing: use S16 sample_fmt for resample src regardless of codec sample_fmt
...
We generate S16 samples and we should allocate the right buffer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ilya Basin
b6714fa077
examples/muxing: fix av_frame_free() not called when got_packet is false
...
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>
11 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
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
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
9b211c43dc
examples/muxing: fix memory leak.
...
Do not re-call avcodec_get_context_defaults3(), it is already
called by avformat_new_stream() and it leaks the codec
priv_data that was already allocated.
Use avformat_free_context() instead of freeing (not)
everything manually.
Fix trac ticket #2322 .
12 years ago
Nicolas George
e4f14c32b9
examples/muxing: improve error messages.
...
Illustrate the use of return values, av_err2str and
avcodec_get_name.
12 years ago
Michael Niedermayer
ca28cb5f83
examples: fix doxy so they appear on the example page
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Stefano Sabatini
eebde404bc
examples/muxing: merge add_audio_stream() and add_video_stream()
...
Factorize.
12 years ago
Stefano Sabatini
eda0a52bf1
examples/muxing: check on frame
...
Fix crash in case frame is not defined (e.g. with muxing out.wav).
12 years ago
Stefano Sabatini
d6196d9421
examples/muxing: fix bogus setting of st->id
12 years ago
Stefano Sabatini
5ca298df2d
examples/muxing: remove misleading comment about pending API change
...
The API was never changed since 2003. Replace with a comment about the
performed operation.
12 years ago
Stefano Sabatini
1f7962625c
examples/muxing: remove video_outbuf unused and useless code
12 years ago
Michael Niedermayer
7b8fd29816
examples/muxing: fix video pts
...
Fixes Ticket1801
Based on suggestion from AztecC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Stefano Sabatini
a726ac9a11
examples/muxing: extend usage notice
12 years ago
Stefano Sabatini
59e31aa2ca
examples/muxing: provide more information in case of avcodec_open2 failure
12 years ago
Stefano Sabatini
6133149e0c
examples/muxing: add missing error checks
12 years ago
Stefano Sabatini
e56b3a5ebb
examples/muxing: fix case inconsistency in message
12 years ago
Stefano Sabatini
34b5b735f9
examples/muxing: add check on avformat_write_header() result
12 years ago
Stefano Sabatini
b3e2975ab3
examples/muxing: apply misc fixes to log messages
12 years ago
Stefano Sabatini
1d0048cfe3
examples/muxing: rename img_convert_ctx to sws_ctx
...
The new name is more consistent with the codebase, and more
self-consistent with the libswscale API.
12 years ago
Stefano Sabatini
976bb42aca
examples/muxing: merge some declarations and definitions
12 years ago
Stefano Sabatini
bdd9bfbbab
examples/muxing: prefer AVPicture to AVFrame, when feasible
...
Favor the use of plain AVPicture over AVFrame, especially when the use of
AVFrame is not required like in the case of tmp_picture.
Also adopt more straightforward names, to avoid frame/picture confusion.
12 years ago
Stefano Sabatini
952caf11f2
examples/muxing: remove pointless #undef exit
13 years ago
Stefano Sabatini
864e8adcf1
examples/muxing: update to the new avcodec_encode_video2() API
13 years ago
Stefano Sabatini
005af8ce61
examples/muxing: cast sws_scale() argument to the expected one
...
Fix warnings:
muxing.c: In function ‘write_video_frame’:
muxing.c:326:23: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [enabled by default]
13 years ago
Stefano Sabatini
13bbc464ed
examples/muxing: set codec in the codec context
...
Make add_{audio,video}_stream return the found codec, and pass it to
avcodec_open2() through open_{audio,video} functions.
Fix failure:
No codec provided to avcodec_open2().
could not open codec
This is also consistent with the use of the avcodec_open2() API in the
codebase.
13 years ago
Stefano Sabatini
b907655303
examples/muxing: drop duplicated code in add_video_stream()
13 years ago
Stefano Sabatini
66747a6160
examples/muxing: simplify alloc_picture()
...
Use avpicture_alloc() high level function.
13 years ago
Clément Bœsch
6c211085bb
doc/examples: use system headers in decoding_encoding and muxing.
...
All the other examples already use the system installed headers.
13 years ago
Michael Niedermayer
afe9105f66
example: update muxing example to purple API
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
cf257f30b9
doc/example/muxing: fix video timestamps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
096701d9b2
muxing example: set encoder defaults
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago