Commit Graph

91 Commits

Author SHA1 Message Date
Michael Niedermayer f285056810 doc/examples/muxing: fix "-flags" option
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 19:58:47 +02:00
Michael Niedermayer c437765be7 doc/examples/muxing: Exchange tmp_frame and frame
Reduces difference to 56f98e340f

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 12:03:51 +02:00
Michael Niedermayer d1ce43a3e8 doc/examples/muxing: mark correct frame as writeable
Bug found from comparing 56f98e340f to HEAD
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 01:55:17 +02:00
Michael Niedermayer fbd46e2f1c doc/examples/muxing: Always use swr, simplifies code slightly
Idea-from: 56f98e340f
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 01:32:19 +02:00
Anton Khirnov 22e9fe06eb doc/examples/muxing: add alloc_audio_frame() and use it to simplify code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 01:15:39 +02:00
Michael Niedermayer a98cadef7f doc/examples/muxing: Move samples_count to OutputStream
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 01:05:05 +02:00
Michael Niedermayer 8b1d54ba40 doc/examples/muxing: free swr context at the end
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 00:50:58 +02:00
Michael Niedermayer 7cf0865551 doc/examples/muxing: Support setting flags, for example for setting bitexact
This would allow the example to be used in regression tests

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 22:49:02 +02:00
Michael Niedermayer 5d2cf1ae86 doc/examples/muxing: select a supported sample rate for the encoder, favor 44100
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 22:27:50 +02:00
Michael Niedermayer ead22f42f4 doc/examples/muxing: pick a supported channel layout if stereo isnt supported by the encoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 22:01:08 +02:00
Michael Niedermayer 9ccb9c8df2 doc/examples/muxing: move swr context to OutputStream
Idea from: 56f98e340f
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 21:50:21 +02:00
Michael Niedermayer 1c0c19f8bd Merge commit '884f7c975f0af25febe86660e87bf3b2165a0309'
* commit '884f7c975f0af25febe86660e87bf3b2165a0309':
  output example: set the stream timebase

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 21:04:31 +02:00
Michael Niedermayer 4d3072ada3 doc/examples/muxing: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-28 21:44:38 +02:00
Michael Niedermayer 8469c73576 Merge commit '182d3f8221c23716ea4eafa460bdb94968f71f26'
* commit '182d3f8221c23716ea4eafa460bdb94968f71f26':
  output example: rewrite encoding logic

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-27 00:57:04 +02:00
Michael Niedermayer 9a2850c26a Merge commit 'a7fcd4122b19b0f934020f4e261d0c44c4c32e11'
* commit 'a7fcd4122b19b0f934020f4e261d0c44c4c32e11':
  output example: store the scaling context in the stream context

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-27 00:16:34 +02:00
Michael Niedermayer 877716a79c Merge commit '6a927d7aaf5625e83a674072913b9e292a303fd1'
* commit '6a927d7aaf5625e83a674072913b9e292a303fd1':
  output example: use a macro instead of a static variable

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 23:58:00 +02:00
Michael Niedermayer 5a55d5e445 Merge commit '63fd0d866c8300a8f251a15b1535e9ce40a407fb'
* commit '63fd0d866c8300a8f251a15b1535e9ce40a407fb':
  output example: allocate the audio frame only once

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 23:22:08 +02:00
Michael Niedermayer b9bfd888e5 Merge commit 'edd5f957646dcbf1bb55718bc7bf1e5481c25bcb'
* commit 'edd5f957646dcbf1bb55718bc7bf1e5481c25bcb':
  output example: use OutputStream for audio streams as well

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 23:01:52 +02:00
Michael Niedermayer 11991a7d90 Merge commit '5e7b125b6ae36893dfd9cb5661c99b67363cbb38'
* commit '5e7b125b6ae36893dfd9cb5661c99b67363cbb38':
  output example: use the new AVFrame API to allocate audio frames

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 22:46:11 +02:00
Michael Niedermayer a1c4635558 Merge commit 'ac85f631c9a9cc59aaca1c8dd6894fb1f701c594'
* commit 'ac85f631c9a9cc59aaca1c8dd6894fb1f701c594':
  output example: set output channel layout

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 22:13:46 +02:00
Michael Niedermayer 8eb1174a9e Merge commit '294daf71a7a1303b5ddd3cbefebed3b732d610f3'
* commit '294daf71a7a1303b5ddd3cbefebed3b732d610f3':
  output example: use a struct to bundle the video stream variables together

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 21:55:11 +02:00
Michael Niedermayer c9083d85df Merge commit '38d044429dabcd28928693240e955c6d4430cca9'
* commit '38d044429dabcd28928693240e955c6d4430cca9':
  output example: use the new AVFrame API for allocating the video frame

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-26 21:30:37 +02:00
Michael Niedermayer afa7ab557a Merge commit '452860d7e056f9a894cac2fe52cdedeae4c38251'
* commit '452860d7e056f9a894cac2fe52cdedeae4c38251':
  Use av_packet_rescale_ts() to simplify code.

Conflicts:
	doc/examples/muxing.c
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 17:03:58 +02:00
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>
2014-02-17 13:50:53 +01:00
Michael Niedermayer fba1592f35 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doc/examples: misc Doxygen markup improvements

Conflicts:
	doc/examples/muxing.c
	doc/examples/transcode_aac.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 15:31:14 +01:00
Stefano Sabatini 35fe88bb51 examples/muxing: reindent after previous commit 2014-01-23 01:08:24 +01:00
Stefano Sabatini c92d2f98db examples/muxing: flush encoders at the end 2014-01-23 00:54:33 +01:00
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.
2014-01-21 11:52:14 +01:00
Stefano Sabatini 9ab8f3738a examples/muxing: remove redundant {} 2014-01-20 13:10:10 +01:00
Stefano Sabatini b933c72b5e examples/muxing: change error checks, from "ret != 0" to "ret < 0"
More consistent and more future-proof.
2014-01-20 13:10:10 +01:00
Stefano Sabatini d72c742d47 examples/muxing: factorize write_interleave code
Also log output packet information.
2014-01-20 13:10:10 +01:00
Stefano Sabatini d497141b85 examples/muxing: simplify video PTS setting
Rely on frame_count. Also more consistent with audio path.
2014-01-12 09:25:48 +01:00
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>
2014-01-09 18:12:24 +01:00
Stefano Sabatini 094c500caf examples/muxing: set timestamps in output audio packet
In particular, fix trac ticket #3231.
2014-01-09 10:54:38 +01:00
Stefano Sabatini 8d22d37e54 examples/muxing: use av_frame_free() in place of av_free() 2014-01-09 10:51:57 +01:00
Stefano Sabatini 9abe4a10fd examples/muxing: reuse global audio frame
Simplify logic, avoid multiple unnecessary alloc/free operations.
2014-01-09 10:51:52 +01:00
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.
2014-01-09 10:51:47 +01:00
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.
2014-01-09 10:51:41 +01:00
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>
2013-12-21 12:22:49 +01:00
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>
2013-12-21 12:21:05 +01:00
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>
2013-12-21 12:20:44 +01:00
Michael Niedermayer 4cbf3eb9e6 Merge commit 'eb891b3114f499e96b9faddd0b0ae856345dfbd9'
* commit 'eb891b3114f499e96b9faddd0b0ae856345dfbd9':
  Replace all uses of avcodec_free_frame with av_frame_free().

Conflicts:
	doc/examples/decoding_encoding.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-11 23:18:51 +01:00
Michael Niedermayer 0ee905e243 Merge commit '5b9c3b4505206143d85398c1410949319fa1180f'
* commit '5b9c3b4505206143d85398c1410949319fa1180f':
  Replace all instances of avcodec_alloc_frame() with av_frame_alloc().

Conflicts:
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	libavcodec/alacenc.c
	libavcodec/libopenjpegenc.c
	libavcodec/libvpxenc.c
	libavcodec/pcm.c
	libavcodec/xbmenc.c
	libavcodec/xwdenc.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-16 23:54:10 +01:00
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.
2013-07-06 12:31:16 +02:00
Stefano Sabatini 759dfd5684 examples/muxing: make more compact audio/video_time computation 2013-07-03 11:31:34 +02:00
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.
2013-06-26 23:38:42 +02:00
Stefano Sabatini 3aa57e1582 examples/muxing: remove useless instruction
Simpler and less confusing.
2013-06-26 23:21:06 +02:00
Stefano Sabatini 4b6cf1ce0e examples/muxing: vertically align 2013-06-25 21:36:53 +02:00
Michael Niedermayer 5743095ca9 Merge commit '9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38'
* commit '9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38':
  avconv: print an error on applying options of the wrong type.
  atomic: Check for __sync_val_compare_and_swap instead of __sync_synchronize
  output-example: Update to use encode_video2 instead of the now dropped encode_video

Conflicts:
	doc/examples/muxing.c
	ffmpeg_opt.c
	libavutil/atomic.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-12 18:10:35 +01:00
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.
2013-03-05 15:43:32 +01:00