summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg.c
Commit message (Collapse)AuthorAge
* ffmpeg: log corrupted packets and framesMarton Balint2018-10-14
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: check return value of avcodec_parameters_from_contextMarton Balint2018-10-09
| | | | | | Fixes Coverity CID 1427273. Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: add correct field for raw pts in -progress reportGyan Doshi2018-08-28
| | | | | | | | | PTS is in microseconds, so correct field name is out_time_us. Old field out_time_ms kept for now - will be removed after a suitable transition period. Fixes #7345
* ffmpeg: simplify refcounting packets for the muxing queueJames Almer2018-08-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: fix -stream_loop with multiple inputsMarton Balint2018-07-02
| | | | | | | | | | The input thread needs to be properly cleaned up and re-initalized before we can start reading again in threaded mode. (Threaded input reading is used when there is mode than one input file). Fixes ticket #6121 and #7043. Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: factorize input thread creation and destructionMarton Balint2018-07-02
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: make loglevel verbose for frame duration warningGyan Doshi2018-06-28
|
* ffmpeg: Treat subtitles like audio and video for non-monotonic dts.Hans Carlson2018-06-23
| | | | | | | Fixes ticket #4450. Fixes ticket #6248. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/ffmpeg: Replace the number by macro for bprint initJun Zhao2018-06-17
| | | | | | Replace the number by macro for bprint init. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* ffmpeg: assert that audio packet duration in process_input_packet() is non ↵Michael Niedermayer2018-06-14
| | | | | | negative Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/ffmpeg: Fallback to duration if sample rate is unavailableMichael Niedermayer2018-06-14
| | | | | | | | | Regression since: af1761f7 Fixes: Division by 0 Fixes: ffmpeg_crash_1 Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: Fail if the user requested impossible subtitle encoding.Carl Eugen Hoyos2018-06-09
| | | | Fixes ticket #7239.
* fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabledVishwanath Dixit2018-06-04
| | | | | | | | | | Forced key frames generation functionality was assuming the first PTS value as zero, but, when 'copyts' is enabled, the first PTS can be any big number. This was eventually forcing all the frames as key frames. To resolve this issue, update has been made to use first input pts as reference pts. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/ffmpeg: properly initialize output stream field orderTobias Rapp2018-05-02
| | | | | | | Fixes stream field order written by avformat_write_header when "top" option is specified on the command-line. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* fftools/ffmpeg: fix mixed code and declarationsJames Almer2018-04-30
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg: change fps progress log message to show two decimal digitsAndré Camargo2018-04-28
| | | | | | Useful when transcoding videos at 29.97 fps because delivers a more accurate result for monitoring. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/ffmpeg: Add system time and real time to benchmarking.Mark Wachsler2018-04-28
| | | | | | | The -benchmark and -benchmark_all options now show user, system, and real time, instead of just user time. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: allow setting attached_pic dispositionTimo Teräs2018-04-04
| | | | | | | | This is used to signal that image should be stored in metadata as cover image. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lav*,tests: remove several register_all callsJosh de Kock2018-04-02
| | | | | | | avdevice_register_all() is still required to register devices into lavf (this is required due to lavd being somewhat of a hack). Signed-off-by: Josh de Kock <josh@itanimul.li>
* ffmpeg: prevent premature EOF in sub2video with nullptr AVSubtitlesJan Ekström2018-04-01
| | | | | | | | | | | | | | | | With certain types of input and the filter chain getting re-initialized or re-configured, multiple nullptr AVSubtitles can get pushed into sub2video_update() in a row from sub2video_heartbeat. This causes end_pts, and on the next round pts, to become INT64_MAX, latter of which signals EOF in framesync, leading to complete loss of subtitles from that point on. Thus, check that the sub2video.end_pts is smaller than INT64_MAX in a similar fashion to sub2video_flush before sending out the nullptr AVSubtitle. This keeps premature EOFs from happening in framesync and the subtitle overlay is kept past the filter chain re-initializations/configurations.
* fftools/ffmpeg: Remove an unused variable.Carl Eugen Hoyos2018-03-30
| | | | | Fixes a warning: fftools/ffmpeg.c:2201:22: warning: unused variable 'fg'
* ffmpeg: do not finish output streams manually on eof even if no input is ↵Marton Balint2018-03-29
| | | | | | | | | | | | | provided The generic code should be able to finish the streams just fine initializing and flushing the filters and codecs properly. Fixes the following command: ffmpeg -f lavfi -i "testsrc=d=0.1[out0];aevalsrc=0:d=0[out1]" -af apad -shortest -f framecrc - Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: fallback to codecpar parameters on input filter eofMarton Balint2018-03-29
| | | | | | | | Fixes ticket #6854 and the following simpler case: ffmpeg -f lavfi -i testsrc=d=1 -f lavfi -i testsrc=d=0 -filter_complex overlay -f null none Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: pass reference counted packet on codec copy when possibleJames Almer2018-03-23
| | | | | | | | Should prevent unnecessary copy of data in cases where new references to the packet are created within the muxer or a bitstream filter. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: remove dead call to av_parser_change()James Almer2018-03-23
| | | | | | | | | | | It's been a noop for years, and it's been argued that in-band headers should not be forcedly removed without the user's explicit request. Also, as the FIXME line stated, this is a job for a bitstream filter like extract_extradata, remove_extradata, dump_extradata, and filter_units. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg.c - drain all decoded frames during stream_loop flushGyan Doshi2018-03-20
| | | | | | | | | | | | | | When a decoded stream is being looped, after each post-EOF rewind, decoders are flushed in seek_to_start(). This only drains 1 frame, and thus the output has a few frames missing at the tail of each iteration except the last. With this patch, process_input is looped till process_input_packet reaches EOF. Fixes #7081 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* fftools/ffmpeg: update print_report to use AVBPrint APITobias Rapp2018-03-05
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* fftools/ffmpeg: fix progress log message in case pts is not availableTobias Rapp2018-03-05
| | | | | | Also fixes sign prefix for progress report. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* fftools/ffmpeg: replace call to av_strerror with av_err2strTobias Rapp2018-02-27
| | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* Don't complain about codec2's 700 bit/s modes in ffmpeg.cTomas Härdin2018-02-24
|
* avformat/mpegts: set AV_DISPOSITION_DEPENDENT for mix_type=0 supplementary audioAman Gupta2018-02-23
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* fftools, tools, examples: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: Ignore SIGPIPEMark Thompson2018-01-25
| | | | | | | | | | | | | On systems which deliver SIGPIPE (Unices), a broken pipe will currently result in the immediate termination of the ffmpeg process (the default disposition as required by POSIX). This is undesirable, because while the broken pipe is likely fatal to useful cleanup of whatever component is writing to it, there might be other components which can do useful cleanup - for example, a muxer on another stream may still need to write indexes to complete a file. Therefore, set the signal disposition for SIGPIPE to ignore the signal - the call which caused the signal will fail with EPIPE and the error will be propagated upwards like any other I/O failure on a single stream.
* ffmpeg: use thread wrappers for the thread message functionalityJames Almer2018-01-04
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: Use codec hardware config to configure hwaccelsMark Thompson2017-11-26
| | | | | Removes specific support for all hwaccels supported by the generic code (DXVA2, D3D11VA, NVDEC, VAAPI and VDPAU).
* ffmpeg: add return value check to supress the build warning.Jun Zhao2017-11-21
| | | | | | | | | add return value check to supress the build warning message like "warning: ignoring return value" when use attribute -Wunused-result. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Reviewed-by: 刘歧 <lq@chinaffmpeg.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: remove usage of AVCodecContext accessorsJames Almer2017-11-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: use explicitly requested hwaccel onlyTimo Rothenpieler2017-11-11
| | | | | | | | | With there being two hwaccels that use the CUDA pix_fmt now, just relying on the pix_fmt to identify the selected hwaccel is not enough anymore. So this checks if the user explicitly selected a hwaccel, and only accepts that one.
* Merge commit 'a58873b11198d04670b7f98f5a8a749d742db7c5'James Almer2017-11-10
| | | | | | | * commit 'a58873b11198d04670b7f98f5a8a749d742db7c5': avconv: when using -loop option bail out if seek to start fails Merged-by: James Almer <jamrial@gmail.com>
* ffmpeg.c: fix code style in seek_to_startPeter Große2017-11-05
| | | | | Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg.c: fix calculation of input file duration in seek_to_start()Peter Große2017-11-05
| | | | | | | | | | | Fixes looping files without audio or when using stream_copy, where ist->nb_samples is not set since no decoding is done. This fixes ticket #5719 and also fixes an endless loop with the sample in ticket #6139. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: Fix flush packet stream copy input timestamp handlingMark Thompson2017-11-01
| | | | | | | Since a7da13474286774cf378c3ea606c19a7c1a0eba3, flush packets are passed to process_input_packet() during stream copy. This modifies the input timestamp handling to ignore them - since they contain no data, timestamps should not be affected.
* Merge commit '91622f6446b463abe6507ad2cd5d1fbf7e49c424'James Almer2017-10-31
| | | | | | | * commit '91622f6446b463abe6507ad2cd5d1fbf7e49c424': avconv: Always initialize the opkt struct on streamcopy Merged-by: James Almer <jamrial@gmail.com>
* Merge commit '4d56f7ab8f627aa140c1ede1bb61305f01cefcdd'James Almer2017-10-30
| | | | | | | * commit '4d56f7ab8f627aa140c1ede1bb61305f01cefcdd': avconv: Flush output BSFs when stream copy reaches EOF Merged-by: James Almer <jamrial@gmail.com>
* ffmpeg: Fix stored encoder metadata with -bitexactMichael Niedermayer2017-10-30
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: Remove AVFMT_RAWPICTURE.Carl Eugen Hoyos2017-10-26
| | | | Deprecated since October 2015.
* ffmpeg: always init output stream before reaping filtersMarton Balint2017-10-18
| | | | | | | | | | Otherwise the frame size of the codec is not set in the buffersink. Fixes ticket #6603 and the following simpler case: ffmpeg -c aac -filter_complex "sine=d=0.1,asetnsamples=1025" out.aac Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg.c: Fallback to duration_dts, when duration_pts can't be determined.Sasi Inguva2017-10-12
| | | | | | | | This is required for FLV files, for which duration_pts comes out to be zero. Signed-off-by: Sasi Inguva <isasi@google.com> Reviewed-by: Thomas Mundt <tmundt75@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: always use single threaded decoding for attached picturesMarton Balint2017-10-08
| | | | | | | | | | | | | | | | | | Since af1761f7b5b1b72197dc40934953b775c2d951cc ffmpeg waits for a frame in each stream before writing the output header. If we are using threaded decoding for attached pictures, we have to read till EOF to be able to finally flush the decoder and output the decoded frame. This essentially makes ffmpeg buffer all non-attached picture packets, which will cause a "Too many packets buffered for output stream" eventually. By forcing single threaded decoding, we get a frame from a single packet as well and we can avoid the error. Fixes part of ticket #6375: ffmpeg -i 46564100.mp3 -acodec libmp3lame -ab 128k -ac 2 out.mp3 Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit 'c95169f0ec68bdeeabc5fde8aa4076f406242524'James Almer2017-10-01
* commit 'c95169f0ec68bdeeabc5fde8aa4076f406242524': build: Move cli tool sources to a separate subdirectory Merged-by: James Almer <jamrial@gmail.com>