summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* lavf/rmdec: Do not return EIO on EOF.Carl Eugen Hoyos2016-08-02
| | | | Reported-by: applemax82
* Merge commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c'James Almer2016-08-01
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit '5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c': h264: add H264_ prefix to the NAL unit types Conflicts: libavcodec/h264_parse.c libavcodec/h264_parser.c libavcodec/h264_slice.c libavcodec/h264dec.c Merged-by: James Almer <jamrial@gmail.com>
* | avformat/matroskaenc: fix Voids with size < 10Michael Bradshaw2016-07-31
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/matroskadec: Add test for seeking with codec delay.Chris Cunningham2016-07-30
| | | | | | | | | | | | Also cleanup parens for the skip_to_timecode check. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/rmdec: Clear extradata when extradata_size is clearedMichael Niedermayer2016-07-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '251cbb44003caf179fb17afbb8a6c56643c2a646'Clément Bœsch2016-07-29
|\| | | | | | | | | | | | | * commit '251cbb44003caf179fb17afbb8a6c56643c2a646': h264: create a new header for common h264 definitions Merged-by: Clément Bœsch <u@pkh.me>
* | Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'Clément Bœsch2016-07-29
|\| | | | | | | | | | | | | * commit '9df889a5f116c1ee78c2f239e0ba599c492431aa': h264: rename h264.[ch] to h264dec.[ch] Merged-by: Clément Bœsch <u@pkh.me>
| * Add TrueMotion 2.0 Real Time decoderPaul B Mahol2016-06-20
| | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * Add MagicYUV decoderPaul B Mahol2016-06-20
| | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | lavf/mpegtsenc: add special case for handling timed ID3 packetsStefano Sabatini2016-07-29
| | | | | | | | | | | | Set the stream_id to 0xbd (private_stream_id_1). Tools seem to assume that value, and this is consistent with MPEG TS specification (ITU-T H.222.0 section 2.12.3).
* | avformat/matroskaenc: Write duration early during mkv_write_header (Rev #3)softworkz2016-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rev #2: Fixes doubled header writing, checked FATE running without errors Rev #3: Fixed coding style This commit addresses the following scenario: we are using ffmpeg to transcode or remux mkv (or something else) to mkv. The result is being streamed on-the-fly to an HTML5 client (streaming starts while ffmpeg is still running). The problem here is that the client is unable to detect the duration because the duration is only written to the mkv at the end of the transcoding/remoxing process. In matroskaenc.c, the duration is only written during mkv_write_trailer but not during mkv_write_header. The approach: FFMPEG is currently putting quite some effort to estimate the durations of source streams, but in many cases the source stream durations are still left at 0 and these durations are nowhere mapped to or used for output streams. As much as I would have liked to deduct or estimate output durations based on input stream durations - I realized that this is a hard task (as Nicolas already mentioned in a previous conversation). It would involve changes to the duration calculation/estimation/deduction for input streams and propagating these durations to output streams or the output context in a correct way. So I looked for a simple and small solution with better chances to get accepted. In webmdashenc.c I found that a duration is written during write_header and this duration is taken from the streams' metadata, so I decided for a similar approach. And here's what it does: At first it is checking the duration of the AVFormatContext. In typical cases this value is not set, but: It is set in cases where the user has specified a recording_time or an end_time via the -t or -to parameters. Then it is looking for a DURATION metadata field in the metadata of the output context (AVFormatContext::metadata). This would only exist in case the user has explicitly specified a metadata DURATION value from the command line. Then it is iterating all streams looking for a "DURATION" metadata (this works unless the option "-map_metadata -1" has been specified) and determines the maximum value. The precendence is as follows: 1. Use duration of AVFormatContext - 2. Use explicitly specified metadata duration value - 3. Use maximum (mapped) metadata duration over all streams. To test this: 1. With explicit recording time: ffmpeg -i file:"src.mkv" -loglevel debug -t 01:38:36.000 -y "dest.mkv" 2. Take duration from metadata specified via command line parameters: ffmpeg -i file:"src.mkv" -loglevel debug -map_metadata -1 -metadata Duration="01:14:33.00" -y "dest.mkv" 3. Take duration from mapped input metadata: ffmpeg -i file:"src.mkv" -loglevel debug -y "dest.mkv" Regression risk: Very low IMO because it only affects the header while ffmpeg is still running. When ffmpeg completes the process, the duration is rewritten to the header with the usual value (same like without this commit). Signed-off-by: SoftWorkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Fix missing streams in some cases with MPEG TSAnssi Hannula2016-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HLS demuxer calls the subdemuxer avformat_find_stream_info() while overriding the subdemuxer AVFMTCTX_NOHEADER flag by clearing it. However, this prevents some streams in some MPEG TS streams from being detected properly. Simply removing the clearing of the flag would cause the inner avformat_find_stream_info() call to take longer in some cases, without a way to control it. To fix the issue, do not clear the flag but propagate it to HLS demuxer. To avoid the above-mentioned mandatory delay, the call to avformat_find_stream_info() is dropped except in the HLS ID3 timestamped case. The HLS demuxer user should be calling avformat_find_stream_info() on the HLS demuxer if it wants to find the stream info. The main streams are now created dynamically after read_header time if the subdemuxer uses AVFMTCTX_NOHEADER (mpegts). Subdemuxer avformat_find_stream_info() is still called for the HLS ID3 timestamped case as the HLS demuxer needs to know the packet durations to properly interleave ID3 timestamped streams with MPEG TS streams on sub-segment level. Fixes ticket #4930.
* | avformat/hls: Move stream propagation to a separate functionAnssi Hannula2016-07-28
| | | | | | | | | | | | | | Creation of main demuxer streams from subdemuxer streams is moved to update_streams_from_subdemuxer() which can be called repeatedly. There should be no functional changes.
* | avformat/hls: Use an array instead of stream offset for stream mappingAnssi Hannula2016-07-28
| | | | | | | | | | This will be useful when the amount of streams per subdemuxer is not known at hls_read_header time in a following commit.
* | avformat/hls: Sync starting segment across variants on live streamsAnssi Hannula2016-07-28
| | | | | | | | | | This will avoid a large time difference between variants in the most common case.
* | avformat/hls: Fix regression with ranged media segmentsAnssi Hannula2016-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 81306fd4bdf ("hls: eliminate ffurl_* usage", merged in d0fc5de3a6) changed the hls demuxer to use AVIOContext instead of URLContext for its HTTP requests. HLS demuxer uses the "offset" option of the http demuxer, requesting the initial file offset for the I/O (http URLProtocol uses the "Range:" HTTP header to try to accommodate that). However, the code in libavformat/aviobuf.c seems to be doing its own accounting for the current file offset (AVIOContext.pos), with the assumption that the initial offset is always zero. HLS demuxer does an explicit seek after open_url to account for cases where the "offset" was not effective (due to the URL being a local file or the HTTP server not obeying it), which should be a no-op in case the file offset is already at that position. However, since aviobuf.c code thinks the starting offset is 0, this doesn't work properly. This breaks retrieval of ranged media segments. To fix the regression, just drop the seek call from the HLS demuxer when the HTTP(S) protocol is used.
* | avformat/utils: Fix find_stream_info not considering the extradata it foundAnssi Hannula2016-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9200514ad8717c6 ("lavf: replace AVStream.codec with AVStream.codecpar") merged in commit 6f69f7a8bf6a0d01 changed avformat_find_stream_info() to put the extradata it got from st->parser->parser->split() to st->internal->avctx instead of st->codec (extradata in st->internal->avctx will be later copied to st->codecpar). However, in the same function, the "is stream ready?" check was changed to check for extradata in st->codecpar instead of st->codec, even though st->codecpar is not yet updated at that point. Extradata retrieved from split() is therefore not considered anymore, and avformat_find_stream_info() will therefore needlessly continue probing in some cases. Fix that by checking for the extradata at st->internal->avctx where it is actually put.
* | avformat/flvdec: parse keyframe before a\v stream was created ↵Xinzheng Zhang2016-07-27
| | | | | | | | | | | | add_keyframes_index() when stream created or keyframe parsed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: splitting add_keyframes_index() out from ↵Xinzheng Zhang2016-07-27
| | | | | | | | | | | | parse_keyframes_index() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | librtmp: Avoid an infiniloop setting connection argumentsLuca Barbato2016-07-26
| | | | | | | | | | | | The exit condition was missing. Signed-off-by: Timothy Gu <timothygu99@gmail.com>
* | avformt/matroskaenc: undo an accidental revert by commit 5d48e4eaJames Almer2016-07-26
| | | | | | | | | | | | | | Commit 5d48e4eafa6c4559683892b8638d10508125f3cf accidentally reverted changes made to matroskaenc by commit 989a614b707dcff8abdffe28dc24ec64a83b2837. Signed-off-by: James Almer <jamrial@gmail.com>
* | libavformat/rtpdec_asf: zero initialize the AVIOContext structKacper Michajłow2016-07-25
| | | | | | | | | | | | | | This fixes crash in avformat_open_input() when accessing protocol_whitelist field. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/dnxhddata: move avpriv_dnxhd_parse_header_prefix to a headerJames Almer2016-07-25
| | | | | | | | | | | | | | | | | | It's a small and simple function that can be inlined. This removes one private symbol and should reduce object dependencies with the next major bump Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/tee: Rescale ts using av_packet_rescale_tsJan Sebechlebsky2016-07-23
| | | | | | | | | | | | | | | | | | This ensures that AV_NOPTS_VALUE value is handled correctly. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | libavformat/movenc: add dnxhr compatibility for apple playersMark Reid2016-07-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/matroskadec: fix unsigned overflow to improve seekingChris Cunningham2016-07-23
| | | | | | | | | | | | | | | | | | When seeking a file where codec delay is greater than 0, the timecode can become negative after offsetting by the codec delay. Failing to cast to a signed int64 will cause the check against skip_to_timecode to evaluate true for these negative values. This breaks the "skip_to" seek mechanism. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/teeproto: Fix memset sizeofMichael Niedermayer2016-07-22
| | | | | | | | | | Found-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Do not allocate empty extradataMichael Niedermayer2016-07-21
| | | | | | | | | | | | Fixes Ticket5723 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/rawenc: add dnxhr raw format extensionMark Reid2016-07-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libopenmpt: Add "date" to metadata.Jörn Heusipp2016-07-21
| | | | | | | | | | Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de> Signed-off-by: Josh de Kock <josh@itanimul.li>
* | libopenmpt: set stream duration and fix time baseJörn Heusipp2016-07-21
| | | | | | | | | | | | | | | | | | Fix the confusion around the used time base. Check size returned from avio_size() Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de> Signed-off-by: Josh de Kock <josh@itanimul.li>
* | libopenmpt: add subsong supportJosh de Kock2016-07-21
| | | | | | | | Signed-off-by: Josh de Kock <josh@itanimul.li>
* | avformat/oggenc: add vp8 muxing supportJames Almer2016-07-20
| | | | | | | | | | | | Addresses ticket #5687 Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: add an Ogg Video muxerJames Almer2016-07-20
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/mux: Fix some codecpar non usesMichael Niedermayer2016-07-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/avlanguage: make av_convert_lang_to() internalJames Almer2016-07-19
| | | | | | | | | | | | | | The header was never installed and the function is only used in libavformat Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/oggenc: fix page duration calculation when granule differs from ↵James Almer2016-07-19
| | | | | | | | | | | | | | timestamp Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/oggparsevp8: fix pts calculation on pages ending with an invisible ↵James Almer2016-07-19
| | | | | | | | | | | | frame Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat: Add tee protocolMichael Niedermayer2016-07-19
| | | | | | | | | | | | Option passing support will be submitted seperately to the ML Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | cosmetics: fix some misspelled wordsJames Almer2016-07-17
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | libavformat/libopenmpt: Fix memory leak in error path in read_header_openmpt().Jörn Heusipp2016-07-17
| | | | | | | | | | Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/tee: Use ff_format_output_open() functionJan Sebechlebsky2016-07-16
| | | | | | | | | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/utils: Add ff_format_output_open() functionJan Sebechlebsky2016-07-16
| | | | | | | | | | | | | | | | Add ff_format_output_open utility function to wrap io_open callback of AVFormatContext structure. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/tee: Support flushing by writing NULL pktJan Sebechlebsky2016-07-16
| | | | | | | | | | | | | | | | | | This will add support for flushing by writing NULL packet to the tee muxer, which propagates the action to slave muxers as expected. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/tee: Use ff_stream_encode_params_copy()Jan Sebechlebsky2016-07-16
| | | | | | | | | | | | | | | | | | Use ff_stream_encode_params_copy() to copy encoding-related fields (parameters) of stream. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/utils: Add ff_stream_encode_params_copy()Jan Sebechlebsky2016-07-16
| | | | | | | | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* | lavf: add libopenmpt demuxerJosh de Kock2016-07-15
| | | | | | | | | | | | Fixes ticket #5623 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/vplayerdec: Improve auto-detection.Clément Bœsch2016-07-15
| | | | | | | | | | Fixes the incorrect detection of 16_selma_OneFrame_QP39.yuv (gray16le rawvideo) as vplayer format.
* | lavf/img2dec: Also auto-detect (unusual) uncompressed pcx.Carl Eugen Hoyos2016-07-15
| |
* | lavf/img2: Remove ffv1-img.Carl Eugen Hoyos2016-07-15
| | | | | | | | The ffv1 format currently needs a container.