Commit Graph

1415 Commits

Author SHA1 Message Date
Michael Niedermayer b5875b9111 Add libswresample.
Similar to libswscale this does resampling and format convertion, just for audio
instead of video.
changing sampling rate, sample formats, channel layouts and sample packing all
in one with a very simple public interface.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-19 07:04:17 +02:00
Michael Niedermayer 8f5bb35f40 ffmpeg: fix video synchronization code to be exact on constant fps videos. Fixes Ticket137
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-13 17:29:23 +02:00
Clément Bœsch 677a831ec6 ffmpeg: remove unused data_codec_name. 2011-09-12 12:09:09 +02:00
Clément Bœsch 525d4852b9 ffmpeg: set {audio,video,subtitle}_codec_name const.
This fixes "assignment discards ‘const’ qualifier from pointer target
type." warnings.
2011-09-12 12:09:08 +02:00
Clément Bœsch 4b961ddfea ffmpeg: a bit more consistent prototypes. 2011-09-12 11:52:55 +02:00
Michael Niedermayer 411cc5c46a Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  audioconvert: add explanatory comments to channel_names array
  audioconvert: K&R whitespace cosmetics
  avconv: use correct index when selecting metadata to write to.
  avconv: fix inverted variable
  doc/avconv: document option types (input/output/per-stream/...)
  doc/avtools-common-opts: write a section about stream specifiers.
  doc/avconv: remove two pointless paragraphs.
  doc/avconv: document that global options should be specified first.
  doc/avconv: remove entries for nonexistent options
  doc/avconv: remove documentation for removed 'timestamp' option
  doc: cosmetics, rename fftools-common-opts to avtools-....
  avconv: move streamid_map to options context.
  avconv: extend -vf syntax
  avconv: move top_field_first to options context.
  avconv: move inter/intra matrix to options context.
  avconv: remove -psnr option.
  avconv: remove me_threshold option.
  avconv: move video_rc_override_string to options context.
  avconv: move frame pixel format to the options context.
  avconv: move frame aspect ratio to the options context.
  ...

Conflicts:
	avconv.c
	cmdutils_common_opts.h
	doc/avconv.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-12 00:32:54 +02:00
Michael Niedermayer 0c0ec4be6b ffmpeg: dont copy duration when -t is used
Fixes Ticket445

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-11 05:24:26 +02:00
Michael Niedermayer 7ba8e6bbae ffmpeg: replace messy duplicated tag compatibility functions by more generic solution.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-11 01:23:05 +02:00
Michael Niedermayer cec92fe49a ffmpeg: add vbsf & absf for compatibility.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-11 01:22:58 +02:00
Michael Niedermayer 7db7eb08e0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
  avconv: move audio_channels to the options context.
  avconv: move *_disable to options context.
  avconv: remove -[vas]lang options.
  avconv: move codec tags to options context.
  cljr: init_get_bits size in bits instead of bytes
  indeo2: fail if input buffer too small
  indeo2: init_get_bits size in bits instead of bytes
  ffv1: Fixed size given to init_get_bits() in decoder.

Conflicts:
	avconv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-10 20:52:48 +02:00
Michael Niedermayer 1bb766a988 ffmpeg: fix -re
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-09 19:54:04 +02:00
Stefano Sabatini 4f7dfe12ea lavfi: rename vsink_buffer.c to sink_buffer.c, and vsink_buffer.h to buffersink.h
This is done in order to clarify the non-video-specific nature of the
buffersink code, as the result of the video/audio API unification of
the previous commit, and for improving overall consistency.
2011-09-06 18:51:09 +02:00
Stefano Sabatini c4415f6ec9 lavfi: unify asink_buffer and vsink_buffer API
The new API is more generic (no distinction between audio/video for
pulling frames), and avoids code duplication.

A backward compatibility layer is kept for avoiding tools ABI breaks
(only for the video binary interface, audio interface was never used
in the tools).
2011-09-06 18:47:04 +02:00
Michael Niedermayer d543b3bb52 ffmpeg: map subtitle stream by default when user specified -scodec
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-06 00:49:23 +02:00
Michael Niedermayer 3c54e7ed4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ac3enc: Add channel coupling support for the fixed-point AC-3 encoder.
  ac3enc: scale floating-point coupling channel coefficients in scale_coefficients() rather than in apply_channel_coupling()
  ac3enc: fix encoding of stereo ac3 files when rematrixing is disabled.
  wavpack: fix wrong return value in wavpack_decode_block()
  avconv: fix parsing metadata specifiers.
  fate: use +frame+slice named constants instead of '3'
  mpeg12: propagate more real return values through chunk decode error return and fix some indentation
  wavpack: use context reset in appropriate places
  avconv: move mux_preload and mux_max_delay to options context
  avconv: move bitstream filters to options context.
  avconv: move rate_emu to options context.
  avconv: move max_frames to options context.
  avconv: move metadata to options context.
  avconv: move ts scale to options context.
  avconv: move chapter maps to options context.
  avconv: move metadata maps to options context.
  avconv: move codec_names to options context.

Conflicts:
	avconv.c
	tests/fate-run.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 22:29:16 +02:00
Michael Niedermayer 6f8b1fcd4b ffmpeg: tell reset_options() if it is used on input or output files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 03:11:18 +02:00
Michael Niedermayer d2084402e6 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: fix type for thread_type option
  avconv: move format to options context
  avconv: move limit_filesize to options context
  avconv: move start_time, recording_time and input_ts_offset to options context
  avconv: add a context for options.
  cmdutils: allow storing per-stream/chapter/.... options in a generic way
  cmdutils: split per-option code out of parse_options().
  cmdutils: add support for caller-provided option context.
  cmdutils: declare only one pointer type in OptionDef
  cmdutils: move grow_array() from avconv to cmdutils.
  cmdutils: move exit_program() declaration to cmdutils from avconv
  http: Consider the stream as seekable if the reply contains Accept-Ranges: bytes
  nutenc: add namespace to the api facing functions

Conflicts:
	avconv.c
	cmdutils.c
	cmdutils.h
	ffmpeg.c
	ffplay.c
	ffprobe.c
	ffserver.c
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 03:10:45 +02:00
Anton Khirnov 7cc8d6385a cmdutils: add support for caller-provided option context.
This is the first step to removing the globals plague from avtools.
2011-09-04 13:12:00 +02:00
Anton Khirnov cac651c834 cmdutils: move grow_array() from avconv to cmdutils. 2011-09-04 13:12:00 +02:00
Anton Khirnov dad09ff93f cmdutils: move exit_program() declaration to cmdutils from avconv
Allows cmdutils to call each tool's own cleanup function.
2011-09-04 13:12:00 +02:00
Michael Niedermayer 1889c6724a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  AVOptions: fix av_set_string3() doxy to match reality.
  cmdutils: get rid of dummy contexts for examining AVOptions.
  lavf,lavc,sws: add {avcodec,avformat,sws}_get_class() functions.
  AVOptions: add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find().
  cpu detection: avoid a signed overflow

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	libavcodec/options.c
	libavcodec/version.h
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-04 04:11:53 +02:00
Michael Niedermayer ca4d71b149 ffmpeg: fix reading from stdin on windows
Based on code by Rolf Siegrist
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-04 02:14:39 +02:00
Anton Khirnov 20c21f8b75 cmdutils: get rid of dummy contexts for examining AVOptions.
Replace it with newly introduced libavutil API.
2011-09-03 20:58:15 +02:00
Michael Niedermayer 6233a3a153 Revert "ffmpeg: remove presets." and reimplement the needed parts that no longer exist.
Needed by libvpx

This reverts commit a0147957e7.
2011-09-03 00:50:00 +02:00
Chiranjeevi Melam e6ea4c715d ffmpeg: Fix minor memleak of input_tmp 2011-09-02 01:09:39 +02:00
Clément Bœsch df8737eb35 ffmpeg: fix two unused variables warnings. 2011-09-01 20:23:40 +02:00
Carl Eugen Hoyos c0e8bce349 Fix compilation with --disable-avfilter.
Fixes ticket #425.
2011-09-01 19:03:39 +02:00
Michael Niedermayer 3584b01e4e ffmpeg: Fix typos introduced in:
commit 630902a1e1
	Author: Anton Khirnov <anton@khirnov.net>
	Date:   Wed Jul 6 08:49:07 2011 +0200
	avconv: factor out initializing input streams.

These caused scrambled error messages to be printed and
floating point exceptions.
For example when there was no decoder available for a
stream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-01 04:17:23 +02:00
Michael Niedermayer 76ba894eab Merge commit 'f593628e5868e52a46de666767896c6afcebdae4'
* commit 'f593628e5868e52a46de666767896c6afcebdae4':
  avconv: Replace raw picture frame swapping hack.
  RV40: reuse some H.264 motion compensation functions in RV40.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-31 00:12:05 +02:00
Michael Niedermayer 7c3f4fb42d ffmpeg: ffmpeg: fix reading commands from the keyboard
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 21:56:40 +02:00
Michael Niedermayer e312543c82 ffmpeg: fix reading commands from stdin
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 20:27:11 +02:00
Anton Khirnov 4bb2a74ffc ffmpeg: re-add nb_streams to InputFile.
It was mistakenly removed in 2cf8355f98,
not taking into account that new streams might appear in av_read_frame()
that avconv doesn't know about.

Fixes bug 24.
2011-08-30 18:10:10 +02:00
Alex Converse ff037c54b4 ffmpeg: Replace goto redo on decode fail with continue.
This checks for sigterm but otherwise is identical to the previous
behavior.
2011-08-30 18:10:10 +02:00
Alex Converse cf89e55ac0 ffmpeg: Remove dead store. 2011-08-30 18:10:10 +02:00
Alex Converse 08fe874fa4 ffmpeg: use av_clip_int16 for audio clipping 2011-08-30 18:10:09 +02:00
Michael Niedermayer ef24426599 ffmpeg: switch stream mapping print code to qatars variant
Author of the lines of code is probably Nicolas and or Anton
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 18:08:35 +02:00
Anton Khirnov 10c3b03380 ffmpeg: move the avcodec_find_decoder() call to add_input_streams().
This makes the code simpler to understand, though it results in an
unnecessary call to avcodec_find_decoder() if the stream won't be
decoded.
2011-08-30 18:08:23 +02:00
Alex Converse 93ed69ad21 ffmpeg: Separate initialization from the main transcode loop. 2011-08-30 18:08:23 +02:00
Anton Khirnov e5362cecfb ffmpeg: reset input_ts_offset between files.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 18:08:23 +02:00
Anton Khirnov 3806494549 ffmpeg: call flush_encoders() from transcode() directly.
And remove now pointless parameter.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 18:08:23 +02:00
Anton Khirnov d73e8cab02 ffmpeg: fix broken indentation.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-30 18:08:23 +02:00
Anton Khirnov 877ba7b4bd ffmpeg: rescue poor abused limit_filesize global.
Keep a per-OutputFile instance of it, thus making -fs work with multiple
output files.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
2011-08-30 18:08:23 +02:00
Alex Converse cb13438543 ffmpeg: Set error code before before jumping to fail. 2011-08-30 18:08:23 +02:00
Alex Converse 6e6ccf0d56 ffmpeg: Fix spelling errors.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-08-30 18:08:23 +02:00
Anton Khirnov 47a3439ee7 ffmpeg: save two levels of indentation in flush_encoders()
By replacing
if (foo)
    <do stuff>

with
if (!foo)
    continue;
<do stuff>
2011-08-30 18:08:22 +02:00
Anton Khirnov a16f1afb11 ffmpeg: factor flushing encoders out of output_packet(). 2011-08-30 18:08:22 +02:00
Anton Khirnov 94adca68f8 ffmpeg: factor out initializing input streams. 2011-08-30 18:08:22 +02:00
Anton Khirnov 8b85b9fa42 ffmpeg: reset streamid_map between output files. 2011-08-30 18:08:22 +02:00
Anton Khirnov 6bdd9fbc89 ffmpeg: make timer_start a local var in transcode(). 2011-08-30 18:08:22 +02:00
Anton Khirnov 3a7b4ccd1c ffmpeg: cosmetics, move OutputStream.
Allows us to get rid of forward InputStream declaration.
2011-08-30 18:08:22 +02:00