1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

1004 Commits

Author SHA1 Message Date
James Almer
5ff31babfc avformat/movenc: remove experimental check for VP9 streams
The muxer has been updated and is now complaint with the v1.0 of the spec.
2017-05-17 20:52:50 -03:00
Hendrik Leppkes
64ad44a381 movenc/isom: update vpcC box to version 1.0 of the specification
This brings our generation of the vpcC box up to date to version 1.0
of the VP Codec ISO Media File Format Binding.

Specifically, color/transfer properties are now written with values
based on ISO/IEC 23001-8, which is the same reference specification the
AVColor* enumerations are based on.
2017-05-16 01:53:05 +02:00
Lucas Cooper
77bc507f6f avformat/movenc: Explicitly address potential division by zero.
find_fps attempts to infer framerate from AVCodec's timebase. When this
results in a frame rate that isn't explicitly marked as supported in
av_timecode_check_frame_rate, find_fps returns the AVStream's
avg_frame_rate, which, per avformat.h, _may_ be set (or not).

mov_get_mpeg2_xdcam_codec_tag, mov_get_h264_codec_tag and
find_compressor attempt to call av_q2d on the return value of find_fps,
which in the above case, may result in division by zero and therefore,
an undefined frame rate when NaN is converted to int.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-29 03:54:31 +02:00
Matthew Gregan
b905ba5bc1 avformat/movenc: Fix potential leak of sgpd_entries array.
Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-12 23:12:06 +02:00
Michael Niedermayer
6268f2ca7b avformat/movenc: Fix mix of declaration and statement
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 23:38:38 +02:00
Matthew Gregan
0c4d208296 avformat/movenc: Add experimental muxing support for Opus in ISO BMFF (MP4).
Based on the draft spec at http://vfrmaniac.fushizen.eu/contents/opus_in_isobmff.html

'-strict -2' is required to create files in this format.

Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-11 21:28:44 +02:00
James Almer
d36a3f5a78 avformat/movenc: auto insert vp9_superframe bsf when needed
Experimental VP9 support was added to the muxer recently.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-10 10:26:44 -03:00
Clément Bœsch
549045254c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
Clément Bœsch
cd4d6cba12 lavf: fix usages of av_get_codec_tag_string() 2017-03-29 14:49:29 +02:00
James Almer
86dee47e39 avformat/movenc: allow st3d and sv3d mov atoms to be written in strict unofficial mode
They are unofficial extensions to the format for the time being, not
an experimental feature.
2017-03-27 18:54:42 -03:00
James Almer
a715e5a276 avformat/movenc: restrict st3d and sv3d mov atoms to MODE_MP4 2017-03-27 18:53:52 -03:00
Aaron Colwell
b4189590a5 movenc: Add support for writing st3d and sv3d boxes.
Signed-off-by: James Almer <jamrial@gmail.com>
2017-03-27 18:53:52 -03:00
wm4
ddef3d902f avformat, ffmpeg: deprecate old rotation API
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>
2017-03-27 13:20:27 +02:00
James Almer
4de591e6fb Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'
* commit '83548fe894cdb455cc127f754d09905b6d23c173':
  lavf: fix usage of AVIOContext.seekable

Merged-by: James Almer <jamrial@gmail.com>
2017-03-21 17:02:30 -03:00
Jan Ekström
763e823754 movenc: add support for track names in ISML manifests
This enables having multiple tracks of the same type which would
be treated as different things by the media server (as opposed to
different bit rate versions of the same track). According to the
smooth streaming specification, just setting the systemLanguage
tag is not enough to note that a track with the same attributes
differs from another one.

Reviewed-by: Martin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-12 20:18:32 +01:00
Carl Eugen Hoyos
74c576957a lavf/movenc: Remove two unused variables. 2017-02-10 12:40:43 +01:00
Matthew Gregan
156fbbb562 avformat/movenc: Restrict experimental VP9 support to MODE_MP4.
Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 16:07:14 -03:00
Matthew Gregan
7dc4200c38 Add experimental muxing support for FLAC in ISO BMFF (MP4).
Based on the draft spec at https://git.xiph.org/?p=flac.git;a=blob;f=doc/isoflac.txt

'-strict experimental' is required to create files in this format.

Signed-off-by: Matthew Gregan <kinetik@flim.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-11-21 15:36:42 -03:00
Michael Niedermayer
709c87109d avformat/movenc: Check frame rate before use.
Fixes division by 0
This is similar to how avg_frame_rate is checked elsewhere
Fixes: 6d24add0455f41b1b45b7ba615cd46f3/asan_generic_dc34c3_5480_0a2ef411cae999b9871ed71a2e481b71.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-17 19:03:41 +01:00
Hendrik Leppkes
4a485daa7f Merge commit '4f7723cb3b913c577842a5bb088c804ddacac8df'
* commit '4f7723cb3b913c577842a5bb088c804ddacac8df':
  movenc: Add an option for skipping writing the mfra/tfra/mfro trailer

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-17 14:54:51 +01:00
Hendrik Leppkes
8fad4b4e25 Merge commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05'
* commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05':
  movenc: Apply offsets on timestamps when peeking into interleaving queues

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-11-13 22:57:02 +01:00
Carl Eugen Hoyos
222f59afd1 lavf/movenc: Do not print an error when muxing gray8 rawvideo.
This was fixed in 9a27780821
2016-11-05 00:43:31 +01:00
Rodger Combs
42cb050a05
lavf/movenc+dashenc: add automatic bitstream filtering
This is disabled by default when the empty_moov flag is enabled
2016-10-24 03:53:23 -05:00
Rodger Combs
e83d5d7e58
lavf/movenc: add deinit function 2016-10-24 03:53:22 -05:00
Michael Niedermayer
18ad44d145 avformat/movenc: Skip duration check for discontinuous fragments
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-19 13:25:21 +02:00
Michael Niedermayer
ed2112fb36 avformat/movenc: Check frame rate in mov_write_uuidprof_tag()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:58:16 +02:00
Michael Niedermayer
21bffa93a6 avformat/movenc: Switch mov_write_uuidprof_tag() to avg_frame_rate
Using the stream timebase simply overflows
Fix integer overflow in psp framerate computation

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-10 00:58:16 +02:00
Anton Khirnov
83548fe894 lavf: fix usage of AVIOContext.seekable
It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
2016-09-30 16:54:33 +02:00
Carl Eugen Hoyos
e84eeca577 lavf/movenc: Put correct display aspect ratio in ARES atom. 2016-09-29 15:41:17 +02:00
Jan Ekström
cc725ebe48 movenc: Add support for writing language codes into ISML manifests
Streaming servers appear to ignore all other language metadata.

Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-09-29 10:32:03 +01:00
Jan Ekström
6c10f8fe76 movenc: use similar logic to DASH when writing bit rate to ISML
This way, in case of bit rate not being set, max_bitrate will be
used instead. This enables, for example, re-using max_bitrate
information from the input or doing transcoding with a rate
control mode that is not bit rate based.

Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-28 23:45:11 +02:00
Carl Eugen Hoyos
46aae84616 lavf/movenc: Allow to disable writing the timecode track.
Fixes ticket #5492.
2016-09-26 08:50:48 +02:00
Paul B Mahol
88d79dbd16 avformat/movenc: write pasp atom even if sar.num == sar.den
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-09-22 23:59:46 +02:00
Michael Niedermayer
51000b9945 avformat/movenc: Make the packet check more tolerant
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:44:13 +02:00
Michael Niedermayer
2834313933 avformat/movenc: Check packet in mov_write_single_packet() too
Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:43:56 +02:00
Michael Niedermayer
deabcd2c05 avformat/movenc: Factor check_pkt() out
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-16 11:43:47 +02:00
Michael Niedermayer
68f4c2163e avformat/movenc: Check first DTS similar to dts difference
Fixes assertion failure
Fixes: b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_7ffff6ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-10 00:50:36 +02:00
Erkki Seppälä
499e8b0952 avformat/movenc: added ability to use original stream ids as track ids instead of regenerating them
Sometimes it's useful to be able to define the exact track numbers in
the generated track, instead of always beginning at track id 1. Using
the option use_stream_ids_as_track_ids now copies the use stream ids
to track ids. Dynamically generated tracks (ie. tmcd) have their track
numbers defined as continuing from the highest numbered stream id.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
Signed-off-by: OZOPlayer <OZOPL@nokia.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-01 14:56:10 +02:00
Carl Eugen Hoyos
c1de1f0469 lavf/movenc: Add a missing assignment if memory allocation fails.
Fixes a warning:
libavformat/movenc.c:5947:17: warning: statement with no effect [-Wunused-value]
2016-08-24 07:38:19 +02:00
Michael Niedermayer
ca906e8190 avformat/movenc: Free extradata after successfull allocation of new instead of before
This avoids erroring out with extradata lost and extradata size mismatching

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-19 16:02:16 +02:00
Umair Khan
4f6f56114e avformat/movenc: allow rewriting extradata
Signed-off-by: Umair Khan <omerjerk@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-19 15:30:52 +02:00
James Almer
0c75bd8e3c avcodec/dnxhddata: move avpriv_dnxhd_parse_header_prefix to a header
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>
2016-07-25 12:19:39 -03:00
Mark Reid
e47981dab7 libavformat/movenc: add dnxhr compatibility for apple players
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-23 13:54:12 +02:00
Martin Storsjö
4f7723cb3b movenc: Add an option for skipping writing the mfra/tfra/mfro trailer
When writing a fragmented file, we by default write an index pointing
to all the fragments at the end of the file. This causes constantly
increasing memory usage during the muxing. For live streams, the
index might not be useful at all.

A similar fragment index is written (but at the start of the file) if
the global_sidx flag is set. If ism_lookahead is set, we need to keep
data about the last ism_lookahead+1 fragments.

If no fragment index is to be written, we don't need to store information
about all fragments, avoiding increasing the memory consumption
linearly with the muxing runtime.

This fixes out of memory situations with long live mp4 streams.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-07-08 14:11:15 +03:00
Martin Storsjö
785c25443b movenc: Apply offsets on timestamps when peeking into interleaving queues
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-06-28 14:16:06 +03:00
David Murmann
0296b4b8d8 avformat/movenc: add option to use keys/mdta atoms for metadata
Add -movflags use_metadata_tags to the mov muxer. This will cause
the muxer to write all metadata to the file in the keys and mtda
atoms.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-25 14:38:14 +02:00
Clément Bœsch
1e9b79b2db movenc: mark astronomical_body const string as static 2016-06-25 10:30:28 +02:00
Michael Niedermayer
46a60fe184 avformat: Fix ff_interleaved_peek()
Fixes assertion failures in movenc

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-25 03:04:55 +02:00
Clément Bœsch
2c45254a77 Merge commit 'b84f3a40034d28828c4ca639d012479a7eaace28'
* commit 'b84f3a40034d28828c4ca639d012479a7eaace28':
  movenc: Write 'loci' geotag metadata for 3gp and mp4

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-24 11:08:33 +02:00
Clément Bœsch
7a1785014b Merge commit 'f12a705ee570e16ca692c66b62821a2dbdf82566'
* commit 'f12a705ee570e16ca692c66b62821a2dbdf82566':
  movenc: Factorize a function for finding a metadata entry and the associated language

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-24 11:01:40 +02:00