aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/muxing.c
Commit message (Collapse)AuthorAgeFilesLines
...
* examples/muxing: reindent after previous commitStefano Sabatini2014-01-231-32/+32
|
* examples/muxing: flush encoders at the endStefano Sabatini2014-01-231-23/+30
|
* examples/muxing: reduce duration, remove wrong and misleading commentStefano Sabatini2014-01-211-2/+1
| | | | | | | | Set duration to 10 seconds, after it was increased from 5 to 200 seconds in 8d80f3cb877b890889b1673029387229648901ed. 200 seconds will generate too much data which is annoying especially when testing.
* examples/muxing: remove redundant {}Stefano Sabatini2014-01-201-6/+4
|
* examples/muxing: change error checks, from "ret != 0" to "ret < 0"Stefano Sabatini2014-01-201-2/+3
| | | | More consistent and more future-proof.
* examples/muxing: factorize write_interleave codeStefano Sabatini2014-01-201-17/+28
| | | | Also log output packet information.
* examples/muxing: simplify video PTS settingStefano Sabatini2014-01-121-3/+1
| | | | Rely on frame_count. Also more consistent with audio path.
* doc/examples/muxing: Fixes frame initialization.Andre Anjos2014-01-091-0/+3
| | | | | | | | | | | | | 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>
* examples/muxing: set timestamps in output audio packetStefano Sabatini2014-01-091-0/+7
| | | | In particular, fix trac ticket #3231.
* examples/muxing: use av_frame_free() in place of av_free()Stefano Sabatini2014-01-091-1/+1
|
* examples/muxing: reuse global audio frameStefano Sabatini2014-01-091-7/+13
| | | | Simplify logic, avoid multiple unnecessary alloc/free operations.
* examples/muxing: honour distinction between encoder PTS timebase and stream ↵Stefano Sabatini2014-01-091-1/+5
| | | | | | | | | | 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.
* examples/muxing: set sample formats from list of codec supported sample formatsStefano Sabatini2014-01-091-1/+2
| | | | | Avoid the need of tweaking, also show how to get list of supported sample formats.
* examples/muxing: fix memleaks in resamplerIlya Basin2013-12-211-12/+18
| | | | | | | - 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>
* examples/muxing: use S16 sample_fmt for resample src regardless of codec ↵Ilya Basin2013-12-211-1/+1
| | | | | | | | sample_fmt We generate S16 samples and we should allocate the right buffer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* examples/muxing: fix av_frame_free() not called when got_packet is falseIlya Basin2013-12-211-1/+2
| | | | | | | 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>
* Merge commit 'eb891b3114f499e96b9faddd0b0ae856345dfbd9'Michael Niedermayer2013-12-111-1/+1
| | | | | | | | | | * 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>
* Merge commit '5b9c3b4505206143d85398c1410949319fa1180f'Michael Niedermayer2013-11-161-2/+2
| | | | | | | | | | | | | | | | | | | * 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>
* examples/muxing: add support to audio resamplingStefano Sabatini2013-07-061-28/+93
| | | | | Allows to encode to output in case the destination sample format is different from AV_SAMPLE_FMT_S16.
* examples/muxing: make more compact audio/video_time computationStefano Sabatini2013-07-031-9/+2
|
* examples/muxing: rename audio/video_pts to audio/video_timeStefano Sabatini2013-06-261-8/+8
| | | | | The new name is less confusing, since the variables represent times rather than timestamps.
* examples/muxing: remove useless instructionStefano Sabatini2013-06-261-1/+0
| | | | Simpler and less confusing.
* examples/muxing: vertically alignStefano Sabatini2013-06-251-2/+1
|
* Merge commit '9d3009c6c4b9b6734f07df7c88f6a42ded6cdf38'Michael Niedermayer2013-03-121-11/+5
| | | | | | | | | | | | | | * 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>
* examples/muxing: fix memory leak.Nicolas George2013-03-051-9/+2
| | | | | | | | | | | 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.
* examples/muxing: improve error messages.Nicolas George2013-01-021-17/+28
| | | | | Illustrate the use of return values, av_err2str and avcodec_get_name.
* examples: fix doxy so they appear on the example pageMichael Niedermayer2012-10-261-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* examples/muxing: merge add_audio_stream() and add_video_stream()Stefano Sabatini2012-10-171-70/+55
| | | | Factorize.
* examples/muxing: check on frameStefano Sabatini2012-10-171-1/+2
| | | | Fix crash in case frame is not defined (e.g. with muxing out.wav).
* examples/muxing: fix bogus setting of st->idStefano Sabatini2012-10-171-3/+2
|
* examples/muxing: remove misleading comment about pending API changeStefano Sabatini2012-10-171-2/+1
| | | | | The API was never changed since 2003. Replace with a comment about the performed operation.
* examples/muxing: remove video_outbuf unused and useless codeStefano Sabatini2012-10-171-15/+1
|
* examples/muxing: fix video ptsMichael Niedermayer2012-10-171-4/+1
| | | | | | Fixes Ticket1801 Based on suggestion from AztecC Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* examples/muxing: extend usage noticeStefano Sabatini2012-10-151-1/+3
|
* examples/muxing: provide more information in case of avcodec_open2 failureStefano Sabatini2012-10-151-2/+2
|
* examples/muxing: add missing error checksStefano Sabatini2012-10-151-2/+11
|
* examples/muxing: fix case inconsistency in messageStefano Sabatini2012-10-151-1/+1
|
* Merge commit '716d413c13981da15323c7a3821860536eefdbbb'Michael Niedermayer2012-10-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '716d413c13981da15323c7a3821860536eefdbbb': Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat Conflicts: doc/examples/muxing.c ffmpeg.h ffmpeg_filter.c ffmpeg_opt.c ffplay.c ffprobe.c libavcodec/8bps.c libavcodec/aasc.c libavcodec/aura.c libavcodec/avcodec.h libavcodec/avs.c libavcodec/bfi.c libavcodec/bmp.c libavcodec/bmpenc.c libavcodec/c93.c libavcodec/cscd.c libavcodec/cyuv.c libavcodec/dpx.c libavcodec/dpxenc.c libavcodec/eatgv.c libavcodec/escape124.c libavcodec/ffv1.c libavcodec/flashsv.c libavcodec/fraps.c libavcodec/h264.c libavcodec/huffyuv.c libavcodec/iff.c libavcodec/imgconvert.c libavcodec/indeo3.c libavcodec/kmvc.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libx264.c libavcodec/ljpegenc.c libavcodec/mjpegdec.c libavcodec/mjpegenc.c libavcodec/motionpixels.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo_enc.c libavcodec/pamenc.c libavcodec/pcxenc.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/pnm.c libavcodec/pnmdec.c libavcodec/pnmenc.c libavcodec/ptx.c libavcodec/qdrw.c libavcodec/qpeg.c libavcodec/qtrleenc.c libavcodec/raw.c libavcodec/rawdec.c libavcodec/rl2.c libavcodec/sgidec.c libavcodec/sgienc.c libavcodec/snowdec.c libavcodec/snowenc.c libavcodec/sunrast.c libavcodec/targa.c libavcodec/targaenc.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/tmv.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/vb.c libavcodec/vp3.c libavcodec/wnv1.c libavcodec/xl.c libavcodec/xwddec.c libavcodec/xwdenc.c libavcodec/yop.c libavdevice/v4l2.c libavdevice/x11grab.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/buffersrc.c libavfilter/drawutils.c libavfilter/formats.c libavfilter/src_movie.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_format.c libavfilter/vf_hflip.c libavfilter/vf_lut.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/vf_transpose.c libavfilter/vf_yadif.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/movenc.c libavformat/mxf.h libavformat/utils.c libavformat/yuv4mpeg.c libavutil/imgutils.c libavutil/pixdesc.c libswscale/input.c libswscale/output.c libswscale/swscale_internal.h libswscale/swscale_unscaled.c libswscale/utils.c libswscale/x86/swscale_template.c libswscale/x86/yuv2rgb.c libswscale/x86/yuv2rgb_template.c libswscale/yuv2rgb.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '7751e4693dd10ec98c20fbd9887233b575034272'Michael Niedermayer2012-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7751e4693dd10ec98c20fbd9887233b575034272': ogg: check that the expected number of headers had been parsed libx264: change default to closed gop to match x264cli Use avcodec_free_frame() to free AVFrames. lavf: use a malloced AVFrame in try_decode_frame(). lavc: add avcodec_free_frame(). lavc: ensure extended_data is set properly on decoding lavc: initialize AVFrame.extended_data in avcodec_get_frame_defaults() lavc: use av_mallocz to allocate AVFrames. lavc: rename the argument of avcodec_alloc_frame/get_frame_defaults Conflicts: doc/APIchanges doc/examples/decoding_encoding.c libavcodec/utils.c libavcodec/version.h libavfilter/src_movie.c libavformat/oggdec.c libavformat/oggdec.h libavformat/oggparsetheora.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* examples/muxing: add check on avformat_write_header() resultStefano Sabatini2012-09-111-1/+4
|
* examples/muxing: apply misc fixes to log messagesStefano Sabatini2012-09-111-5/+5
|
* examples/muxing: rename img_convert_ctx to sws_ctxStefano Sabatini2012-09-111-9/+7
| | | | | The new name is more consistent with the codebase, and more self-consistent with the libswscale API.
* examples/muxing: merge some declarations and definitionsStefano Sabatini2012-09-111-6/+2
|
* examples/muxing: prefer AVPicture to AVFrame, when feasibleStefano Sabatini2012-09-111-29/+29
| | | | | | | 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.
* examples/muxing: remove pointless #undef exitStefano Sabatini2012-08-301-2/+0
|
* examples/muxing: update to the new avcodec_encode_video2() APIStefano Sabatini2012-08-241-9/+15
|
* examples/muxing: cast sws_scale() argument to the expected oneStefano Sabatini2012-08-221-1/+2
| | | | | | 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]
* Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* examples/muxing: set codec in the codec contextStefano Sabatini2012-08-071-19/+20
| | | | | | | | | | | | 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.
* examples/muxing: drop duplicated code in add_video_stream()Stefano Sabatini2012-08-051-6/+0
|