summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* mov: Check angle rather than full matrix when updating SARVittorio Giovara2015-01-14
| | | | | | | | | | | | When the display matrix is not the identity one, but the rotation angle is zero, there is no need to update the sample aspect ratio. Otherwise, it is possible to obtain negative values which interferes with transcoding in later stages. This kind of behaviour is reproducible on mov files with "major_brand: MSNV". CC: libav-stable@libav.org Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* img2dec: correctly use the parsed value from -start_numberVittorio Giovara2015-01-14
| | | | | | | Previously the image sequence was always starting from the minimum number rather than the requested one. CC: libav-stable@libav.org
* matroskaenc: refuse to write AAC without valid extradataAnton Khirnov2015-01-09
|
* mpeg: Remove unused fieldLuca Barbato2015-01-07
|
* segment: Fix the failure pathsLuca Barbato2015-01-07
| | | | | | | | | A failure in segment_end() or segment_start() would lead to freeing a dangling pointer and in general further calls to seg_write_packet() or to seg_write_trailer() would have the same faulty behaviour. CC: libav-stable@libav.org Reported-By: luodalongde@gmail.com
* movenc: Fix a typo in a commentMartin Storsjö2015-01-06
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Readd an accidentally removed conditionMartin Storsjö2015-01-06
| | | | | | | This was removed accidentally as part of 847bf598. This could cause groundless warning logging. Signed-off-by: Martin Storsjö <martin@martin.st>
* isom: add 'mp1v' fourccJustin Ruggles2015-01-06
| | | | | | As referenced in the CoreMedia API docs. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* movenc: Enable editlists by default if delay_moov is enabledMartin Storsjö2015-01-04
| | | | | | | Being able to write editlists properly is one of the main points in the delay_moov flag. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Check for malloc failures in avformat_new_streamMartin Storsjö2015-01-04
| | | | | CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Remove a misleading/incorrect commentMartin Storsjö2015-01-04
| | | | | | | | This comment can be traced back to the initial commit from 2001, and it seemed to be misleading/incorect already back then. (It was used for normal, non-raw file formats already then.) Signed-off-by: Martin Storsjö <martin@martin.st>
* avisynth: Use RTLD_LOCAL instead of RTLD_GLOBALMartin Storsjö2015-01-03
| | | | | | | There shouldn't be any need to add the loaded libraries to the global symbol namespace. Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Use pts for MPD timeline timestampsMartin Storsjö2015-01-03
| | | | | | | | | | | | | | | This should be more correct. This also should give more sensible switching between video streams with different amount of b-frame delay. The current dash.js release (1.2.0) fails to start playback of such files from the start (if the start pts is > 0), but this has been fixed in the current git version of dash.js. Also enable the use of edit lists, so that streams in many cases start at pts=0. Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Use delay_moovMartin Storsjö2015-01-03
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Get rid of a hack for updating the dvc1 atomMartin Storsjö2015-01-03
| | | | | | | Use the more generic approach with the delay_moov flag, instead of having a update mechanism specific to this one single atom. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Add an option for delaying writing the moov with empty_moovMartin Storsjö2015-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | This delays writing the moov until the first fragment is written, or can be flushed by the caller explicitly when wanted. If the first sample in all streams is available at this point, we can write a proper editlist at this point, allowing streams to start at something else than dts=0. For AC3 and DNXHD, a packet is needed in order to write the moov header properly. This isn't added to the normal behaviour for empty_moov, since the behaviour that ftyp+moov is written during avformat_write_header would be changed. Callers that split the output stream into header+segments (either by flushing manually, with the custom_frag flag set, or by just differentiating between data written during avformat_write_header and the rest) will need to be adjusted to take this option into use. For handling streams that start at something else than dts=0, an alternative would be to use different kinds of heuristics for guessing the start dts (using AVCodecContext delay or has_b_frames together with the frame rate), but this is not reliable and doesn't necessarily work well with stream copy, and wouldn't work for getting the right initialization data for AC3 or DNXHD either. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Use start_dts/cts instead of cluster[0] for writing edit listsMartin Storsjö2015-01-03
| | | | | | | This allows writing edit lists even when track->entry == 0, if the start times have been set. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Remove an unnecessary condition when flushing fragmentsMartin Storsjö2015-01-03
| | | | | | | | | | | If fragments == 0 it means we haven't written any moov atom yet. If the empty_moov flag is set, we already have written an empty moov atom at startup. Thus, the check for empty_moov is redundant. This is in preparation for allowing writing the moov atom later, even when using the empty moov flag. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Factorize writing ftyp and other identification tags to a separate ↵Martin Storsjö2015-01-03
| | | | | | function Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Remove some stray double spacesMartin Storsjö2014-12-29
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Fix writing of timelines that don't start at t=0Martin Storsjö2014-12-29
| | | | | | | | When writing an explicit time, reset the cur_time variable to this value as well. This avoids writing excessive time attributes for each segment in the timeline, as long as the segments are continuous. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: add support for OpusKieran Kunhya2014-12-20
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* libavformat: Only use MoveFileExA when targeting the desktop API subsetMartin Storsjö2014-12-19
| | | | | | | | | | | | | | | | The MoveFileExA is available in the headers regardless which API subset is targeted, but it is missing in the Windows Phone link libraries. When targeting Windows Store apps, the function is available both in the headers and in the link libraries, and thus there is no indication for the build system that this function should be avoided - such an indication is only given by the Windows App Certification Kit, which forbids using the MoveFileExA function. Therefore check the WINAPI_FAMILY defines instead, to figure out which API subset is targeted. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output ↵Martin Storsjö2014-12-19
| | | | | | | | | | buffer exists Since the mpegts muxer now can handle being called with a NULL AVIOContext, we don't need to try to allocate one before calling write_trailer. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Support running the write_trailer function without an AVIOContextMartin Storsjö2014-12-19
| | | | | | | | If opening and closing dynamic buffers as AVIOContext, we may not have any AVIOContext available when wanting to close and deallocate the muxer. Allow calling write_trailer despite this. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Allow calling av_write_trailer with a NULL AVIOContextMartin Storsjö2014-12-19
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: avoid a memleak when multiple stss boxes are presentAnton Khirnov2014-12-19
| | | | | CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
* rtsp: check ffurl_get_file_handle() return valueVittorio Giovara2014-12-18
| | | | | CC: libav-stable@libav.org Bug-Id: CID 717844
* check memory errors from av_strdup()Vittorio Giovara2014-12-18
|
* mpegts: check get16() return valueVittorio Giovara2014-12-18
| | | | | | | And break flow of execution rather than exiting the function. CC: libav-stable@libav.org Bug-Id: CID 732186
* oggdec: add support for VP8 demuxingJames Almer2014-12-18
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* movenc: Adjust the pts of new fragments similarly to what is done for dtsMartin Storsjö2014-12-18
| | | | | | | The pts and the corresponding duration is written in sidx atoms, thus make sure these match up correctly. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Add a muxer wrapping mpegts encoding into RTPMartin Storsjö2014-12-18
| | | | | | | | | | | | | | | Since this structurally is quite different from normal RTP (multiple streams are muxed into one single mpegts stream, which is packetized into one single RTP session), it is kept as a separate muxer. Since this structurally also behaves differently than normal RTP, all of the other muxers that do chained RTP muxing (rtsp, sap, mp4) would need to be updated similarly to handle this - in particular, creating one single rtp_mpegts muxer for the whole presentation instead of one rtp muxer per stream. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtp: Initial H.261 supportThomas Volkert2014-12-18
| | | | | | | | | | | | | | The packetizer only supports splitting at GOB headers - if such aren't available frequently enough, it splits at any random byte offset (not at a macroblock boundary either, which would be allowed by the spec) and sends a payload header pretend that it starts with a GOB header. As long as a receiver doesn't try to handle such cases cleverly but just drops broken frames, this shouldn't matter too much in practice. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Avoid brittle switch fallthroughsMartin Storsjö2014-12-18
| | | | | | | | | Instead explicitly jump to the default case in the cases where it is wanted, and avoid fallthrough between different codecs, which could easily introduce bugs if people editing the code aren't careful. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered dataMartin Storsjö2014-12-18
| | | | | | | | | If we throw away the buffered incomplete frame, make sure to also throw away the buffered bits of an incomplete byte at the same time. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Set the AVFMT_TS_NONSTRICT flagMartin Storsjö2014-12-18
| | | | | | | | In particular, when packetizing mpegts into rtp, the input packet timestamp may come from more than one stream, which could cause multiple packets be written with the same timestamp. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Set the timestamp properly when sending mpegts data, tooMartin Storsjö2014-12-18
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* srtpproto: fix option flag typeTristan Matthews2014-12-18
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Adjust the start time of a segment to the end of the previous segmentMartin Storsjö2014-12-17
| | | | | | | | | | | | | | | | This is the same adjustment that the mp4 muxer does to the start timestamp of fragments, since the timestamp of a sample in an mp4 file is implicit from the sum of earlier sample durations. This avoids gaps in the timeline (which can stop dash.js from playing it back), and makes sure the timestamp on the segmenter level matches what the mp4 muxer actually writes into the segments. This is only an issue if the AVPacket duration of the last packet of a segment doesn't point to the actual start timestamp of the next packet (the first in the next segment). Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Write segment timelines properly if the timeline has gapsMartin Storsjö2014-12-17
| | | | | | | | | | | | Write a new start time if the duration of the previous segment didn't match the start of the next one. Check that segments actually are continuous before writing a repeat count. This makes sure timestamps deduced from the timeline actually match the real start timestamp as written in filenames (if using a template containing $Time$). Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Fix handling of zero-length metadata valuesMartin Storsjö2014-12-15
| | | | | | | | | | | | | | | | Since 3cec81f4d4, a zero-length metadata value would try to allocate 2*0 bytes, where av_malloc() returns NULL. Always add one to the allocated length, to allow space for a null terminator in the zero-length case. Incidentally, this fixes fate-alac on RVCT 4.0, where a compiler bug seems to mess up the mov muxer to the point that it writes the wrong sort of metadata. Previously this bug was undetected, but since 3cec81f4d4 such mov files started returning AVERROR(ENOMEM) in the mov demuxer. Signed-off-by: Martin Storsjö <martin@martin.st>
* matroskadec: Fix read-after-free in matroska_read_seek()Xiaohan Wang2014-12-15
| | | | | | | | | | | In matroska_read_seek(), |tracks| is assigned at the begining of the function. However, functions like matroska_parse_cues() could reallocate the tracks and invalidate |tracks|. This assigns |tracks| only before using it, so that it will not get invalidated elsewhere. Bug-Id: chromium/427266
* dashenc: Change the duration fields to 64 bitMartin Storsjö2014-12-10
| | | | | | | | For the last_duration field, it's mostly theoretical, but the total_duration field more probably may need to actually be 64 bit. Bug-Id: CID 1254944 Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: log file output progress in verbose modeBryan Huh2014-12-10
| | | | | | | As the manifest/segments are flushed to disk, log to stderr the progress, when in verbose logging mode Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpproto: Fix the input RTP data format checkMartin Storsjö2014-12-09
| | | | | | | | | | | | | Only the upper 2 bits of the first byte are known to be a fixed value. The lower bits in the first byte of a RTP packet could be set if the input is from another RTP packetizers than libavformat's, but for RTCP packets, they would also be set when sending RTCP RR packets, triggering false warnings about incorrect input format to the protocol. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Build hevc.o when building the RTP muxerMartin Storsjö2014-12-09
| | | | | | | | | The RTP muxer enables the actual codepaths within sdp.c, which depend on hevc.o since e5cfc8fd. This fixes builds with --disable-everything --enable-muxer=rtp. Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: further expand the list of parsed metadata tagsDave Rice2014-12-08
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: expand the list of parsed metadata tagsVittorio Giovara2014-12-08
| | | | Based on L-Smash code by Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>.
* mov: parse XMP metadata on demandVittorio Giovara2014-12-08
| | | | | | | | | The Extensible Metadata Platform tag can contain various kind of data which are not strictly related to the video file, such as history of edits and saves from the project file. So display XMP metadata only when the user explicitly requires it. Based on a patch by Marek Fort <marek.fort@chyronhego.com>.