Commit Graph

241 Commits

Author SHA1 Message Date
Anton Khirnov
3e901cbc75 avconv: reindent. 2012-04-15 20:37:42 +02:00
Anton Khirnov
3b266da3d3 avconv: add support for complex filtergraphs. 2012-04-15 20:32:09 +02:00
Anton Khirnov
560f7774a4 avconv: make filtergraphs global.
This is the first step towards supporting complex filtergraphs with more
than one input and/or output.
2012-04-15 20:27:32 +02:00
Anton Khirnov
836ce90566 avconv: move filtered_frame from InputStream to OutputStream.
It more properly belongs to output, not input.
2012-04-15 20:24:07 +02:00
Anton Khirnov
6c9eac1998 avconv: don't set output width/height directly from input value.
Always take it from lavfi. This way we don't need a clearly defined
corresponding input stream.
2012-04-15 20:23:09 +02:00
Anton Khirnov
e77c86629f avconv: move resample_{width,height,pix_fmt} to InputStream.
This is a more proper place for them, since they store parameters of the
input, not output, stream.
2012-04-15 20:23:09 +02:00
Anton Khirnov
9dced85426 avconv: remove a useless variable from OutputStream. 2012-04-15 20:22:36 +02:00
Anton Khirnov
b7327887ea avconv: get output pixel format from lavfi.
This way we don't require a clearly defined corresponding input stream.

The result for the xwd test changes because rgb24 is now chosen instead
of bgra.
2012-04-15 20:22:36 +02:00
Anton Khirnov
2e21526790 avconv: change {input,output}_{streams,files} into arrays of pointers.
Right now, they are arrays of structs, reallocated when new
streams/files are added. This makes storing pointers to those structs
harder than necessary.
2012-04-15 20:20:03 +02:00
Anton Khirnov
ea9367e921 avconv: don't pass input/output streams to some functions.
They are globals, no point in pretending they are not.
2012-04-15 20:20:03 +02:00
Stefano Sabatini
91d3cbe0fd avfiltergraph: make the AVFilterInOut alloc/free API public
This is required for letting applications to create and destroy
AVFilterInOut structs in a convenient way.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-04-14 09:25:46 +02:00
Justin Ruggles
d3c59d5003 avconv: use default channel layouts when they are unknown
If either input or output layout is known and the channel counts match,
use the known layout for both. Otherwise choose the default layout based on
av_get_default_channel_layout().

Changed some FATE references due to some WAVE files now having a non-zero
channel mask.
2012-04-10 11:30:01 -04:00
Justin Ruggles
95a8dac57b avconv: parse channel layout string
This allows the user to use channel layout names instead of having to use the
channel mask values.
2012-04-10 11:30:01 -04:00
Justin Ruggles
b073819bc9 avconv: allow '-async -1' to disable timestamp sync for audio encoding
This will allow a workaround for cases where input timestamps are invalid or
when decoder delay of 1 packet or more confuses avconv into using the wrong
timestamps as a sync reference.
2012-04-09 13:47:11 -04:00
Justin Ruggles
679a973e97 avconv: use default alignment for audio buffer 2012-04-09 10:20:35 -04:00
Anton Khirnov
b6c4518a87 avconv: remove OutputStream.picref.
It's only used inside transcode_video() and there's no point in
preserving it between subsequent calls. So use a local variable instead.
2012-04-09 05:13:00 +02:00
Anton Khirnov
695ec04e6a avconv: only set SAR once on the decoded frame.
No point in repeating the assignment for each output stream.
2012-04-09 05:10:38 +02:00
Anton Khirnov
d4936548f4 avconv: remove an unused function parameter. 2012-04-06 20:21:07 +02:00
Anton Khirnov
4648fe6324 avconv: remove now pointless variables. 2012-04-06 20:21:07 +02:00
Anton Khirnov
e06d2dfcde avconv: drop support for building without libavfilter.
Since the mandatory memcpy in vsrc_buffer has been eliminated, there
shouldn't be any significant reason to build without lavfi anymore.

This will make upcoming support for complex filtergraphs easier to do.
2012-04-06 20:21:07 +02:00
Ronald S. Bultje
bc1ef85520 lavc/avconv: support changing frame sizes in codecs with frame mt.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-03-24 21:29:16 +01:00
Justin Ruggles
4094fc9971 avconv: fix the resampling safety factors for output audio buffer allocation
This matches the output size required for audio_resample()
2012-03-23 01:19:43 -04:00
Justin Ruggles
9869e963a6 avconv: move audio output buffer allocation to a separate function
Allows for removing a goto and makes the code easier to follow.
2012-03-23 01:19:43 -04:00
Justin Ruggles
f3ab3e1aee avconv: make the async buffer global and free it in exit_program() 2012-03-23 01:19:42 -04:00
Justin Ruggles
c9594fe0fb avconv: free packet in write_frame() when discarding due to frame number limit
Fixes a memleak when using the -frames option with audio.
2012-03-20 15:51:58 -04:00
Justin Ruggles
9b9fc9ba32 avconv: pass input stream timestamps to audio encoders
5 FATE test references updated due to using demuxer-generated timestamps that
are either not sample-accurate or are slightly off in the input file.
2012-03-20 14:12:54 -04:00
Anton Khirnov
251422982b avconv: remove pointless checks.
OutputStream.picref is guaranteed to be non-NULL if
get_filtered_video_frame() succeeds.
2012-03-15 09:01:18 +01:00
Anton Khirnov
ce326c1130 avconv: check for get_filtered_frame() failure. 2012-03-15 09:00:55 +01:00
Anton Khirnov
2636e691ce avconv: remove a pointless check.
output_video_filter is always guaranteed to be set and is in fact
dereferenced right above the check.
2012-03-15 09:00:49 +01:00
Anton Khirnov
64334ddbbc avconv: reindent
CC: libav-stable@libav.org
2012-03-13 12:21:44 +01:00
Anton Khirnov
6e8be949f1 avconv: link '-passlogfile' option to libx264 'stats' AVOption.
Fixes bug 204.

CC: libav-stable@libav.org
2012-03-13 12:21:14 +01:00
Anton Khirnov
4138cd2907 avconv: add -cpuflags option for setting supported cpuflags.
Useful for testing.
2012-03-06 15:03:22 +01:00
Anton Khirnov
39da3b223f avconv: fix counting encoded video size.
avcodec_encode_video2() return value is 0 on success, encoded frame size
is stored in the packet.
2012-03-06 10:06:21 +01:00
Anton Khirnov
13f6917ca9 avconv: set discard on input streams automatically. 2012-02-26 19:30:50 +01:00
Anton Khirnov
832ba44d8d avconv: saner output video timebase.
r_frame_rate should in theory have something to do with input framerate,
but in practice it is often made up from thin air by lavf. So unless we
are targeting a constant output framerate, it's better to just use input
stream timebase.

Brings back dropped frames in nuv and cscd tests introduced in
cd1ad18a65
2012-02-26 07:48:45 +01:00
Anton Khirnov
d43040e28b avconv: refactor vsync code.
No functional changes, just make it more readable.
2012-02-26 07:28:27 +01:00
Justin Ruggles
f320fb894c bethsoftvid: pass palette in side data instead of in a separate packet.
Update FATE reference to account for now non-existent palette packet.
This also fixes the FATE test if frame data is not initialized in
get_buffer(), so update comment in avconv accordingly.
2012-02-16 10:47:11 -05:00
Martin Storsjö
ae5a935574 avconv: Don't split out inline sequence headers when stream copying VC1
This is required when stream copying VC1 in ismv - there's one
global header in the moov atom, but keyframes have a separate
sequence header prepended.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-14 16:12:15 +02:00
Andrey Utkin
c22e2ec9d1 avconv: set AVFormatContext.duration from '-t'
Set output files duration to recording_time option, if given.
Rationale: to save duration into metadata for file that is written to
non-seekable output, for formats like FLV (with metadata at beginning).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-02-12 17:15:41 +01:00
Justin Ruggles
a75bc764ec avcodec: for audio encoding, set packet dts to packet pts.
There are no audio encoders which do frame reordering.
2012-02-09 21:51:29 -05:00
Anton Khirnov
8e37038a34 avconv: switch to avcodec_encode_video2(). 2012-02-08 21:00:00 +01:00
Anton Khirnov
722410ade5 avconv: estimate next_dts from framerate if it is set. 2012-02-07 20:14:54 +01:00
Anton Khirnov
b34856a116 avconv: better next_dts usage.
next_dts is used for estimating the dts of the next packet if it's
missing. Therefore, it makes no sense to set it from the pts of the last
decoded frame. Also it should be estimated from the current packet
duration/ticks_per_frame always, not only when a frame was successfully
decoded.
2012-02-07 20:14:41 +01:00
Anton Khirnov
23576b3fbb avconv: rename InputStream.pts to last_dts.
It more accurately describes what does this variable store.
2012-02-07 20:13:15 +01:00
Anton Khirnov
6e98390258 avconv: reduce overloading for InputStream.pts.
It currently has different meanings at different times (dts of the last
read packet/pts of the last decoded frame). Reduce obfuscation by
storing pts of the decoded frame in the frame itself.
2012-02-07 20:12:04 +01:00
Anton Khirnov
3101bb6669 avconv: rename InputStream.next_pts to next_dts.
It's used to predict dts, not pts.
2012-02-07 20:11:22 +01:00
Anton Khirnov
1270e12e49 avconv: rework -t handling for encoding.
Current code compares the desired recording time with InputStream.pts,
which has a very unclear meaning. Change the code to use actual
timestamps of the frames passed to the encoder.

In several tests, one less frame is encoded, which is more correct.

In the idroq test one more frame is encoded, which is again more
correct.

Behavior with stream copy should be unchanged.
2012-02-07 20:11:11 +01:00
Anton Khirnov
c9af832623 avconv: set encoder timebase for subtitles.
The actual number (1/1000) will probably require some
discussion/tweaking in the future, but should be good enough for now,
since the timestamps in AVSubtitle are in this timebase by definition.
2012-02-07 20:07:14 +01:00
Anton Khirnov
324fbadff9 avconv: remove debugging cruft from do_video_out(). 2012-02-03 13:45:02 +01:00
Anton Khirnov
61a099680c avconv: factorize setting stream_index for the output packet. 2012-02-03 13:44:59 +01:00