summaryrefslogtreecommitdiff
path: root/ffmpeg.c
Commit message (Collapse)AuthorAge
* ffmpeg: Clear fifo pointer on deallocationMichael Niedermayer2017-04-18
| | | | | | Not leaving stale pointers is more robust Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: use av_stream_new_side_data() in init_output_streamJames Almer2017-04-08
|
* ffmpeg: use av_stream_new_side_data()James Almer2017-04-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: Change duration to int64_tMichael Niedermayer2017-04-07
| | | | | | | It is assigned from 64bit input in some branches and used with 64bit timestamps This thus fixes a potential integer truncation Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: make transcode_init_done atomic.Ronald S. Bultje2017-04-03
| | | | | | | | | | | Should fix tsan warnings in fate-fifo-muxer-h264/wav: WARNING: ThreadSanitizer: data race (pid=26552) Write of size 4 at 0x000001e0d7c0 by main thread: #0 transcode_init src/ffmpeg.c:3761 (ffmpeg+0x00000050ca1c) [..] Previous read of size 4 at 0x000001e0d7c0 by thread T1: #0 decode_interrupt_cb src/ffmpeg.c:460 (ffmpeg+0x0000004fde19)
* ffmpeg: Fix avframe memleakMichael Niedermayer2017-03-30
| | | | | | Fixes CID1401674 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9'Matthieu Bouron2017-03-30
|\ | | | | | | | | | | | | * commit 'e3fb74f7f9a8f1895381355f40c92cac3c1023d9': lavfi: Always propagate hw_frames_ctx through links Merged-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* | Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
| |
* | avformat, ffmpeg: deprecate old rotation APIwm42017-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old "API" that signaled rotation as a metadata value has been replaced by DISPLAYMATRIX side data quite a while ago. There is no reason to make muxers/demuxers/API users support both. In addition, the metadata API is dangerous, as user tags could "leak" into it, creating unintended features or bugs. ffmpeg CLI has to be updated to use the new API. In particular, we must not allow to leak the "rotate" tag into the muxer. Some muxers will catch this properly (like mov), but others (like mkv) can add it as generic tag. Note applications, which use libavformat and assume the old rotate API, will interpret such "rotate" user tags as rotate metadata (which it is not), and incorrectly rotate the video. The ffmpeg/ffplay tools drop the use of the old API for muxing and demuxing, as all muxers/demuxers support the new API. This will mean that the tools will not mistakenly interpret per-track "rotate" user tags as rotate metadata. It will _not_ be treated as regression. Unfortunately, hacks have been added, that allow the user to override rotation by setting metadata explicitly, e.g. via -metadata:s:v:0 rotate=0 See references to trac #4560. fate-filter-meta-4560-rotate0 tests this. It's easier to adjust the hack for supporting it than arguing for its removal, so ffmpeg CLI now explicitly catches this case, and essentially replaces the "rotate" value with a display matrix side data. (It would be easier for both user and implementation to create an explicit option for rotation.) When the code under FF_API_OLD_ROTATE_API is disabled, one FATE reference file has to be updated (because "rotate" is not exported anymore). Tested-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: stop using deprecated codec flagsJames Almer2017-03-25
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '27085d1b47c3741cc0fac284c916127c4066d049'Clément Bœsch2017-03-22
|\| | | | | | | | | | | | | * commit '27085d1b47c3741cc0fac284c916127c4066d049': avconv: only retry decoding on actual decoding errors Merged-by: Clément Bœsch <u@pkh.me>
* | ffmpeg: Initialize two stack variables.Carl Eugen Hoyos2017-03-21
| | | | | | | | Avoids reading from uninitialized memory, regression since af1761f7
* | ffmpeg: don't unnecessarily use a deprecated API functionwm42017-03-21
| | | | | | | | | | Since we've disabled side data merging in ffmpeg.c, this really changes nothing.
* | ffmpeg: set the encoding framerate when the output is CFRAnton Khirnov2017-03-17
| | | | | | | | | | | | (cherry picked from Libav commit d10102d23c9467d4eb84f58e0cd12be284b982f6) Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
* | Merge commit 'e46a6fb7732a7caef97a916a4f765ec0f779d195'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'e46a6fb7732a7caef97a916a4f765ec0f779d195': avconv: Check that muxing_queue exists before reading from it Mostly noop. This was fixed in FFmpeg in 7f7c494a3. The merge makes the cosmetics match but does not include the weird av_log(). Merged-by: Clément Bœsch <cboesch@gopro.com>
* | Merge commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0'Clément Bœsch2017-03-12
|\| | | | | | | | | | | | | * commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0': avconv: stop using setpts for input framerate forced with -r Merged-by: Clément Bœsch <u@pkh.me>
* | ffmpeg: remove unnecessary hack for decoders which refuse to drainwm42017-03-06
| | | | | | | | Now the previous commit takes care of this instead.
* | ffmpeg: delay processing of subtitles before filters are initializedwm42017-03-03
| | | | | | | | | | | | | | If a subtitle packet came before the first video frame could be fully decoded, the subtitle packet would get discarded. This puts the subtitle into a queue instead, and processes it once the attached filter graph is initialized.
* | ffmpeg_cuvid: adapt for recent filter graph initialization changesTimo Rothenpieler2017-03-03
| |
* | ffmpeg: restructure sending EOF to filtersAnton Khirnov2017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be more careful when an input stream encounters EOF when its filtergraph has not been configured yet. The current code would immediately mark the corresponding output streams as finished, while there may still be buffered frames waiting for frames to appear on other filtergraph inputs. This should fix the random FATE failures for complex filtergraph tests after a3a0230a9870b9018dc7415ae5872784d524cfe5 This merges Libav commit 94ebf55. It was previously skipped. This is the last filter init related Libav commit that was skipped, so this also removes the commits from doc/libav-merge.txt. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | ffmpeg: move flushing the queued frames to configure_filtergraph()Anton Khirnov2017-03-03
| | | | | | | | | | | | | | | | | | This is a more appropriate place for it, and will also be useful in the following commit. This merges Libav commit d2e56cf. It was previously skipped. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | ffmpeg: init filtergraphs only after we have a frame on each inputAnton Khirnov2017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure the actual stream parameters are used, which is important mainly for hardware decoding+filtering cases, which would previously require various weird workarounds to handle the fact that a fake software graph has to be constructed, but never used. This should also improve behaviour in rare cases where avformat_find_stream_info() does not provide accurate information. This merges Libav commit a3a0230. It was previously skipped. The code in flush_encoders() which sets up a "fake" format wasn't in Libav. I'm not sure if it's a good idea, but it tends to give behavior closer to the old one in certain corner cases. The vp8-size-change gives different result, because now the size of the first frame is used. libavformat reported the size of the largest frame for some reason. The exr tests now use the sample aspect ratio of the first frame. For some reason libavformat determines 0/1 as aspect ratio, while the decoder returns the correct one. The ffm and mxf tests change the field_order values. I'm assuming another libavformat/decoding mismatch. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | ffmpeg: do packet ts rescaling in write_packet()Anton Khirnov2017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be useful in the following commit, after which the muxer timebase is not always available when encoding. This merges Libav commit 3e265ca. It was previously skipped. There are some changes with how/when the mux_timebase field is set, because the Libav approach often causes a too imprecise time base to be set. This is hard, because the muxer's write_header function can readjust the timebase, at which point we might already have encoded packets buffered. (It might be better to buffer them after the encoder, instead of after all the timestamp handling logic before muxing.) The two FATE tests change because the output time base is raised for subtitles. (Needed to avoid certain rounding issues in other cases.) Includes a minor merge fix by Mark Thompson, and avconv: Move rescale to stream timebase before monotonisation also by Mark Thompson <sw@jkqxz.net>. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | ffmpeg: make sure packets put into the muxing FIFO are refcountedwm42017-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some callers (like do_subtitle_out()) call this with an AVPacket that is not refcounted. This can cause undefined behavior. Calling av_packet_move_ref() does not make a packet refcounted if it isn't yet. (And it can't be made to, because it always succeeds, and can't return ENOMEM.) Call av_packet_ref() instead to make sure it's refcounted. I couldn't find a case that is fixed by this with the current code. But it will fix the fate-pva-demux test with the later patches applied. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | ffmpeg: Add a linebreak to an error message.Carl Eugen Hoyos2017-02-27
| |
* | ffmpeg: Remove redundant null checkMichael Niedermayer2017-02-06
| | | | | | | | | | | | Fixes CID1396245 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: Add a missing line break when requesting a sample.Carl Eugen Hoyos2017-02-02
| |
* | ffmpeg.c: Add output file index and stream index to vstats file.Sasi Inguva2017-01-27
| | | | | | | | | | Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: pass output stream duration as a hint to the muxerTobias Rapp2017-01-19
| | | | | | | | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: Add -time_base option to hint the time baseMichael Bradshaw2017-01-14
| | | | | | | | | | Signed-off-by: Michael Bradshaw <mjbshaw@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: use buffersink accessors.Nicolas George2017-01-12
| |
* | ffmpeg: remove stop_encoding variable and related code, it is dead / unused codeMichael Niedermayer2016-12-28
| | | | | | | | | | | | | | Fixes: CID1396243 Reviewed-by: compn <tempn@mi.rr.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: Check avcodec_parameters_to_context() for failureMichael Niedermayer2016-12-26
| | | | | | | | | | | | Fixes CID1396241 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: assert return value is initializedTobias Rapp2016-12-01
| | | | | | | | | | Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg: factor out sending frame to filtersClément Bœsch2016-11-18
| | | | | | | | | | Video doesn't exit ffmpeg on error anymore, and audio now prints an error.
* | ffmpeg: remove dead code out of the video filter loopClément Bœsch2016-11-18
| | | | | | | | | | | | It makes no sense for this code to be inside the video filter loop, and the frame sample aspect ratio is even set unconditionally a few lines above.
* | Merge commit 'b55566db4c51d920a6496455bb30a608e5a50a41'Hendrik Leppkes2016-11-14
|\| | | | | | | | | | | | | | | | | | | * commit 'b55566db4c51d920a6496455bb30a608e5a50a41': avconv: use avcodec_parameters_copy() with streamcopy The fate-aac-autobsf-adtstoasc changes from writing an audio bitdepth based on the sample format, which is now available. Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | Merge commit '50722b4f0cbc5940e9e6e21d113888436cc89ff5'Hendrik Leppkes2016-11-13
|\| | | | | | | | | | | | | * commit '50722b4f0cbc5940e9e6e21d113888436cc89ff5': avconv: decouple configuring filtergraphs and setting output parameters Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | Merge commit 'ba7397baef796ca3991fe1c921bc91054407c48b'Hendrik Leppkes2016-11-13
|\| | | | | | | | | | | | | * commit 'ba7397baef796ca3991fe1c921bc91054407c48b': avconv: factor out initializing stream parameters for encoding Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | ffmpeg: add newline to avformat_write_header error messageMarton Balint2016-11-13
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
* | ffmpeg: don't overwrite av_bsf_receive_packet return value before checking itJames Almer2016-11-05
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | ffmpeg: Warn if thousands of frames are duplicated.Carl Eugen Hoyos2016-11-04
| | | | | | | | Fixes ticket #5193.
* | ffmpeg: Fix bsf corrupting merged side dataMichael Niedermayer2016-11-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '722ec3eb35bc152ce91d0a4502eca0df1c0086d0'Hendrik Leppkes2016-11-03
|\| | | | | | | | | | | | | * commit '722ec3eb35bc152ce91d0a4502eca0df1c0086d0': avconv: decouple configuring filtergraphs and setting input parameters Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | doc: fix spelling errorsAndreas Cadhalpun2016-10-21
| | | | | | | | | | | | | | | | Thanks to Mathieu Malaterre <malat@debian.org> for reporting the Que/Queue typo. (https://bugs.debian.org/839542) Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | ffmpeg: remove unused ist parameter in do_subtitle_out()Clément Bœsch2016-10-16
| |
* | ffmpeg: Use av_fifo_freep() to avoid stale pointersMichael Niedermayer2016-10-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | ffmpeg_cleanup: fix crash with unrecognized codecJames Zern2016-10-14
| | | | | | | | | | | | | | | | since: 3e5e5bd Merge commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc' Signed-off-by: James Zern <jzern@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc'Hendrik Leppkes2016-10-08
|\| | | | | | | | | | | | | * commit '398f015f077c6a2406deffd9e37ff34b9c7bb3bc': avconv: buffer the packets written while the muxer is not initialized Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* | ffmpeg: explicitly write headers for files with no streamsHendrik Leppkes2016-10-07
| | | | | | | | | | Recent changes to ffmpeg.c tied output file init to stream init, which broke stream-less files, specifically ffmetadata output.