Nicolas George
299a56879d
ffmpeg: make reading packets from thread blocking.
...
If a packet is not ready on the input selected by ffmpeg,
it will read from another input instead. If that happens
repeatedly, frames will accumulate somewhere later in the
processing to ensure streams synchronization. It can happen
in particular when reading from a slow medium or an
expensive lavfi filter graph.
Make reading from normal demuxers on non-streamed data and
from the lavfi pseudo-device blocking to avoid that.
Should fix trac ticket #3079 .
11 years ago
Michael Niedermayer
3734c3ea51
ffmpeg: reduce frame rate for mpeg4 to be within the spec limits
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3868e97c6b
ffmpeg: fix vstats
...
Broken by: 394fb56c29
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Stefano Sabatini
290da7e754
ffmpeg: tweak debug_ts logging and add more of it
...
Help with debugging timestamp issues.
11 years ago
Michael Niedermayer
2e02d71237
ffmpeg: print data size too in statistic
...
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
be7b76230f
ffmpeg: also count data streams bytes
...
Fixes wrong error message about empty output file
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Stefano Sabatini
9651239f67
ffmpeg: use intermediary variables in reap_filters, increase readability
11 years ago
Stefano Sabatini
094516a5d0
ffmpeg: use av_err2str() macro
...
Simplify.
11 years ago
Stefano Sabatini
9f956d9d8d
ffmpeg: apply misc cosmetics to process_input() code
11 years ago
Michael Niedermayer
740e6042a0
ffmpeg: change ost->finished to an enum
...
Idea-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d73f897669
ffmpeg: update statistics only when a packet is actually muxed
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
5c459504f6
ffmpeg/flush_encoders: dont mux packets once ost->finished has been set
...
Fixes muxing frames after av_interleaved_write_frame() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
706741e8d7
ffmpeg: properly close down muxers on av_interleaved_write_frame() failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4ff77d4451
ffmpeg: check ost->finished in check_output_constraints()
...
No testcase but it seems logic to stop when finished is set
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7d91fb305e
ffmpeg: check ost->finished in reap_filters()
...
This avoids finished output streams continuing to receive frames
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
88956f73f2
ffmpeg: use timestamp from before and after the decoder to detect backward moving dts for discontinuity detection
...
This should make discontinuity detection more robust and detect
more cases. Timestamps after the decoder can be delayed due to threads,
timestamps before can be missing
no testcase available/known
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Jan Gerber
200cfab8c4
remuxing .opus files to .webm codec->delay must be copied too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Marton Balint
31bb172be2
ffmpeg: ensure that -fix_sub_duration doesnt create subtitles with zero duration
...
When fix_sub_duration is used, and the duration fixing code is generating 0
duration, that is definitely zero, and not undefined or infinite (which may be
the case for decoded AVSubtitles depending on the codec), so it is safe to drop
it.
It fixes teletext subtitle sources, when the subtitles are transmitted twice
after each other for some reason.
Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
11 years ago
Marton Balint
4d6f2ff524
ffmpeg: free empty subtitles as well in transcode_subtitles
...
Even if it does not matter at the moment, because subtitles with num_rect == 0
have no memory allocated, this is how we expect the users to use the API, a
returned AVSubtitle should be freed with avsubtitle_free.
Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
11 years ago
Marton Balint
3e396ca8ed
ffmpeg: do not pass possibly undefined subtitles to sub2video_update
...
It should not matter for real-life usage, it is just cleaner this way.
Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
11 years ago
Michael Niedermayer
738ebb4a0e
ffmpeg: set VCFR when copying timestamps
...
This fixes unreasonable initial frame repeats
Fixes Ticket3176
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d7ac887cd6
cmdutils&ffmpeg: use av_fopen_utf8() for passlogfile
...
might fix Ticket3056
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
df87cfd798
ffmpeg: fix do_streamcopy() so it copies side data too
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d7ebeba80c
ffmpeg: Do not fill gap before the first decodable frame on single stream input files unless the user explicitly requests it.
...
Fixes different behavior to JM and probably several if not all
reference decoders.
We cannot just do this unconditionally as it would ruin AV sync in
some use cases.
Bug-Found-by: BugMaster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8cdf4e0823
ffmpeg: remove unneeded include "libswscale/swscale.h"
...
Found-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
9c52ab6f4f
ffmpeg: treat avi as VFR in framerate conversion code
...
It can be debated if avi is vfr or cfr, it can be either depending
on the definition of vfr and cfr.
This commit ensures that avi is treated correctly independent of
the AVFMT_VARIABLE_FPS value.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a443b9732f
ffmpeg: make stream default if its the only of its kind and no source can be unambigously assigned to it
...
Fixes Ticket2969
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b36257921e
ffmpeg: Dont crash on unconnected output pads before an error is printed
...
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a72bf5fd11
ffmpeg: set the source_index for trivial filter graphs
...
Fixes one testcase in Ticket2969
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b6b9c150f0
ffmpeg: add max_error_rate to allow tuning the point decoding errors are considered a failure of the whole transcoding.
...
Suggested-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
38e13f55a5
ffmpeg: dont detect slight (0.1sec) backward moving dts as discontinuity
11 years ago
Michael Niedermayer
0425fd7eb2
ffmpeg: dont return reserved values
...
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7883827cb7
ffmpeg: check for unsupported "queing of command on first filter supporting the specific commend"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1525107313
ffmpeg: improve built in docs for passing commands
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f8f4e48b6d
ffmpeg: print command replies starting on column 0
...
This fixes formating issues with multi-line replies
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
47f9a5b737
Warn the user if a pix_fmt != yuv420p was chosen for MPEG-2 video encoding.
...
Fixes ticket #2870 .
11 years ago
Stefano Sabatini
f118b41759
ffmpeg: raise level for message printed in case of auto-select pixel format
...
Increase visibility, in order to decrease troubleshooting for
users generating non playable H.264 content.
Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
11 years ago
Derek Buitenhuis
58950ca0df
ffmpeg: Don't include colorspace.h
...
The header is private, and ffmpeg.c doesn't use it
for anything.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
12 years ago
Nicolas George
fc82f4a1f8
ffmpeg: ignore EOF when pushing frames to filters.
...
EOF is not a fatal condition, it is normally produced
by a few filters.
TODO: take it into account to avoid useless decoding.
12 years ago
Justin Ruggles
e816a8bc26
ffmpeg: use actual packet pts when discarding for the copypriorss option
...
The ist->pts value at this point does not necessarily match the actual packet
pts, which is what should be used to decide whether to discard the packet.
Without this change, some video packets that have pts on or after the start
time are getting discarded when they should not be.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
12 years ago
Michael Niedermayer
1a36c756d8
ffmpeg: free threads on error conditions.
...
Fixes Ticket2562
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
33ff943f70
ffmpeg: add -apad option which injects a apad filter only in the presence of video streams
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
410905f7fd
ffmpeg: use av_freep() for forced_kf_pts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0966623604
ffmpeg: drop old non monotone dts workaround.
...
All bugs should now be fixed in the new so the old can be droped.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
af2d964336
ffmpeg: set correct log context for non monotone dts workaround warnings
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b2a1d92b7b
ffmpeg: port loglevel selection code to new dts workaround code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
30c05f6b02
ffmpeg: fix pts handling in the non monotone dts workaround
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
007ee09d7c
ffmpeg: fix the used maximum dts in the monotone dts workaround
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
26b89f6274
ffmpeg: use a max variable to hold the maximum dts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6b2fbdb047
ffmpeg: Check dts before use in non monotone dts workaround
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago