Commit Graph
100 Commits
Author SHA1 Message Date
Nicolas George 183ce55b0d lavfi: split frame_count between input and output.
AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.

Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.
2016-11-13 10:41:16 +01:00
Nicolas George 22aa649c13 fate/colorkey: disable audio stream.
The test is not supposed to cover audio.
Also, using -vframes along with an audio stream depends on
the exact order the frames are processed by filters, it is
too much constraint to guarantee.
2016-11-13 10:41:16 +01:00
Nicolas George 0bd1be65e8 lavd/xcbgrab: do not try to create refcounted packets.
The framework will allocate a buffer and copy the data to it,
that takes time. But it avoids constently creating and
destroyng the shared memory segment, and that saves more time.

On my setup,
from ~200 to ~300 FPS at full screen (1920×1200),
from ~1400 to ~3300 at smaller size (640×480),
similar to legacy x11grab and confirmed by others.

Plus, shared memory segments are a scarce resource,
allocating potentially many is a bad idea.

Note: if the application were to drop all references to the
buffer before the next call to av_read_frame(), then passing
the shared memory segment as a refcounted buffer would be
even more efficient, but it is hard to guarantee, and it does
not happen with the ffmpeg command-line tool. Using a small
number of preallocated buffers and resorting to a copy when
the pool is exhausted would be a solution to get the better
of both worlds.
2016-11-03 21:23:55 +01:00
Nicolas George 8b05a7ffe4 lavf/udp: fix dead code.
Since d607861, service can not be NULL, only "0".
An UDP address with neither local port nor address leaves both
service and node to their default value, and POSIX specifies
that they are not allowed to be both NULL; "0" is equivalent
to an unspecified port for all currently known protocols.

Fix CID 1341570.
2016-06-03 12:46:02 +02:00
Nicolas George 0cb19c30c6 lavf/concatdec: clear extradata when inserting h264_mp4toannexb bsf.
Fix remuxing H.264-in-MP4 to Matroska, possibly others.
2016-04-26 16:58:59 +02:00
Nicolas George b8fa374fb6 lavf/concatdec: remove unrelated change during codecpar merge.
Clearing the extradata is not related to the codecpar change,
and it breaks if auto_convert is disabled.

Fix trac ticket #5461.
2016-04-26 16:58:59 +02:00
Nicolas George 962727acb4 lavfi/vf_decimate: do not compare the first frame to itself.
This is a waste of computing power and will result to 0,
making it always dropped.
Use maximum difference values instead.
2016-01-03 15:50:51 +01:00
Nicolas George 1655788712 lavfi: make request_frame() non-recursive.
Instead of calling the input filter request_frame() method,
ff_request_frame() now marks the link and returns immediately.
buffersink is changed to activate the marked filters until
a frame is obtained.
2015-12-22 16:04:30 +01:00
Nicolas George 108b4de552 lavfi: replace link.closed by link.status.
The status field can carry any error code instead of just EOF.
Also only update it through a wrapper function and provide a timestamp.
Update the few filters that used it directly.
2015-12-22 16:04:30 +01:00
Nicolas George 39a09e995d lavfi: deprecate avfilter_link_set_closed().
Applications are not supposed to mess with links,
they should close the sinks.
Furthermore, this function does not distinguish what end
of the link caused the close and does not have a timestamp.
2015-12-22 16:04:22 +01:00
Nicolas George b8b7d5ac6c lavfi: add link.current_pts field. 2015-12-22 15:55:00 +01:00
Nicolas George d03eab34dd lavfi: rename link.current_pts to current_pts_us.
This field is used for fast comparison between link ages,
it is in AV_TIME_BASE units, in other words microseconds,
µs =~ us.
Renaming it allows a second field in link time base units.
2015-12-22 15:55:00 +01:00
Nicolas George 63f7bee752 lavfi/vf_mpdecimate: remove request_frame().
It is no longer needed since looping is not necessary.
2015-12-22 15:55:00 +01:00
Nicolas GeorgeandMichael Niedermayer 1acc90eaa5 lavf/tee: fix side data double free.
Similar to 33fefdb44.
Fix trac ticket #4921.

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 09:41:41 +01:00
Nicolas George 085ab74972 lavf/mpegts: use AVERROR_INVALIDDATA instead of AVERROR(EINTR). 2015-12-03 19:16:12 +01:00
Nicolas George eb2e4fb674 lavf/lxfdec: use FFERROR_REDO instead of AVERROR(EAGAIN). 2015-12-03 19:16:12 +01:00
Nicolas George cb14d30240 lavf/mpeg: use FFERROR_REDO instead of AVERROR(EAGAIN). 2015-12-03 19:16:12 +01:00
Nicolas George 0bac7a436b lavf/flvdec: use FFERROR_REDO instead of AVERROR(EAGAIN).
Fix trac ticket #5041.
2015-12-03 19:16:12 +01:00
Nicolas George 3ab1e5a48c lavf: add FFERROR_REDO to let demuxers return no packet. 2015-12-03 19:16:12 +01:00
Nicolas George 15206ffdbe ffserver: add NULL context to ff_rtsp_parse_line().
Needed after f62fe53/2c17fb6.
2015-11-29 17:02:04 +01:00
Nicolas George 785ac437be lavfi/af_asyncts: remove looping on request_frame(). 2015-11-07 16:43:36 +01:00
Nicolas George a08fb3983f lavfi/af_amix: mostly fix scheduling. 2015-11-07 16:43:36 +01:00
Nicolas George f53c4b6a18 lavfi/vf_framepack: fix scheduling. 2015-11-07 16:43:36 +01:00
Nicolas George d0b82d798d lavfi/af_join: partially fix scheduling. 2015-11-07 16:43:36 +01:00
Nicolas George 67d3f5296e lavfi/fifo: do not assume request_frame() returns a frame. 2015-11-07 16:43:36 +01:00
Nicolas George 79c1be124e lavfi/avf_concat: return immediately after requesting a frame on input. 2015-11-07 16:43:36 +01:00
Nicolas George d92e0848d9 lavfi: remove astreamsync.
It was only useful for very specific testing purposes
and appears to be currently partially broken.
2015-11-07 16:43:36 +01:00
Nicolas George 47ea04ff10 lavu/opt: enhance printing durations.
Trim unneeded leading components and trailing zeros.
Move the formating code in a separate function.
Use the function also to format the default value, it was currently
printed as plain integer, inconsistent to the way it is parsed.
2015-11-07 16:04:09 +01:00
Nicolas George 7037f9430b lavfi: add realtime filter.
Similar to the -re option in ffmpeg that only works for input files.
Can be used at any place in the filter graph.
2015-11-07 16:04:07 +01:00
Nicolas George 432e27e6e7 fate: add mpdecimate test. 2015-11-07 16:03:47 +01:00
Nicolas George b16e569312 lavfi: add testsrc2 test source.
Similar to testsrc, but using drawutils and therefore
supporting a lot of pixel formats instead of just rgb24.
This allows using it as input for other tests without
requiring a format conversion.
It is also slightly faster than testsrc for some reason.
2015-11-07 16:02:48 +01:00
Nicolas George e8e7eb150f ffmpeg_filter: check encoder before using it to set frame size.
Fix a segfault when no encoder is found for a default codec
with a complex filter graph.
2015-10-30 10:55:10 +01:00
Nicolas George 559603dae1 lavfi/drawutils: add const to blending mask. 2015-10-25 20:58:21 +01:00
Nicolas George 8a9fa46e87 lavfi/vf_yadif: reindent after last commit. 2015-10-07 19:05:13 +02:00
Nicolas George ea2fd42f9d lavfi/vf_thumbnail: reindent after last commit. 2015-10-07 19:05:13 +02:00
Nicolas George 90d087247c lavfi/vf_w3fdif: reindent after last commit. 2015-10-07 19:05:13 +02:00
Nicolas George d7849248dd lavfi/vf_alphamerge: reindent after last commit. 2015-10-07 19:05:13 +02:00
Nicolas George 35c3043ea4 lavfi/avf_showspectrum: reindent after last commit. 2015-10-07 19:05:13 +02:00
Nicolas George 4883e5d540 lavfi/vf_yadif: remove looping on request_frame(). 2015-10-07 19:05:13 +02:00
Nicolas George 86b8a82f4f lavfi/vf_w3fdif: remove looping on request_frame(). 2015-10-07 19:05:13 +02:00
Nicolas George 73a5546ba8 lavfi/vf_thumbnail: remove looping on request_frame(). 2015-10-07 19:05:13 +02:00
Nicolas George ca540fbdb4 lavfi/vf_select: remove looping on request_frame(). 2015-10-07 19:05:13 +02:00
Nicolas George 4bc7eb2dd2 lavfi/vf_fps: remove looping on request_frame(). 2015-10-07 19:05:13 +02:00
Nicolas George a45e96a54f lavfi/vf_alphamerge: remove looping on request_frame(). 2015-10-07 19:00:22 +02:00
Nicolas George 8a2e2fc34a lavfi/avf_showwaves: remove looping on request_frame(). 2015-10-07 19:00:22 +02:00
Nicolas George 9a520c4d52 lavfi/avf_showspectrum: remove looping on request_frame(). 2015-10-07 19:00:22 +02:00
Nicolas George 114f3f526e lavfi/avf_showcqt: remove looping on request_frame(). 2015-10-07 19:00:22 +02:00
Nicolas George 4982130d5a lavfi/af_aresample: remove looping on request_frame(). 2015-10-07 19:00:22 +02:00
Nicolas George 44f660e7e7 lavfi: remove FF_LINK_FLAG_REQUEST_LOOP.
It has no longer any effect.
2015-09-20 19:02:33 +02:00
Nicolas George 2a351f6c55 lavfi: drop the requirement that request_frame returns a frame.
It requires a loop in filters or the framework,
that makes the scheduling less efficient and more complex.
This is purely an internal change since the loop is now
present in buffersink.
Note that no filter except buffersink did rely on the requirement.
2015-09-20 19:02:33 +02:00
Nicolas George 598f8a7afa lavfi/vf_idet: reindent after last commit. 2015-09-20 18:50:00 +02:00
Nicolas George 7635242ae5 lavfi/vf_idet: remove the loop in request_frame().
It is not necessary due to the use of FF_LINK_FLAG_REQUEST_LOOP.
2015-09-20 18:50:00 +02:00
Nicolas George 807d4b6355 lavfi/buffersink: loop over ff_request_frame().
Do not assume that ff_request_frame() returning success
implies a frame has arrived in the FIFO.
Instead, just loop until a frame is in the FIFO.
It does not change anything since the same loop is present
in ff_request_frame(), confirmed by an assertion.
2015-09-20 18:50:00 +02:00
Nicolas George 52c75d486e lavc/hevc: rudimentary support for skip_loop_filter.
+~9% speed on Core i5 on test sample.

All frames are treated as ref frames, skipping only applies
at level "all". The following mail contains information on
how to improve that:
http://ffmpeg.org/pipermail/ffmpeg-devel/2015-July/176116.html
2015-07-23 16:26:14 +02:00
Nicolas GeorgeandMichael Niedermayer 7971fa9ce0 lavd/xcbgrab: fix comparison with screen size.
Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-06 13:33:17 +02:00
Nicolas GeorgeandLuca Barbato 01fdfa51ac xcbgrab: Accept geometries matching the screen size
Introduced in e8c4db0d4d.
2015-05-06 12:25:32 +02:00
Nicolas GeorgeandMichael Niedermayer 38155865df lavfi/avf_showcqt: fix error code.
Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 12:38:28 +02:00
Nicolas George d92c6d82c0 ffmpeg: notify when the thread message queue blocks.
This can help finding the source of A-V desync with live input.
2015-02-26 19:19:56 +01:00
Nicolas George 508d6a23b4 ffmpeg: allow to set the thread message queue size. 2015-02-26 19:19:56 +01:00
Nicolas George a92193f247 lavd/alsa: set frame_size field.
The value tells the typical size of a packet from the demuxer.
2015-02-26 19:19:56 +01:00
Nicolas George c49c42a4a3 doc/faq: explain DAR/SAR preserving. 2015-02-19 11:30:30 +01:00
Nicolas George b491751409 doc: set documentencoding on toplevel texi files.
Fix double UTF-8 encoding on output files.
makeinfo / texi2any does not seem to provide a way of setting
it globally for toplevel files.
2015-02-19 11:30:30 +01:00
Nicolas GeorgeandMichael Niedermayer 55763b6f5e lavd/lavfi: allow to extract subcc.
Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-02 20:17:05 +01:00
Nicolas George 40948819fc doc/faq: explain pkg-config basic setup. 2014-12-23 14:38:11 +01:00
Nicolas GeorgeandMichael Niedermayer acbc2ed26a lavf/concatdec: handle NOPTS start_time.
Fix trac ticket #3598.

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 20:00:35 +01:00
Nicolas George 6c96aa0606 configure: add a note about pkg-config --static.
Try to detect "$cc -static" without "pkg-config --static".
Also, when a library detection using pkg-config fails,
make it explicit this was pkg-config.
2014-12-02 18:43:54 +01:00
Nicolas George cfcaf6b38e configure: add optional pkg-config helper and use it.
The require variant dies if the package is not present.
The check variant does not import the flags to the used list.
The new variant imports the flags if the package is present
but does not die if it is not.
The new call graph is: require -> use -> check.

Use use_pkg_config for libx264 and libsmbclient: more readable
and three external call less per library.
2014-12-02 18:43:48 +01:00
Nicolas GeorgeandMichael Niedermayer 90cdec5e26 ffmpeg: init sub2video.last_pts.
Get the heartbeat working when the video has negative timestamps.

Fix trac ticket #4062.

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-05 21:04:36 +01:00
Nicolas George eb7a6d0813 lavu/bprint: add const to av_bprint_is_complete() argument. 2014-09-21 19:42:21 +02:00
Nicolas George 4bebce0617 lavf/http: remove special case for cookies attributes.
With the previous change, unknown attributes are all ignored,
as specified by the RFC.
2014-08-17 20:07:27 +02:00
Nicolas George 481cbc5ad5 lavf/http: fix cookie parsing.
The current code would use any unknown attribute-value pair
as the cookie value.
RFC 6265 states that the first key-value pair is the actual
cookie, and the attribute-value pairs only start after.

With the current code:
Set-Cookie: test=good_value; path=/; dummy=42
gives this:
Cookie: dummy=42
instead of this with the new code:
Cookie: test=good_value
2014-08-17 20:07:27 +02:00
Nicolas George 4f3e2f107b ffprobe: add -show_data_hash option. 2014-08-17 11:30:55 +02:00
Nicolas George 638eec2ac3 lavfi/avf_showspectrum: check RDFT context init.
Fix a segfault with large window size.
2014-08-14 15:11:39 +02:00
Nicolas George 7c10e32ae5 lavfi/avf_showspectrum: add full frame sliding mode. 2014-08-14 14:59:23 +02:00
Nicolas George ec33df6045 lavfi/avf_showspectrum: use automatic framing.
The framework can ensure that each input frame has exactly
the correct number of samples, except the last one.
2014-08-14 14:59:19 +02:00
Nicolas George d4de6d4fad lavfi/avf_showspectrum: do not push the frame at EOF.
It is always identical to the last pushed frame.
The samples in the last incomplete window were ignored,
this is unchanged.
Possible enhancement: pad the last incomplete window with
silence.
2014-08-14 14:23:59 +02:00
Nicolas George 65b284a4ae lavfi/avf_showspectrum: fix output pts computation. 2014-08-14 14:23:59 +02:00
Nicolas George a3aaaec891 lavfi/avf_showspectrum: set output frame rate. 2014-08-14 14:23:59 +02:00
Nicolas George f87db44685 lavf/avio: do not include bprint.h.
See f75786f and 04bc370.
2014-08-09 15:51:04 +02:00
Nicolas George 91244073fd ffmpeg_filter: refuse to configure input without a decoder.
The decoder is necessary in order to filter frames.
This makes the error message clearer in this case:
currently, it will usually fail because the pixel or sample
format is not defined and is converted into "(null)"
(non-portable).

Enhance trac ticket #3779.
2014-07-30 14:40:45 +02:00
Nicolas GeorgeandMichael Niedermayer 04bc370072 lavf/avio: do not include bprint.h.
C++ chokes on the definition of AVBPrint.
Including avio.h from c++ code used to work.
Fix trac ticket #3800.

Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-25 05:37:45 +02:00
Nicolas George 8e2976860f lavd/x11grab: reindent after last commit. 2014-07-17 18:28:58 +02:00
Nicolas George 099aff5c42 lavfi: check refcount before merging.
When merging the formats around the automatically inserted
convert filters, the refcount of the format lists can not be 0.
Coverity does not detect it, and suspects a memory leak,
because if refcount is 0 the newly allocated lists are not
stored anywhere. That gives CIDs 1224282, 1224283 and 1224284.
Lists with refcount 0 are used in can_merge_formats(), so the
asserts can not be moved inside the merge functions.
2014-07-17 18:12:34 +02:00
Nicolas George 1d12df1ad7 lavd/x11grab: add an option to disable MIT-SHM.
With remote displays supporting the MIT-SHM extension,
the extension is detected and used, but attaching fails
asynchronously.
2014-07-17 18:12:15 +02:00
Nicolas George 16c6795465 lavd/x11grab: check 32-bits color masks.
The X11 servers by VNC, at 32-bits depths, has the following masks:
R:0x000007ff G:0x003ff800 B:0xffc00000
This is not compatible with AV_PIX_FMT_0RGB32, and the result
is success with completely wrong colors.
2014-07-17 18:11:56 +02:00
Nicolas George 36fbe3c789 lavd/x11grab: change error code for unsupported visuals. 2014-07-17 18:11:55 +02:00
Nicolas George a65c0a3fe8 lavd/x11grab: disable drawing mouse without XFixes.
Fix a segfault if the XFixes extension is not available on
the X11 server.
Can be reproduced using the VNC server.
2014-07-17 18:11:55 +02:00
Nicolas George fc9c857c2d ffmpeg: use thread message API. 2014-05-26 11:40:21 +02:00
Nicolas George 55cc60cd6d lavu: add thread message API. 2014-05-26 11:40:15 +02:00
Nicolas George 58a10e0e2c compat/w32pthreads: add return value to pthread_cond_init(). 2014-05-26 11:33:42 +02:00
Nicolas George 41334fcab4 lavfi/drawtext: allow to format pts as HH:MM:SS.mmm. 2014-04-29 13:25:59 +02:00
Nicolas George 50ed6e3ce6 lavf/concatdec: implement automatic conversions. 2014-04-29 13:25:59 +02:00
Nicolas George 9d24a536a3 lavf/concatdec: reindent after last commit. 2014-04-29 13:25:59 +02:00
Nicolas George b24d6c5303 lavf/concatdec: always do stream matching. 2014-04-29 13:25:59 +02:00
Nicolas George c27939d871 lavf/concatdec: check match_streams() return value. 2014-04-29 13:25:59 +02:00
Nicolas George e973cf04f6 lavf/concatdec: use a structure for each stream. 2014-04-29 13:25:59 +02:00
Nicolas George 43ca94a633 ffprobe: use the codec descriptor if no decoder was found. 2014-04-29 13:25:59 +02:00
Nicolas George c9212abf95 lavf/matroska: add "binary" pseudo-MIME type.
Avoid long scan and "Could not find codec parameters for stream"
error when an attachment has this type.
2014-04-29 13:25:59 +02:00
Nicolas George 70beebe357 lavc: minor bump and APIchanges for AVCodecDescriptor.mime_types.
The minor bump also covers AV_CODEC_ID_BIN_DATA.
2014-04-29 13:25:52 +02:00
Nicolas George 1bf6396498 lavc: add a mime_types field to codec descriptors. 2014-04-29 13:24:18 +02:00