1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-12 12:25:32 +02:00
Commit Graph

10251 Commits

Author SHA1 Message Date
Martin Storsjö
6f4364aba9 mov: Fix handling of zero-length metadata values
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>
2014-12-15 23:42:10 +02:00
Xiaohan Wang
490a3ebf36 matroskadec: Fix read-after-free in matroska_read_seek()
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
2014-12-15 15:46:34 +01:00
Martin Storsjö
e737a4aaaf dashenc: Change the duration fields to 64 bit
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>
2014-12-10 22:51:51 +02:00
Bryan Huh
fa8934d6d6 dashenc: log file output progress in verbose mode
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>
2014-12-10 00:03:16 +02:00
Martin Storsjö
95d880fa64 rtpproto: Fix the input RTP data format check
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>
2014-12-09 23:59:14 +02:00
Martin Storsjö
fccfc22d1f libavformat: Build hevc.o when building the RTP muxer
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>
2014-12-09 16:09:37 +02:00
Dave Rice
3c01039e0b mov: further expand the list of parsed metadata tags
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-08 14:28:16 +00:00
Vittorio Giovara
e2e07dbaab mov: expand the list of parsed metadata tags
Based on L-Smash code by Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>.
2014-12-08 14:28:09 +00:00
Vittorio Giovara
b704b648f9 mov: parse XMP metadata on demand
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>.
2014-12-08 13:53:30 +00:00
Vittorio Giovara
174c5fde90 mov: parse @PRM and @PRQ metadata tags
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>.
2014-12-08 13:53:20 +00:00
Vittorio Giovara
35384934d6 mov: cosmetics: reorder the list of tags
Alphabetically order the list by the tag to facilitate the insertion of
new ones.
2014-12-08 13:53:10 +00:00
Joakim Plate
90411b333d Allow reading of growing avi files (currently being written)
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>
2014-12-08 13:29:33 +00:00
Carl Eugen Hoyos
250e077ee9 riff: Support decoding png in avi (ImageJ) 2014-12-08 13:29:18 +00:00
Martin Storsjö
29bc7bfba2 rtpproto: Write a warning if the input data written isn't RTP packetized
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>
2014-12-08 11:59:12 +02:00
Luca Barbato
4fd7e63c87 mp3: Tweak the probe scores
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
2014-12-07 21:50:47 +01:00
Luca Barbato
4f5906a1d7 latm: Do not give a score for a single instance
Bug-Id: 773
CC: libav-stable@libav.org
2014-12-07 13:15:03 +01:00
Matthieu Bouron
8c0a865ad9 mov: skip version and flags attributes in mov_read_chan()
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>
2014-12-05 13:03:49 +00:00
Luca Barbato
1c77ead1fb rm: Use the correct codec_data_size signedness
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>
2014-12-04 13:14:28 +00:00
Luca Barbato
69c1fe7c9c mkv: Validate ASS Start and End fields
CC: libav-stable@libav.org
2014-12-03 13:08:41 +00:00
Florent Le Coz
2e0935965b Drop the unofficial extension prefix for MPEG and MPEG-TS formats
As per the RFCs:
http://tools.ietf.org/html/rfc3555#page-38
http://tools.ietf.org/html/rfc3003

CC: libav-stable@libav.org
2014-12-02 15:28:22 +00:00
Jean-Baptiste Mardelle
7319a47c7e mpegtsenc: recognize .mts as MPEG Transport Stream 2014-12-02 15:28:22 +00:00
Fredrik Axelsson
8f8caca224 Add support for BDAV/m2ts-mode muxing
Signed-off-by: Fredrik Axelsson <fraxbe@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 15:28:22 +00:00
Thilo Borgmann
3cec81f4d4 mov: allocate the tag value dynamically
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>
2014-12-02 15:28:22 +00:00
Vittorio Giovara
e352b29371 mov: Add an option for exporting all metadata 2014-12-02 15:28:22 +00:00
Vittorio Giovara
5639ed9abb mov: do not truncate the language-prefixed tag 2014-12-02 15:28:22 +00:00
Vittorio Giovara
604c9b1196 rtsp: move the CONFIG_ macros to the beginning of the check
With --disable-optimizations, the DCE of some compilers does not remove
such unused code, causing linking failure.
2014-12-02 15:28:22 +00:00
Martin Storsjö
491805636c rtmpproto: Fix a typo in a comment
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 20:56:45 +02:00
Martin Storsjö
fcae9f212a dashenc: Avoid a VLA-like construct
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>
2014-11-28 11:55:42 +02:00
Bryan Huh
a9d8d35e48 dashenc: Add options to make segment names configurable
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>
2014-11-28 10:48:15 +02:00
Martin Storsjö
01eac895ab rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess
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>
2014-11-28 09:59:29 +02:00
Martin Storsjö
44127b157e rtmppkt: Make pkt->data reallocable
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>
2014-11-28 09:59:28 +02:00
Martin Storsjö
3c3b8003a1 rtmpproto: Simplify code for copying data into the output packet
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:27 +02:00
Martin Storsjö
857e6667f9 rtmpproto: Clarify a comment
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:25 +02:00
Martin Storsjö
675ac56b7e Revert "lavf: Don't try to update files atomically with renames on windows"
This reverts commit b9d08c77a4.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-27 09:29:47 +02:00
Martin Storsjö
79fd186a50 lavf: Use MoveFileEx instead of rename/_wrename on windows
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>
2014-11-27 09:29:29 +02:00
Martin Storsjö
9326d64ed1 Share the utf8 to wchar conversion routine between lavf and lavu
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>
2014-11-27 09:29:17 +02:00
Martin Storsjö
234fb81e31 movenc: Expose the fragment index as an avoption
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>
2014-11-26 09:58:13 +02:00
Martin Storsjö
ee37620b6a movenc: Add a flag for indicating a discontinuous fragment
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>
2014-11-26 09:56:56 +02:00
Martin Storsjö
960aff379d lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink
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>
2014-11-24 23:36:29 +02:00
Martin Storsjö
b9d08c77a4 lavf: Don't try to update files atomically with renames on windows
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>
2014-11-24 23:34:44 +02:00
Uwe L. Korn
40665d27e3 flvdec: Document how the duration is retrieved at the end of the file
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 23:34:30 +02:00
Martin Storsjö
fe42f94ce1 dashenc: Don't segment all video streams when one stream gets a keyframe
This makes sure that segments actually start at a keyframe (and
makes sure we don't split segments twice in a row, with one segment
consisting of only a handful of packets), when one stream uses b-frames
while another one doesn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 11:09:40 +02:00
Vittorio Giovara
30b8eb0f87 sol: simplify sol_codec_id()
Bug-Id: CID 1238993
2014-11-24 01:30:15 +00:00
Vittorio Giovara
065923b078 mpegenc: prevent a NULL pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 29261
2014-11-24 01:30:14 +00:00
Martin Storsjö
f856d9c2f3 dashenc: Don't require the stream bitrate to be known
Don't write any bitrate attribute if it isn't known. As long as one
doesn't want automatic bitrate switching, playback can work just
fine even if it isn't set.

If strict standard compliance is requested, this is still considered
an error, since the attribute is mandatory according to the spec.

Based on a patch by Rodger Combs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-22 22:16:37 +02:00
Martin Storsjö
eec7f032a9 lavf: Remove a redundant include of sys/stat.h
The same file already includes this header a few lines further
above.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-22 22:11:44 +02:00
Michael Niedermayer
4b68edd08a flvenc: Remove an unused variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-22 22:10:52 +02:00
Luca Barbato
fd9badd3cb xwma: Do not leak on failure path
CC: libav-stable@libav.org
Bug-Id: CID 1087092
2014-11-21 12:27:07 +00:00
Martin Storsjö
7fd10f66b7 hdsenc: Clear the previous codec tag when setting up the chained muxer
The chained flv muxer wants one set of tags - normally this set
could be signaled via the AVOutputFormat codec_tag field (as
smoothstreamingenc and dashenc do). hdsenc doesn't signal it, since
the FLV codec tag arrays aren't exported from flvenc.c. This can
lead to the caller keeping an original codec tag from the originating
container here, which would then be a mismatch for the FLV muxer.
Since we don't really care about what codec tag the caller might
have set, just clear it and let the lavf muxer layer set the right
one for the chained FLV muxer later instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-19 13:37:00 +02:00
Martin Storsjö
f918b8a293 hdsenc: Use the right filename in an error message
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-19 13:36:43 +02:00
Vittorio Giovara
2007082d2d mov: check ff_get_wav_header() return value
CC: libav-stable@libav.org
Bug-Id: CID 717497
2014-11-18 00:40:06 +01:00
Vittorio Giovara
a28468d0da librtmp: append the correct field to the string
Also prevent a NULL pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1250329 / CID 1250331
2014-11-18 00:38:26 +01:00
Martin Storsjö
9257692ac1 lavf: Only initialize s->offset once when using avoid_negative_ts make_zero
When given a stream starting at dts=0, it would previously consider
s->offset as uninitialized and set an offset when the second packet
was written, ending up writing two packets with dts=0. By initializing
this field to AV_NOPTS_VALUE, we make sure that we only initialize it
once, on the first packet.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 23:18:55 +02:00
Martin Storsjö
c302d034ba tools: Add a sidxindex tool
This tool can write an MPD file for fragmented MP4 files with
a sidx index at the start of the file.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:17:07 +02:00
Martin Storsjö
40ed1cbf14 movenc: Allow writing a DASH sidx atom at the start of files
This is mapped to the faststart flag (which in this case
perhaps should be called "shift and write index at the
start of the file"), which for fragmented files will
write a sidx index at the start.

When segmenting DASH into files, there's usually one sidx
at the start of each segment (although it's not clear to me
whether that actually is necessary). When storing all of it
in one file, the MPD doesn't necessarily need to describe
the individual segments, but the offsets of the fragments can be
fetched from one large sidx atom at the start of the file. This
allows creating files for the DASH ISO BMFF on-demand profile.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:17:07 +02:00
Martin Storsjö
3847f3ab58 movenc: Add tfra entries for all tracks in a moof
Previously only tfra entries were added for the first track in each moof.

The frag_info array used for tfra can also be used for writing
other kinds of fragment indexes, where it's more important to
include all tracks.

When the separate_moof option is enabled (as in ismv), we write
a separate moof for each track, so this doesn't make any difference
in that case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:17:07 +02:00
Martin Storsjö
fe5e6e34c0 lavf: Add an MPEG-DASH ISOFF segmenting muxer
This is mostly to serve as a reference example on how to segment
the output from the mp4 muxer, capable of writing the segment
list in four different ways:
- SegmentTemplate with SegmentTimeline
- SegmentTemplate with implicit segments
- SegmentList with individual files
- SegmentList with one single file per track, and byte ranges

The muxer is able to serve live content (with optional windowing)
or create a static segmented MPD.

In advanced cases, users will probably want to do the segmenting
in their own application code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:17:07 +02:00
Martin Storsjö
2ded57371a movenc: Add support for writing sidx atoms for DASH segments
A flag "dash" is added, which enables the necessary flags for
creating DASH compatible fragments.

When this is enabled, one sidx atom is written for each track
before every moof atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:16:46 +02:00
Martin Storsjö
2d9d6afb8d movenc: Factorize adding fragment info into a separate function
By calling this after writing the moof the first time (for
calculating the moof size), we can avoid intermediate storage
of tfrf_offset in MOVTrack.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:13:02 +02:00
Martin Storsjö
0f9eb9165b movenc: Include empty tracks in iods when writing fragmented mp4
When writing fragmented streams with an empty initial moov,
we won't have any samples in any tracks when writing the
moov atom, thus trust that any tracks that are added actually
will be present.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 16:12:02 +02:00
Andrew Stone
c64f361511 flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-17 09:28:16 +01:00
Andrew Stone
4d0cd5f58c flvenc: move metadata updates into a single function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-17 09:28:06 +01:00
Marvin Scholz
8562c1483b Icecast: Send content-type in all cases
This is needed because Icecast since version 2.4.1 doesn't default
to audio/mpeg anymore. AVOption default not used here, since a later
check if -content_type is set is performed and would break.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 09:15:39 +01:00
Marvin Scholz
3a6bb97350 Icecast: Send 100-continue header if possible
This allows for proper error reporting. Only do
this for non-legacy requests as only Icecast >2.4.0
will reply with a proper status.
Libav seems to accept both, 100 and 200 status codes, but
let's stay close to spec.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 09:14:04 +01:00
Vittorio Giovara
4b39cc1a09 riff: support ProRes in avi (APCN fourcc) 2014-11-14 20:24:38 +01:00
Martin Storsjö
9a5ac36b69 movenc: Require samples before trying to write edts
This avoids a potential crash if writing a fragmented psp mp4
(which probably is only a hypothetical scenario).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-08 11:14:21 +02:00
Martin Storsjö
8cb7b7b461 movenc: Avoid leaking locally allocated data when returning on errors
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-08 11:14:08 +02:00
Martin Storsjö
95a449d3ce movenc: Remove an outdated comment
QuickTime does support files with an empty initial movie
these days.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-08 11:13:37 +02:00
Martin Storsjö
9cbf70fa0e movenc: Write correct presentation timestamps in tfra
Previously we wrote decoding timestamps here, while the specs
say it should be presentation timestamps.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 14:50:06 +02:00
Martin Storsjö
e7d20f12c5 movenc: Remove a now redundant check
When using the new first_trun flag instead of checking the track id,
we don't need to have a special case for the separate_moof flag
any longer.

This simplifies the complicated codepath ever so slightly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 13:46:19 +02:00
Martin Storsjö
1d8a0c1b43 movenc: Allow to request not to use edit lists
In this case, shift tracks to start from zero instead (potentially
stretching the first sample in tracks that start later than the
first one).

Some software does not support edit lists at all, the adobe flash
player seems to be one of these. This results in AV sync errors when
edit lists are used to adjust AV sync.

Some players, such as QuickTime, don't respect the duration for
audio packets, so if an audio track starts later than the video
track and the first audio sample gets a duration longer than the
actual amount of data in it, the result will be out of sync.

Based on patches by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:46 +02:00
Michael Niedermayer
897d5c3a42 lavf: Print a warning if failed to avoid negative timestamps when requested
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:46 +02:00
Michael Niedermayer
1384df6419 lavf: Add an option for avoiding negative timestamps
This is the same logic as is invoked on AVFMT_TS_NEGATIVE,
but which can be enabled manually, or can be enabled
in muxers which only need it in certain conditions.

Also allow using the same mechanism to force streams to start
at 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:35 +02:00
Anton Khirnov
05e59135b3 nutdec: do not set has_b_frames
It is not supposed to be set by demuxers.
2014-11-06 09:05:37 +01:00
Anton Khirnov
e839de0f85 oggenc: accept only STREAMINFO extradata
The reasoning is the same as for
0097cbea69.
2014-11-06 09:04:32 +01:00
Anton Khirnov
7784f47762 lavf: stop using avpriv_flac_parse_streaminfo()
The only parameters needed by the demuxers are the sample rate and sample
count, which can be trivially extracted manually, without resorting to
an avpriv function.
2014-11-06 09:02:25 +01:00
Anton Khirnov
56dc46a189 riffenc: do not fall back on AVCodecContext.frame_size for MP3
It will not be set unless the codec context is used as the encoding
context, which is discouraged. For MP2, av_get_audio_frame_duration()
will already set the frame size properly. For MP3, set the frame size
explicitly.
2014-11-06 09:02:08 +01:00
Anton Khirnov
91e8d2eb1f lavf: use the format context strict_std_compliance instead of the codec one 2014-11-06 09:01:49 +01:00
Anton Khirnov
2f3fadfbe3 lavc,lavf: switch to the new vorbis parse API 2014-11-06 09:00:46 +01:00
Anton Khirnov
5e80fb7ff2 lavc: add a public API for parsing vorbis packets.
It is required by (at least) the ogg demuxer.

Mark the current semi-public apriv API for removal.
2014-11-06 08:51:25 +01:00
Anton Khirnov
6896f95b24 vorbis_parser: add an AV prefix to VorbisParseContext
This is done in preparation for making it public.
2014-11-06 08:47:54 +01:00
Martin Storsjö
a490391157 rtmpproto: Ignore errors from the getStreamLength method
It is never an error if this method failed. If rt->live was
explicitly set to 0 (known to be a recorded file), print it
as a warning, otherwise print it as a debug message.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-05 09:18:22 +02:00
Martin Storsjö
2f221b6a93 movenc: Define the flag bits using shifts instead of as decimal numbers
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-03 11:43:58 +02:00
Martin Storsjö
aae6b3b918 movenc: Don't write any iso brands in ismv files
We deviate slightly from the iso specs for these files.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-30 23:17:00 +02:00
Martin Storsjö
c55d1d382c movenc: Don't write any tfdt atom for ismv files
The tfdt atom shouldn't be needed in those cases, we already
write tfxd atoms for ismv anyway, which is roughly equivalent.

This avoids having to declare the iso6 brand for ismv files.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-30 23:16:56 +02:00
Martin Storsjö
00c67fe1d0 movenc: Write a 0 duration in mdhd and tkhd for an empty initial moov
ISO/IEC 14496-12:2012/Cor 1:2013 is explicit about how this should be
handled. All zeros doesn't mean that the full file has got a zero
duration, only that the track samples described within the initial moov
have got zero duration. An all ones duration means an indeterminate
duration.

Keep writing a duration consisting of all ones for the ISM mode -
older windows media player versions won't play a file if this is
zero. (Newer windows media player versions play either version fine.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-30 23:16:50 +02:00
Martin Storsjö
cf589faa5b movenc: Add a flag for using default-base-is-moof in tfhd atoms
Similarly to the omit_tfhd_offset flag added in e7bf085b, this
avoids writing absolute byte positions to the file, making them
more easily streamable.

This is a new feature from 14496-12:2012, so application support
isn't necessarily too widespread yet (support for it in libav was
added in 20f95f21f in July 2014).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:04:04 +02:00
Martin Storsjö
600d5ee6b1 movenc: Signal iso6 in compatible_brands when using tfdt
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:03:52 +02:00
Martin Storsjö
1e0b81abe8 movenc: Use a local variable consistently
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:03:45 +02:00
Martin Storsjö
b2b79eca6f movenc: Don't check the custom IO flag when using faststart
The custom IO flag actually never is set for muxers, only for
demuxers, so the check was pointless (unless a user intentionally
would set the flag to signal using custom IO).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:02:02 +02:00
Martin Storsjö
573b1de2d7 movenc: Don't use track_id to decide which track is the first in a moof
If one track doesn't have any samples within a moof, no traf/trun
is written for it. When the omit_tfhd_offset flag is set, none
of the tfhd atoms have any base_data_offset set, and the implicit
offset (end of previous track fragment data, or start of the moof
for the first trun) is used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:01:27 +02:00
Vittorio Giovara
84bf64d359 bethsoftvid: simplify return handling
Fixes a double free in case of av_packet_new_side_data() failure.
2014-10-29 17:02:27 +00:00
Vittorio Giovara
e9ba309831 assdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 703626
2014-10-29 16:54:43 +00:00
Vittorio Giovara
f64d7e919e mtv: improve header check and avoid division by zero
CC: libav-stable@libav.org
Bug-Id: CID 732203 / CID 732204
2014-10-29 16:54:43 +00:00
Michael Niedermayer
b3d11437ca oggenc: remove unneeded null check
The code would have segfaulted before if oggstream were NULL.

CC: libav-stable@libav.org
Bug-Id: CID 732218
2014-10-29 16:54:37 +00:00
Tomas Härdin
11467ecf51 mxfdec: reduce loop bound in mxf_read_pixel_layout()
Makes coverity less confused and code more readable.

Bug-Id: CID 732262
2014-10-27 19:08:02 +00:00
Vittorio Giovara
e6c66f1e4e bethsoftvid: check return value and clean memory
CC: libav-stable@libav.org
Bug-Id: CID 733777
2014-10-27 18:21:40 +00:00
Vittorio Giovara
b46b233baf filmstripdec: avoid integer overflow
CC: libav-stable@libav.org
Bug-Id: CID 732246
2014-10-27 18:21:40 +00:00
Vittorio Giovara
090c67d586 matroskaenc: write correct Display{Width, Height} in stereo encoding
should be the raw amount of pixels (for example 3840x1080 for full HD side by
side) and the DisplayWidth/Height in pixels should be the amount of pixels for
one plane (1920x1080 for that full HD stream)."

So, move the aspect ratio check in the mkv_write_stereo_mode() function
and always write the embl when stereo format and/or aspect ration is set.
Also add a few comments to that function.

CC: libav-stable@libav.org
Found-by: Asan Usipov <asan.usipov@gmail.com>
2014-10-27 18:21:35 +00:00
Martin Storsjö
ed6dad3737 lavf: Implement ff_brktimegm using gmtime_r
While a standalone implementation is nice, we already depend on
gmtime and gmtime_r in a number of places.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00