Commit Graph
100 Commits
Author SHA1 Message Date
Nicolas George 92b8c9d89e lavf/au: check bits per coded sample.
Without that, it would repeatedly produce empty packets
if the codec if forced to something invalid.

Fix trac ticket #1652.
2012-08-18 17:45:58 +02:00
Nicolas George 9467f4eb5d lavc/tscc: use reget_buffer.
The previous code would release the buffer and get it
immediately after, assuming the contents is the same.
2012-08-18 09:52:15 +02:00
Nicolas George 9341bbfc51 vf_yadif: fix permissions.
Require AV_PERM_PRESERVE and leave harmless permissions
alone for the next filter.
2012-08-17 18:26:42 +02:00
Nicolas George 71adb74059 vf_tinterlace: leave harmless permissions alone. 2012-08-17 18:26:42 +02:00
Nicolas George d37f823207 vf_thumbnail: fix permissions. 2012-08-17 18:26:42 +02:00
Nicolas George 469d07a0e4 vf_select: require AV_PERM_PRESERVE.
This is only necessary because of the poll_frame implementation.
Removing it altogether would be another solution.
2012-08-17 18:26:42 +02:00
Nicolas George f6647d8825 vf_removelogo: fix permissions.
The branch with the test was already impossible.
2012-08-17 18:26:41 +02:00
Nicolas George 616c3f3ee2 vf_overlay: fix permissions. 2012-08-17 18:26:41 +02:00
Nicolas George 5ec6ae91ba vf_idet: fix permissions.
Only write needs to be removed, other can be left.
2012-08-17 18:26:41 +02:00
Nicolas George 3bc644e044 vf_fps: fix permissions. 2012-08-17 18:26:41 +02:00
Nicolas George 738fab17ea vf_fieldorder: fix permissions. 2012-08-17 18:26:41 +02:00
Nicolas George 3c0cc3ae67 vf_fade: fix permissions. 2012-08-17 18:26:41 +02:00
Nicolas George d5765d4725 vf_drawtext: fix permissions. 2012-08-17 18:26:41 +02:00
Nicolas George 0238806f64 vf_drawtext: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George 84923555bb vf_deshake: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George f3133a48e5 vf_delogo: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George 12ff3faec0 vf_colormatrix: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George ceb8dc1e04 vf_ass: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George 07663871e1 vf_alphamerge: fix permissions. 2012-08-17 18:26:40 +02:00
Nicolas George de35d2b498 avf_concat: fix permissions. 2012-08-17 18:26:39 +02:00
Nicolas George 44127c0489 af_channelmap: fix permissions. 2012-08-17 18:26:39 +02:00
Nicolas George 368f368e59 af_channelmap: require AV_PERM_PRESERVE. 2012-08-17 18:26:39 +02:00
Nicolas George 44aeb06290 fifo: fix permissions. 2012-08-17 18:26:39 +02:00
Nicolas George a34eb393fc split: set rej_perms = AV_PERM_WRITE on outputs. 2012-08-17 18:26:39 +02:00
Nicolas George a0d274d228 sink_buffer: require AV_PERM_PRESERVE. 2012-08-17 18:26:39 +02:00
Nicolas George e54e30c889 lavfi: grant all permissions on mallocated audio buffers.
The permissions not requested by the filter that created
the buffer may be useful for a later filter and avoid a copy.
2012-08-17 18:26:38 +02:00
Nicolas George cc8104b908 lavfi: fix erroneous use of AV_PERM_PRESERVE in ff_inplace_start_frame.
ff_inplace_start_frame looks useless anyway.
2012-08-17 18:26:38 +02:00
Nicolas George 046eb21c72 lavfi: grant all permissions on mallocated video buffers.
The permissions not requested by the filter that created
the buffer may be useful for a later filter and avoid a copy.
2012-08-17 18:26:38 +02:00
Nicolas George 12d2bbf324 lavfi/movie: extend a doxygen comment. 2012-08-16 20:36:45 +02:00
Nicolas George 584acbf524 lavfi/movie: set pkt->stream_index for flushing.
Otherwise, the value of stream_index is kept from the last packet
read, which is not necessarily the stream that needs flushing.
2012-08-16 18:07:03 +02:00
Nicolas George 082b745d33 filter_design: document ownership and permissions. 2012-08-14 12:12:20 +02:00
Nicolas George 271ddb116c lavfi: use min_perms and rej_perms for out pads.
There are several reasons for doing that:

1. It documents the code for the reader and helps find
   inconsistencies and bugs.

2. For rej_perms, it guarantees the change will be done
   even if the output reference can be created by several
   code paths.

3. It can be used to predict cases where a copy will,
   or will not happen and optimize buffer allocation
   (for example not request a rare direct-rendering buffer
   from a device sink if it will be copied anyway).

Note that a filter is still allowed to manage the permissions
on its own without using these fields.
2012-08-14 12:00:35 +02:00
Nicolas George 67a804b9ac dvdsubenc: reindent after recent commit. 2012-08-14 11:58:32 +02:00
Nicolas George 2d3acbfe8c lavc: add const to AVCodecContext.codec_descriptor. 2012-08-14 11:35:30 +02:00
Nicolas George 9bb936a80e lavc: reimplement avcodec_get_name with descriptors. 2012-08-14 11:35:30 +02:00
Nicolas George 690ef618b1 ffmpeg: copy subtitles frame dimensions.
The sub-movtextenc ref file changes because the dimensions
(400×60) are stored by the format.
2012-08-14 11:17:45 +02:00
Nicolas George e4f4d99df8 ffmpeg: make -s work for subtitles too.
Some codecs allow to encode the frame size and some players use it.
2012-08-14 11:17:45 +02:00
Nicolas George 17e40236cb dvdsubenc: set frame size in extradata. 2012-08-14 11:17:45 +02:00
Nicolas George b1511e00f6 lavf: probe PGS subtitles definition.
The resolution is in the packets, so decoding must happen.
Since most other formats do not set the dimension, make it
a special case for PGS. If other codecs were to have the
same requirement, using a CODEC_CAP would be preferred.
2012-08-14 11:17:45 +02:00
Nicolas George 2dedd8f496 dvdsubenc: make it usable for transcoding.
DVD subtitles packets can only encode a single rectangle:
if there are several, copy them into a big transparent one.

DVD subtitles rely on an external 16-colors palette:
use a reasonable default one, stored in the private context,
and encode it into the extradata, as specified by Matroska.
TODO: allow to change the palette with an option.

Each packet can use four colors out of the global palette.
The old logic was to map transparent colors to the color 0
and all other colors to 3, 2, 1, cyclically in descending
frequency order, completely disregarding the original color.

Select the "best" four colors from the global palette, according
to heuristics based on frequency, opacity and brightness, and
arrange them in standard DVD order: background, foreground,
outline, other.
TODO: select the alpha value more finely; see if CHG_COLCON can
allow more than 4 colors per packet.

Reference:
http://dvd.sourceforge.net/dvdinfo/spu.html

With these changes, dvdsubenc can be used to transcode DVB subtitles
and get a very decent result.
2012-08-14 11:17:45 +02:00
Nicolas George 0cad101ea1 ffmpeg: add an option to fix subtitles durations.
With this option, transcoding DVB subtitles becomes possible.
2012-08-14 11:17:45 +02:00
Nicolas George 03e8944fc1 lavc: add missing codec descriptors. 2012-08-13 10:45:04 +02:00
Nicolas George f594dafc10 tools: add a script to find missing codec descriptors. 2012-08-13 10:44:59 +02:00
Nicolas George e13df05fdb dvbsub: reindent after last commit. 2012-08-09 11:22:11 +02:00
Nicolas George aed032c25b dvbsub: fix encoding of termination packets.
The old code generates a termination packet with the same regions as the
start packet and page_state set to "only what changed"; the result is
that the termination packet is decoded as identical to the start packet.

The new code does as found in some DVB broadcasts: produce a packet with
no regions. This is done by expecting num_rects to be 0 rather than
using a flip-flop. ffmpeg.c is updated accordingly.
2012-08-09 11:03:22 +02:00
Nicolas George d74ade7d5f ffprobe: refactor frames decoding. 2012-08-06 17:37:59 +02:00
Nicolas George 88fc1438c6 ffmpeg: insert bitmap subtitles as video in filters.
With this feature, it becomes possible to perform commonly
requested tasks, such as hardcoding bitmap subtitles.

This will be reverted once libavfilter has proper support
for subtitles. All the changes have the string "sub2video"
in them, it makes it easy to spot the parts.
2012-08-04 21:49:05 +02:00
Nicolas George 8d6eed7b56 lavfi: document the constraints on incoming frames. 2012-08-04 21:49:05 +02:00
Nicolas George 8ef740ce01 lavfi: use a new field for automatic buffer copy.
The code currently use cur_buf as the target of the copy,
but cur_buf can be cleared by the filter if it has given
the reference away or stored it elsewhere as soon as start_frame.

The code still relies on the fact that the reference is not
destroyed until end_frame. All filters currently follow that condition.
An av_assert1() is added to check it; it should at least cause
very visible errors in valgrind.
2012-08-04 21:49:05 +02:00
Nicolas George 752344dada amerge/astreamsync/pan: fix license boilerplate.
The boilerplate states that the files are under LGPL,
but refer the user to the GPL at one place.
These files were (re)implemented specifically for FFmpeg.
2012-08-03 00:24:51 +02:00
Nicolas George 93d428953c assdec: return EOF instead of EIO. 2012-08-02 14:39:45 +02:00
Nicolas George 39b0d40d92 fate: add test for the tile video filter. 2012-08-01 14:00:29 +02:00
Nicolas George ff2955a4f7 apetag: return value when required.
Should fix compilation on clang.
2012-08-01 13:33:51 +02:00
Nicolas George f952b23ed4 vf_tile: fix output buffer ownership.
There is no need to start_frame immediately on the output link
since the rest is only done with the last frame of the tile.
link->out_buf is now automatically dereferenced; since we give
it away it must be cleared.

Fix an assert failure; found by Clément Bœsch.
2012-08-01 12:23:48 +02:00
Nicolas George 6eee9f5596 8svx: ensure that packet size is multiple of channels.
Fix an assert failure with packets of invalid size.
2012-08-01 10:29:10 +02:00
Nicolas George d2ca5dd0f3 loco: fix return value.
The return value was the number of bytes left,
it is supposed to be the number of bytes used.
2012-07-31 17:25:42 +02:00
Nicolas George 91ec1c6cc3 loco: take decode overflow into account.
Commit 2bf0982 introduced an overflow check in loco_decode_plane,
but the error code is never taken into account, leading to
completely idiotic return values.
2012-07-31 17:25:36 +02:00
Nicolas George b2814b034e sp5xdec: sanitize return value.
i is the decoded size of a recoded packet, which is larger
than the original packet. Assume that if decoding succeeded,
all the packet was used.
2012-07-31 17:23:32 +02:00
Nicolas George 7a539e67f4 8svx: unify mono and stereo code paths. 2012-07-31 17:23:31 +02:00
Nicolas George 5caea648d4 8svx: remove useless rounding code.
samples_size and samples_idx are supposed to be multiple of
channels at all time. If they are, the division is exact;
if they are not, something is very wrong in the code.
2012-07-31 17:23:31 +02:00
Nicolas George 1c98781837 8svx: use a more direct condition.
esc->table was inited based on codec->id: re-testing codec->id
is code duplication and can lead to inconsistencies.
2012-07-31 17:23:31 +02:00
Nicolas George 9009fa6de4 movtextdec: fix return value for too small packets. 2012-07-31 17:23:31 +02:00
Nicolas George 3d5dc7d87d mmvideo: count preamble size in return value.
MM_PREAMBLE_SIZE is subtracted from buf_size almost immediately.
The original size is still in avpkt->size.
2012-07-31 17:22:23 +02:00
Nicolas George cc7eff1fa0 vc1dec: count ENDOFSEQ code in return value. 2012-07-31 17:17:38 +02:00
Nicolas George 89898cd3b6 ffprobe: fix validity error with tags and data.
Add "data" and "extradata" attributes to the schema.
Add "tag" element in "streams".
Print extradata before tags to avoid closing the element.

Fix trac ticket #1588.
2012-07-31 15:06:57 +02:00
Nicolas George a85b4a5696 lavfi: use correct PTS for link age.
When start_frame has returned, the buffer reference's PTS
may have been modified by another filter.
2012-07-30 17:56:26 +02:00
Nicolas George f893904469 audioconvert: add av_get_standard_channel_layout().
Also bump minor version and add APIchanges entry.
2012-07-30 11:38:38 +02:00
Nicolas George 33449b1776 audioconvert: add av_get_channel_description(). 2012-07-30 11:37:40 +02:00
Nicolas George cc55470472 audioconvert: include the description of channels in the library. 2012-07-30 10:24:37 +02:00
Nicolas George 981d97f697 doc/filters: document TB variable for vf_setpts. 2012-07-29 16:25:52 +02:00
Nicolas George 5c81a9ff55 libx264: list possible profiles.
The values are listed if setting them fails.
Using "-profile help" or "-profile list" have that effect.
Similar to 3aba391.
Suggested by "rogerdpack" in trac ticket #1529.
2012-07-29 16:13:07 +02:00
Nicolas George 0f8f924847 faq: suggest the concat filter. 2012-07-28 18:16:55 +02:00
Nicolas George 2d6f442ca1 faq: disambiguate "join". 2012-07-28 18:16:55 +02:00
Nicolas George efcfcf8793 avf_concat: fix silence duration.
concat_in.pts starts at 0 for each segment, so the duration
of the silence was too long, except at the first stitch.
2012-07-28 15:14:01 +02:00
Nicolas George 4ce87ecf2a asrc_flite: do not crash on multiple instances.
The voice register functions return the same voice structure
upon multiple registration. It causes us two problems:

If we delete a voice without deregistering it, it leaves
a dangling pointer inside the library.

If we delete or unregister a voice at uninit, it may still
be in use by another instance of the filter.

The second problem is solved by keeping an usage counter inside
asrc_flite. This is not thread-safe, but neither is flite itself.
2012-07-28 15:13:46 +02:00
Nicolas George 9a757cca34 avf_concat: fix min value for v option. 2012-07-28 11:48:14 +02:00
Nicolas George 6bf87785e8 ffmpeg: warn about new streams after startup. 2012-07-26 00:30:38 +02:00
Nicolas George d0d9272580 faq: explain about new streams, probesize and analyzeduration. 2012-07-26 00:30:37 +02:00
Nicolas George 3ccf22c64a ffmpeg: keep packet/frame availability in global structures.
This replaces the use of the no_packet and no_frame arrays.
2012-07-24 19:14:10 +02:00
Nicolas George ddcb99bb51 vf_deshake: set cur_buf to NULL.
Fix a segfault.
2012-07-23 22:44:25 +02:00
Nicolas George a7ac05ce2f src_movie: implement multiple outputs.
The audio and video code paths were too different,
most of the decoding has been rewritten.
2012-07-23 17:14:59 +02:00
Nicolas George 05776119c1 buffersrc: use avfilter_get_buffer_ref_from_frame. 2012-07-23 17:14:59 +02:00
Nicolas George 5c5f75b92b lavfi: add avfilter_get_buffer_ref_from_frame. 2012-07-23 17:14:59 +02:00
Nicolas George 612307978d lavfi: change "transmedia" into "multimedia". 2012-07-23 11:44:48 +02:00
Nicolas George be33da9a1d lavfi: add concat filter. 2012-07-23 11:34:20 +02:00
Nicolas George 1cadab6023 ffmpeg: select input file based on output time.
Filters can change the timings, so input files must not
necessarily be read at the same rythm. This patch select
the input file to read based on the timestamp at output
instead of input. With complex filter graphs, finding the
input for a given output is done by making a request and
checking to what buffer source it has been forwarded.
2012-07-23 10:59:41 +02:00
Nicolas George 9c1d649ce5 overlay: clear cur_buf on main input link.
A reference is kept in the queue and freed after use.
2012-07-22 18:35:28 +02:00
Nicolas George 21fb7ff35b doc: declare encoding for texi2html.
It adds the following header to the HTML files:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
which helps some browsers to display correctly the few non-ASCII
characters in the doc.
2012-07-22 12:48:57 +02:00
Nicolas George fd58678b86 v4l2: remove call to v4l2_fd_open.
v4l2_fd_open is already called at the end of v4l2_open;
calling a second time leaks structures inside libv4l2.

Fix trac ticket #1560.
2012-07-20 21:12:10 +02:00
Nicolas George cb6a20fa56 lavfi: add FF_*LINK_IDX convenience macros. 2012-07-20 13:16:24 +02:00
Nicolas George 461f506f7b lavc: set best_effort_timestamp for audio too. 2012-07-20 13:16:23 +02:00
Nicolas George 97f86680eb lavfi: make copy_buffer_ref common. 2012-07-20 13:16:23 +02:00
Nicolas George b0629366a2 lavf: make cmdutils's check_stream_specifier public.
The new function is called avformat_match_stream_specifier()
and does not include logging the error message.
2012-07-20 13:16:23 +02:00
Nicolas George b34ce5a26b faq: explain dependency problems with static libs. 2012-07-20 11:40:26 +02:00
Nicolas George 30549294ef matroska: add support for Opus.
Opus in Matroska is still a draft.
2012-07-20 11:19:01 +02:00
Nicolas George a6cf296bd9 lavc: Opus decoder using libopus. 2012-07-20 11:18:58 +02:00
Nicolas George e62fd6619f oggdec: add support for Opus codec.
This patch also introduces CODEC_ID_OPUS.
2012-07-20 11:16:52 +02:00
Nicolas George bf8ce5a5c3 ffmpeg: probe buffersinks once more after EOF.
Reap buffers stored in the buffer sinks even when
the avfilter_graph_request_oldest() loop only returns EOF.

avfilter_graph_request_oldest() can cause frames to arrive
to the sinks even when it returns EOF.
2012-07-20 10:18:45 +02:00
Nicolas George 885fc05865 lavf: count skipped samples for initial timestamps.
If skip_samples is set and timestamps are synthesized using durations,
make them start at -skip_samples (rescaled) instead of 0,
so that the timestamp of the first undiscarded sample is 0.
2012-07-19 23:41:03 +02:00
Nicolas George cd08900393 lavc: update pkt_duration for skipped samples.
Also: factor the the computation of the timestamp difference.
2012-07-19 23:41:03 +02:00