Commit Graph

1621 Commits

Author SHA1 Message Date
Clément Bœsch
21d650cb69 ffmpeg: more expressive sample rate automatic selection.
Output now lists the available sample rates with commands like
ffmpeg -f lavfi -i aevalsrc=0 -ar 20000 -y /tmp/out.mp3
2012-03-26 22:46:40 +02:00
Julien Ramseier
e479013ae4 Fix SVCD scan_offset option
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 19:29:31 +02:00
Michael Niedermayer
8bf95e8bd5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avc: Add a function for converting mp4 style extradata to annex b
  pthread: free progress if buffer allocation failed.
  lavc/avconv: support changing frame sizes in codecs with frame mt.
  libavformat: Document who sets the AVStream.id field
  utvideo: mark output picture as keyframe.
  sunrast: Add support for negative linesize.
  vp8: fix update_lf_deltas in libavcodec/vp8.c
  ralf: read Huffman code lengths without GetBitContext

Conflicts:
	ffmpeg.c
	libavcodec/sunrastenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 01:56:53 +01:00
Michael Niedermayer
f4c380a5e6 ffmpeg: drop struct from SwrContext.
Its a typdef now and doesnt need the struct anymore.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-25 01:00:07 +01:00
Michael Niedermayer
e2d110d8d2 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rv34: Handle only complete frames in frame-mt.
  MPV: set reference frame pointers to NULL when allocation of dummy pictures fails
  configure: die if x11grab dependencies are unavailable
  zerocodec: factorize loop
  avconv: fix the resampling safety factors for output audio buffer allocation
  avconv: move audio output buffer allocation to a separate function
  avconv: make the async buffer global and free it in exit_program()

Conflicts:
	ffmpeg.c
	libavcodec/mpegvideo.c
	libavcodec/rv34.c
	libavcodec/zerocodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-23 21:20:06 +01:00
Michael Niedermayer
1664edb998 ffmpeg: check samplerate from decoder.
Fixes FPE

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-23 10:59:03 +01:00
Reimar Döffinger
ffa28da180 Support dropping audio dts/pts via -async -1.
Allows working around issue #605.
Note: as a side effect this fixes that -vsync drop
as far as I could tell would not drop pts/dts values
when duplicating frames or when flushing encoder delay.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-03-22 20:36:16 +01:00
Michael Niedermayer
0ebd83617f Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
  avconv: free packet in write_frame() when discarding due to frame number limit
  FATE: use +/- flag option syntax for vp8 emu-edge tests
  lavf: make av_interleave_packet_per_dts() private.
  lavf: deprecate av_read_packet().
  oggdec: output correct timestamps for Vorbis
  avconv: pass input stream timestamps to audio encoders
  lavc: shrink encoded audio packet size after encoding.
  xa: set correct bit rate
  xa: do not set bit_rate, block_align, or bits_per_coded_sample
  xa: fix end-of-file handling
  xa: fix timestamp calculation
  bink: fix typo in FFALIGN() argument
  bink: align plane width to 8 when calculating bundle sizes
  doc: pass -Idoc texi2html and texi2pod
  doc: texi2pod: add -I flag
  movenc: Add a min_frag_duration option
  rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers
  libavformat: Set the default for the max_delay option to -1
  Generate manpages for AV{Format,Codec}Context AVOptions.
  doc/avconv: remove entries for AVOptions.
  ...

Conflicts:
	doc/Makefile
	doc/ffmpeg.texi
	doc/muxers.texi
	ffmpeg.c
	libavcodec/Makefile
	libavcodec/options.c
	libavcodec/vp8.c
	libavformat/options.c
	tests/fate/demux.mak
	tests/ref/fate/truemotion1-15
	tests/ref/fate/truemotion1-24

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-21 01:33:53 +01:00
Michael Niedermayer
4c1da0d11e ffmpeg: allow selective and complete disabling of map_metadata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-17 03:16:09 +01:00
Michael Niedermayer
4257ce112c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dxa: remove useless code
  lavf: don't select an attached picture as default stream for seeking.
  avconv: remove pointless checks.
  avconv: check for get_filtered_frame() failure.
  avconv: remove a pointless check.
  swscale: convert hscale() to use named arguments.
  x86inc: add *mp named argument support to DEFINE_ARGS.
  swscale: convert hscale to cpuflags().

Conflicts:
	ffmpeg.c
	libswscale/x86/scale.asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-16 01:36:49 +01:00
Michael Niedermayer
7230116000 ffmpeg: Fix planar audio input.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-14 08:03:29 +01:00
Michael Niedermayer
6968a7d193 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doc/general: update supported devices table.
  doc/general: add missing @tab to codecs table.
  h264: Fix invalid interlaced/progressive MB combinations for direct mode prediction.
  avconv: reindent
  avconv: link '-passlogfile' option to libx264 'stats' AVOption.
  libx264: add 'stats' private option for setting 2pass stats filename.
  libx264: fix help text for slice-max-size option.
  http: Clear the auth state on redirects
  http: Retry auth if it failed due to being stale
  rtsp: Resend new keepalive commands if they used stale auth
  rtsp: Retry authentication if failed due to being stale
  httpauth: Parse the stale field in digest auth
  dxva2_vc1: pass the overlap flag to the decoder
  dxva2_vc1: fix decoding of BI frames
  FATE: add shorthand to wavpack test
  dfa: convert to bytestream2 API
  anm decoder: move buffer allocation from decode_init() to decode_frame()
  h264: improve parsing of broken AVC SPS

Conflicts:
	ffmpeg.c
	libavcodec/anm.c
	libavcodec/dfa.c
	libavcodec/h264.c
	libavcodec/h264_direct.c
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-14 02:10:11 +01:00
Michael Niedermayer
ad53c7f9ec lavf: Add system to seperate relative timestamps from absolute ones.
With this we can always know if a timestamp is based on added durations
from an unknown origin or if it is based on a correct timestamp (and possibly
added durations)
This should fix some bugs where this distinction was mixed up.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-09 19:36:12 +01:00
Nicolas George
78306c51ef ffmpeg: show fps more accurately when it is small. 2012-03-08 00:11:59 +01:00
Michael Niedermayer
6df42f9874 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  SBR DSP: fix SSE code to not use SSE2 instructions.
  cpu: initialize mask to -1, so that by default, optimizations are used.
  error_resilience: initialize s->block_index[].
  svq3: protect against negative quantizers.
  Don't use ff_cropTbl[] for IDCT.
  swscale: make filterPos 32bit.
  FATE: add CPUFLAGS variable, mapping to -cpuflags avconv option.
  avconv: add -cpuflags option for setting supported cpuflags.
  cpu: add av_set_cpu_flags_mask().
  libx264: Allow overriding the sliced threads option
  avconv: fix counting encoded video size.

Conflicts:
	doc/APIchanges
	doc/fate.texi
	doc/ffmpeg.texi
	ffmpeg.c
	libavcodec/h264idct_template.c
	libavcodec/svq3.c
	libavutil/avutil.h
	libavutil/cpu.c
	libavutil/cpu.h
	libswscale/swscale.c
	tests/Makefile
	tests/fate-run.sh
	tests/regression-funcs.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-07 03:22:49 +01:00
Rick van der Zwet
d33a091cb3 ffm options should also set discard automatically.
commit 13f6917ca9 handles discards automatically,
but the ffm discard options are not fully parsed. Causing the input streams not
to be used, so no stream towards the ffserver after the initial probing.

Signed-off-by: Rick van der Zwet <info@rickvanderzwet.nl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-04 00:20:10 +01:00
Michael Niedermayer
c250063523 get_buffers: Check that pix_fmt is not NONE.
This is somewhat redundant as no decoder should call get_buffer() with such argument.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-29 06:27:38 +01:00
Michael Niedermayer
ddd86a2924 ffmpeg: Fix division by 0 due to invalid timebase
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-28 18:41:01 +01:00
Carl Eugen Hoyos
7b4e1466d4 Exit ffmpeg if swr_convert() fails. 2012-02-27 19:02:28 +01:00
Michael Niedermayer
574dcb5baf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: don't guess r_frame_rate from either stream or codec timebase.
  avconv: set discard on input streams automatically.
  Fix parser not to clobber has_b_frames when extradata is set.
  lavf: don't set codec timebase in avformat_find_stream_info().
  avconv: saner output video timebase.
  rawdec: set timebase to 1/fps.
  avconv: refactor vsync code.
  FATE: remove a bunch of useless -vsync 0
  cdxl: bit line plane arrangement support
  cdxl: remove early check for bpp
  cdxl: set pix_fmt PAL8 only if palette is available

Conflicts:
	ffmpeg.c
	libavcodec/h264_parser.c
	libavformat/rawdec.c
	tests/fate/demux.mak
	tests/fate/ea.mak
	tests/fate/h264.mak
	tests/fate/prores.mak
	tests/fate/video.mak
	tests/ref/fate/bethsoft-vid
	tests/ref/fate/creatureshock-avs
	tests/ref/fate/ea-cmv
	tests/ref/fate/interplay-mve-16bit
	tests/ref/fate/interplay-mve-8bit
	tests/ref/fate/nuv
	tests/ref/fate/prores-alpha
	tests/ref/fate/qtrle-16bit
	tests/ref/fate/qtrle-1bit
	tests/ref/fate/real-rv40
	tests/ref/fate/rpza
	tests/ref/fate/wmv8-drm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-27 04:35:35 +01:00
Reimar Döffinger
6a3f1726af Add missing av_free_packet.
Fixes memory leak when encoding at least with mpegvideo using the
new encode2 function.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-02-20 21:23:00 +01:00
Michael Niedermayer
f3bd226de6 ffmpeg: Fix setting flags for codec copy.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-18 14:34:16 +01:00
Michael Niedermayer
8c1ebdcea2 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  shorten: Use separate pointers for the allocated memory for decoded samples.
  atrac3: Fix crash in tonal component decoding.
  ws_snd1: Fix wrong samples counts.
  movenc: Don't set a default sample duration when creating ismv
  rtp: Factorize the check for distinguishing RTCP packets from RTP
  golomb: avoid infinite loop on all-zero input (or end of buffer).
  bethsoftvid: synchronize video timestamps with audio sample rate
  bethsoftvid: add audio stream only after getting the first audio packet
  bethsoftvid: Set video packet duration instead of accumulating pts.
  bethsoftvid: set packet key frame flag for audio and I-frame video packets.
  bethsoftvid: fix read_packet() return codes.
  bethsoftvid: pass palette in side data instead of in a separate packet.
  sdp: Ignore RTCP packets when autodetecting RTP streams
  proresenc: initialise 'sign' variable
  mpegaudio: replace memcpy by SIMD code
  vc1: prevent using last_frame as a reference for I/P first frame.

Conflicts:
	libavcodec/atrac3.c
	libavcodec/golomb.h
	libavcodec/shorten.c
	libavcodec/ws-snd1.c
	tests/ref/fate/bethsoft-vid

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-17 00:35:06 +01:00
Michael Niedermayer
60991ad6ae ffmpeg: Fix image allocation.
This probably fixes some of the use of uninitialized issues valgrind shows in fate.
It might also fix other issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-15 20:35:14 +01:00
Michael Niedermayer
c980be9e3a Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  CDXL demuxer and decoder
  hls: Re-add legacy applehttp name to preserve interface compatibility.
  hlsproto: Rename the functions and context
  hlsproto: Encourage users to try the hls demuxer instead of the proto
  doc: Move the hls protocol section into the right place
  libavformat: Rename the applehttp protocol to hls
  hls: Rename the functions and context
  libavformat: Rename the applehttp demuxer to hls
  rtpdec: Support H263 in RFC 2190 format
  rv30: check block type validity
  ttadec: CRC checking
  movenc: Support muxing VC1
  avconv: Don't split out inline sequence headers when stream copying VC1
  rv34: handle size changes during frame multithreading
  rv40: prevent undefined signed overflow in rv40_loop_filter()
  rv34: use AVERROR return values in ff_rv34_decode_frame()
  rv34: use uint16_t for RV34DecContext.deblock_coefs
  librtmp: Add "lib" prefix to librtmp URLProtocol declarations.
  movenc: Use defines instead of hardcoded numbers for RTCP types
  smjpegdec: implement seeking
  ...

Conflicts:
	Changelog
	doc/general.texi
	libavcodec/avcodec.h
	libavcodec/rv30.c
	libavcodec/tta.c
	libavcodec/version.h
	libavformat/Makefile
	libavformat/allformats.c
	libavformat/version.h
	libswscale/x86/swscale_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-15 01:52:14 +01:00
Stefano Sabatini
5d12b83ff1 ffmpeg.c: implement -debug_ts option
Mostly useful for debugging purposes.
2012-02-14 18:01:37 +01:00
Clément Bœsch
b986590810 ffmpeg: remove unneeded ost->picref check.
If there ost->picref is NULL, it will likely crash anyway a few lines
below by dereferencing it in order to access video attribute.
2012-02-13 23:32:39 +01:00
Clément Bœsch
c214e98634 ffmpeg: remove pointless avcodec_get_frame_defaults().
filtered_frame is overwritten just below anyway.
2012-02-13 23:32:39 +01:00
Clément Bœsch
73413e6bca ffmpeg: raise ENOMEM on avfilter_graph_alloc() failure. 2012-02-13 23:32:35 +01:00
Michael Niedermayer
4e04e1b81e Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: convert yuv2yuvX() to using named arguments.
  swscale: rename "dstw" to "w" to prevent name collisions.
  swscale: use named registers in yuv2yuv1_plane() place.
  lavf: fix aspect ratio mismatch message.
  avconv: set AVFormatContext.duration from '-t'
  cljr: implement encode2.
  cljr: set the properties of the coded_frame, not input frame.
  dnxhdenc: switch to encode2.
  bmpenc: switch to encode2().

Conflicts:
	libavcodec/bmpenc.c
	libavcodec/cljr.c
	libavformat/utils.c
	tests/ref/vsynth1/cljr
	tests/ref/vsynth2/cljr

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-13 02:06:44 +01:00
Reimar Döffinger
c15f3bd3db Simplify: use local variable with same contents directly.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-02-12 18:56:07 +01:00
Michael Niedermayer
85f25cfa19 ffmpeg: fix passlogfile with multiple libx264 streams.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-12 00:03:26 +01:00
Michael Niedermayer
a78f6b8cb9 Merge remote-tracking branch 'qatar/master'
* qatar/master: (38 commits)
  v210enc: remove redundant check for pix_fmt
  wavpack: allow user to disable CRC checking
  v210enc: Use Bytestream2 functions
  cafdec: Check return value of avio_seek and avoid modifying state if it fails
  yop: Check return value of avio_seek and avoid modifying state if it fails
  tta: Check return value of avio_seek and avoid modifying state if it fails
  tmv: Check return value of avio_seek and avoid modifying state if it fails
  r3d: Check return value of avio_seek and avoid modifying state if it fails
  nsvdec: Check return value of avio_seek and avoid modifying state if it fails
  mpc8: Check return value of avio_seek and avoid modifying state if it fails
  jvdec: Check return value of avio_seek and avoid modifying state if it fails
  filmstripdec: Check return value of avio_seek and avoid modifying state if it fails
  ffmdec: Check return value of avio_seek and avoid modifying state if it fails
  dv: Check return value of avio_seek and avoid modifying state if it fails
  bink: Check return value of avio_seek and avoid modifying state if it fails
  Check AVCodec.pix_fmts in avcodec_open2()
  svq3: Prevent illegal reads while parsing extradata.
  remove ParseContext1
  vc1: use ff_parse_close
  mpegvideo parser: move specific fields into private context
  ...

Conflicts:
	libavcodec/4xm.c
	libavcodec/aacdec.c
	libavcodec/h264.c
	libavcodec/h264.h
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/mpeg4video_parser.c
	libavcodec/svq3.c
	libavcodec/v210enc.c
	libavformat/cafdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-11 01:22:22 +01:00
Clément Bœsch
a3c4371f3c ffmpeg: prefer NULL over 0 for av_log context pointer parameter. 2012-02-10 20:47:42 +01:00
Clément Bœsch
158bd596a6 ffmpeg: move quality parameter to do_video_out() scope.
This make do_video_out() and do_audio_out() consistent. Also simplifies
callers.
2012-02-10 20:13:36 +01:00
Clément Bœsch
63b5e99fab ffmpeg: make use of ret error out in transcode_video(). 2012-02-10 20:13:36 +01:00
Clément Bœsch
086fc4d765 ffmpeg: move filtered_frame to the CONFIG_AVFILTER scope.
This simplifies a bit the #ifdefery.
2012-02-10 20:13:36 +01:00
Clément Bœsch
9303b794b8 ffmpeg: move do_video_stats() above do_video_out().
This avoid a forward declaration.
2012-02-10 20:12:52 +01:00
Clément Bœsch
a78dd826ee ffmpeg: move video stats code to do_video_out().
This will allow some simplifications in transcode_video().
2012-02-10 20:12:52 +01:00
Clément Bœsch
cf31060127 ffmpeg: move filtered_frame to video stream processing scope. 2012-02-10 20:12:52 +01:00
Clément Bœsch
aede21f1b6 ffmpeg: reindent after video frame polling simplification. 2012-02-10 19:59:38 +01:00
Clément Bœsch
e22c7b4e25 ffmpeg: simplify video frame polling.
input_video_filter and output_video_filter can't be NULL at this point.
If they are, the current code would likely crash anyway (since
filtered_frame would be NULL and sent to do_video_out().
2012-02-10 19:59:38 +01:00
Clément Bœsch
4ab4b3db5a ffmpeg: use exit_program() if configure_video_filters() fails. 2012-02-10 19:59:38 +01:00
Michael Niedermayer
29034e6503 ffmpeg: Add threshold to discard crazy/damaged timestamps.
The added tests are limited to the case where timestamp discontinuities
are not allowed. The default is 30 hours which is arbitrarily picked and
quite conservative.
This prevents a out of memory condition due to duplicating a frame
millions of times.

Found-by:  Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-10 05:40:42 +01:00
Michael Niedermayer
677911ad81 ffmpeg: better dox for *pts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-09 19:03:31 +01:00
Michael Niedermayer
f2b20b7a8b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pixdesc: mark pseudopaletted formats with a special flag.
  avconv: switch to avcodec_encode_video2().
  libx264: implement encode2().
  libx264: split extradata writing out of encode_nals().
  lavc: add avcodec_encode_video2() that encodes from an AVFrame -> AVPacket
  cmdutils: update copyright year to 2012.
  swscale: sign-extend integer function argument to qword on x86-64.
  x86inc: support yasm -f win64 flag also.
  h264: manually save/restore XMM registers for functions using INIT_MMX.
  x86inc: allow manual use of WIN64_SPILL_XMM.
  aacdec: Use correct speaker order for 7.1.
  aacdec: Remove incorrect comment.
  aacdec: Simplify output configuration.
  Remove Sun medialib glue code.
  dsputil: set STRIDE_ALIGN to 16 for x86 also.
  pngdsp: swap argument inversion.

Conflicts:
	cmdutils.c
	configure
	doc/APIchanges
	ffmpeg.c
	libavcodec/aacdec.c
	libavcodec/dsputil.h
	libavcodec/libx264.c
	libavcodec/mlib/dsputil_mlib.c
	libavcodec/utils.c
	libavfilter/vf_scale.c
	libavutil/avutil.h
	libswscale/mlib/yuv2rgb_mlib.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-09 01:27:12 +01:00
Michael Niedermayer
d8710228ea ffmpeg: change sync_opts code to be more similar to qatar.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-08 23:50:37 +01:00
Michael Niedermayer
fba318a4b0 ffmpeg: update (next_)pts in the stream copy case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-08 17:26:06 +01:00
Michael Niedermayer
160008a60f ffmpeg: use ist->dts in rate_emu_sleep()
Based on change by Anton Khirnov.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-08 17:25:40 +01:00
Michael Niedermayer
e7f4de34ad ffmpeg: use ist->dts in do_streamcopy()
Based on change by Anton Khirnov.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-08 17:25:01 +01:00