summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* 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>.
* mov: parse @PRM and @PRQ metadata tagsVittorio Giovara2014-12-08
| | | | | | | | | These tags describe the product and quicktime library version respectively. They originate from Adobe Premiere, but also some other programs use them. Contrary to other tags, they contain 'raw' data which is not to be interpreted as iso639 or mac strings. Based on a patch by Peter Ross <pross@xvid.org>.
* mov: cosmetics: reorder the list of tagsVittorio Giovara2014-12-08
| | | | | Alphabetically order the list by the tag to facilitate the insertion of new ones.
* Allow reading of growing avi files (currently being written)Joakim Plate2014-12-08
| | | | | | | | | | | | | This uses the RIFF header stored size to figure out the expected AVI file size, instead of the actual file. To work fully it requires handling failed avio_seek() instead of assuming they always succeed. Some fate file has been cut off and contains half a frame at the end which previously was not output during demuxing. This frame is now output to encoder, thus the fate diff update. Bug-Id: 261 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* riff: Support decoding png in avi (ImageJ)Carl Eugen Hoyos2014-12-08
|
* rtpproto: Write a warning if the input data written isn't RTP packetizedMartin Storsjö2014-12-08
| | | | | | | Tell the user that the RTP muxer needs to be used to packetize the data - using the RTP protocol on its own isn't enough. Signed-off-by: Martin Storsjö <martin@martin.st>
* mp3: Tweak the probe scoresLuca Barbato2014-12-07
| | | | | | | | Having more than 10 consecutive frames decoded as mp3 should be considered a clear signal that the sample is mp3 and not mpegps. Reported-By: Florian Iragne <florian@iragne.fr> CC: libav-stable@libav.org
* latm: Do not give a score for a single instanceLuca Barbato2014-12-07
| | | | | Bug-Id: 773 CC: libav-stable@libav.org
* mov: skip version and flags attributes in mov_read_chan()Matthieu Bouron2014-12-05
| | | | | | | | | Fixes decting channel layout for files with uncommon audio, such as FL and FR in two separate streams. Introduced in 3bab7cd. CC: libav-devel@libav.org Sample-Id: ticket1474.mov Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* rm: Use the correct codec_data_size signednessLuca Barbato2014-12-04
| | | | | | | | | The function takes a size and not an offset. CC: libav-stable@libav.org Sample-Id: rm_deadlock.rm Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mkv: Validate ASS Start and End fieldsLuca Barbato2014-12-03
| | | | CC: libav-stable@libav.org
* Drop the unofficial extension prefix for MPEG and MPEG-TS formatsFlorent Le Coz2014-12-02
| | | | | | | | As per the RFCs: http://tools.ietf.org/html/rfc3555#page-38 http://tools.ietf.org/html/rfc3003 CC: libav-stable@libav.org
* mpegtsenc: recognize .mts as MPEG Transport StreamJean-Baptiste Mardelle2014-12-02
|
* Add support for BDAV/m2ts-mode muxingFredrik Axelsson2014-12-02
| | | | | Signed-off-by: Fredrik Axelsson <fraxbe@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mov: allocate the tag value dynamicallyThilo Borgmann2014-12-02
| | | | | | | | This allows to load metadata entries longer than 1024 bytes. Displaying them is still limited to 1024 characters, but applications can load them fully now. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Add an option for exporting all metadataVittorio Giovara2014-12-02
|
* mov: do not truncate the language-prefixed tagVittorio Giovara2014-12-02
|
* rtsp: move the CONFIG_ macros to the beginning of the checkVittorio Giovara2014-12-02
| | | | | With --disable-optimizations, the DCE of some compilers does not remove such unused code, causing linking failure.
* rtmpproto: Fix a typo in a commentMartin Storsjö2014-11-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Avoid a VLA-like constructMartin Storsjö2014-11-28
| | | | | | | This fixes the build on compilers that interpreted the earlier code as a variable length array (which we intentionally disallow). Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: Add options to make segment names configurableBryan Huh2014-11-28
| | | | | | | This allows one to specify templated segment names for init-segments, media-segments, and for the base-url in the case of single-file. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccessMartin Storsjö2014-11-28
| | | | | | | | | | | | | | | | | | | | | | Currently, when streaming to an RTMP server, any time a packet of type RTMP_PT_NOTIFY is encountered, the packet is prepended with @setDataFrame before it gets sent to the server. This is incorrect; only packets for onMetaData and |RtmpSampleAccess should invoke @setDataFrame on the RTMP server. Specifically, the current bug manifests itself when trying to stream onTextData or onCuePoint invocations. This fix addresses that problem and ensures that the @setDataFrame is only prepended for onMetaData and |RtmpSampleAccess. Since data is fed to the rtmp_write function in smaller pieces (depending on the calling IO buffer size), we can't generally assume that the whole packet (or even the whole command string) is available at once, therefore we can only check the command string once the full packet has been transferred to us for sending. Based on a patch by Jeffrey Wescott. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmppkt: Make pkt->data reallocableMartin Storsjö2014-11-28
| | | | | | | | We try to avoid mixing av_malloc with av_realloc, since av_malloc may be implemented with functions that can't (formally) be mixed with the functions used in av_realloc. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Simplify code for copying data into the output packetMartin Storsjö2014-11-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmpproto: Clarify a commentMartin Storsjö2014-11-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Revert "lavf: Don't try to update files atomically with renames on windows"Martin Storsjö2014-11-27
| | | | | | | | | This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c. After taking MoveFileEx into use, we can replace files with renames on windows as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Use MoveFileEx instead of rename/_wrename on windowsMartin Storsjö2014-11-27
| | | | | | | | | This allows getting the normal unix semantics, where a rename allows replacing an existing file. Based on a suggestion by Reimar Döffinger. Signed-off-by: Martin Storsjö <martin@martin.st>
* Share the utf8 to wchar conversion routine between lavf and lavuMartin Storsjö2014-11-27
| | | | | | | | This doesn't add any dependency on library internals, since this only is a static inline function that gets built into each of the calling functions - this is only to reduce the code duplication. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Expose the fragment index as an avoptionMartin Storsjö2014-11-26
| | | | | | | | This allows setting the right fragment number if doing random-access writing of fragments, and also allows reading the current sequence number. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Add a flag for indicating a discontinuous fragmentMartin Storsjö2014-11-26
| | | | | | | | | | | | | | | | | | | | | | | This allows creating a later mp4 fragment without sequentially writing the earlier ones before (when called from a segmenter). Normally when writing a fragmented mp4 file sequentially, the first timestamps of a fragment are adjusted to match the end of the previous fragment, to make sure the timestamp is the same, even if it is calculated as the sum of previous fragment durations. (And for the first packet in a file, the offset of the first packet is written using an edit list.) When writing an individual mp4 fragment discontinuously like this (with potentially writing the earlier fragments separately later), there's a risk of getting a gap in the timeline if the duration field of the last packet in the previous fragment doesn't match up with the start time of the next fragment. Using this requires setting -avoid_negative_ts make_non_negative (or -avoid_negative_ts 0). Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlinkMartin Storsjö2014-11-24
| | | | | | | | | | | | | | | | | | This makes sure that the internal utf8 path names are handled properly - the normal file handling functions assume path names are in the native codepage, which isn't utf8. This assumes that the tools outside of lavf don't use the mkdir definition. (The tools don't do the same reading of command line parameters as wchar either - they probably won't handle all possible unicode file parameters properly, but at least work more predictably if no utf8/wchar conversion is involved.) This is moved further down in os_support.h, since windows.h shouldn't be included before winsock2.h, while io.h needs to be included before the manual defines for lseek functions. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Don't try to update files atomically with renames on windowsMartin Storsjö2014-11-24
| | | | | | | | | On windows, rename(2) will fail if the target file exists. On unix this trick is used to make sure that people reading the file either will get the full previous file, or the full new version of the file, but no intermediate version. Signed-off-by: Martin Storsjö <martin@martin.st>