Commit graph

738 commits

Author SHA1 Message Date
Edward Hervey
d7038b9bb0 qtdemux: Handle variant of vorbis in mp4
Comes from gpac apparently. The codec_data uses the same packing
mechanism as matroska.

https://bugzilla.gnome.org/show_bug.cgi?id=738244
2018-03-22 15:22:33 +01:00
Edward Hervey
60bc77cc35 qtdemux: Check sample count is valid in PIFF parsing
The value stored in cenc_aux_sample_count wasn't in sync with the
parsing code that followed which checks whether all entries are
valid and present.

Only write the actual sample count when we know for sure.

CID #1427087
2018-03-22 15:22:24 +01:00
Sebastian Dröge
850e678813 qtdemux: Fix seeking on streams with frame reordering
The samples table is sorted by DTS, not PTS. As such we can only get the
correct result when using a binary search on it, if we search for the
DTS.
Also if we only ever search for the frame, where the following frame is
the first one with a PTS after the search position, we will generally
stop searching too early if frames are reordered.

In forwards playback this is not really a problem (after the decoder
reordered the frames, clipping is happening), in reverse playback
it means that we can output one or more frames too few as we stop too
early and the decoder would never receive it.

https://bugzilla.gnome.org/show_bug.cgi?id=782118
2018-03-20 12:08:28 +02:00
Edward Hervey
192b447e0b qtdemux: Fix comment typo in previous commit 2018-02-09 11:26:56 +01:00
Edward Hervey
e16be12e37 qtdemux: More 'meta' atom parsing fixes
Turns out everybody is doing it their own way, so peek into the
meta atom itself to figure out which spec it is following
2018-02-09 11:22:38 +01:00
Sebastian Dröge
e7177059e9 qtmux: Add support for muxing svmi atom for stereoscopic video information
https://bugzilla.gnome.org/show_bug.cgi?id=793120
2018-02-09 11:05:02 +02:00
Edward Hervey
4fd8635983 qtdemux: Minor cleanup
Just move variables to the blocks where they are used.

That function is massive, could do with some splitting up for
readability :(
2018-02-09 09:00:46 +01:00
Edward Hervey
357d77cf55 qtdemux: Cope with difference between QTFF and ISO BMFF specs
The 'meta' atom is defined differently in QTFF and BMFF, so try
to guess which spec the current stream applies to by looking
at the major file type.
2018-02-09 09:00:46 +01:00
Edward Hervey
b415358c7e isomp4: Make 'hdlr' atom dump more flexible
The smallest possible is 24 (and not 25) bytes.

The last "name" field can according to QTFF specifications not be present
at all. The parser will handle this fine and so will the rest of
the qtdemux code.
2018-02-09 09:00:46 +01:00
Justin Kim
ad8a6cb639 qtmux: send stream warning when refusing video caps
If codec_data is changed, the stream is no longer valid.
Rather than keeping running when refusing new caps,
this patch send a warning  to the bus.

Also fix up splitmuxsink to ignore this warning while changing caps.

https://bugzilla.gnome.org/show_bug.cgi?id=790000
2018-02-01 10:12:46 +00:00
Edward Hervey
0c56a80333 isomp4: Add gmhd/gmin debugging
* gmhd is a container, mark it as such so we can see/dump
  what is contained within
* Add dumping for the Base Media Information atom (gmin)
2018-01-31 19:12:48 +01:00
Edward Hervey
0511c4c225 qtdemux_dump: Demote verbose logging to TRACE level 2018-01-31 11:38:35 +01:00
Edward Hervey
40be9f4f85 qtdemux: Re-enable full debug logging of stsz entries
No idea why it was disabled (was the case since 2007)
2018-01-31 11:23:07 +01:00
Seungha Yang
75241cfa6b qtdemux: Remove white space at end of line
https://bugzilla.gnome.org/show_bug.cgi?id=791483
2018-01-29 18:42:47 +00:00
Seungha Yang
1551759cec qtdemux: Apply qtdemux debug category to gstisoff
.. instead of the use of default debug category.
And, make new header to declare the debug category

https://bugzilla.gnome.org/show_bug.cgi?id=791483
2018-01-29 18:40:02 +00:00
Alicia Boya García
ac46d5c2a3 qtdemux: Add more prose to the comment of gst_qtdemux_find_sample()
https://bugzilla.gnome.org/show_bug.cgi?id=792910
2018-01-25 20:40:46 +00:00
Vivia Nikolaidou
379059b1c7 qtmux: Make sure timecode uses the same timescale as video
Don't blindly derive it from the frame rate, but try to get the per-pad
configured timescale first (if it exists)

https://bugzilla.gnome.org/show_bug.cgi?id=792680
2018-01-23 16:40:36 +02:00
Sebastian Dröge
c71cd08d0e qtmux: Allow configuring trak timescale per pad/trak
It generally makes not much sense to configure it for all pads/traks at
once as this value is usually different for each of them. As such, add a
new property on the pads in addition to the existing property on the
whole muxer.

https://bugzilla.gnome.org/show_bug.cgi?id=792649
2018-01-23 16:40:23 +02:00
Edward Hervey
6e21faffe7 qtdemux: Push a GAP event if there's a second *or more*
And not "more than a second"
2017-12-13 12:06:49 +01:00
Edward Hervey
2e45926a96 qtdemux: Don't push GAP event if first buffer is within 1s
If we saw empty segments, we previously unconditionally pushed a
GAP event downstream regardless of the duration of that empty
segment.

In order to avoid issues with initial negotiation of downstream elements
(which would negotiate to something before receiving any data due to
that initial GAP event), check if there's at least a second of difference
(like we do for other GAP-related checks in qtdemux) before
deciding to push a GAP event downstream.
2017-12-13 11:35:37 +01:00
Edward Hervey
5c341f0980 qtdemux: Don't set pared=True on underspecified audio/mpeg
This *really* needs to go through a parser to figure out what the
exact content type is.
2017-12-13 10:21:17 +01:00
Florian Zwoch
b4ca81591c qtdemux: fix debug log for 'hvcC' codec_data
https://bugzilla.gnome.org/show_bug.cgi?id=784749
2017-12-02 13:46:29 +00:00
Jan Schmidt
a260eb80fb qtmux: Always update reserved-duration-remaining
If a reserved-max-duration is set, we should always track
and update the reserved-duration-remaining estimate, even
if we're not sending periodic moov updates downstream for
full robust muxing.
2017-11-25 00:56:11 +11:00
Edward Hervey
22ab222dbc qtdemux: Run gst-indent 2017-11-23 08:00:58 +01:00
Edward Hervey
d08e155ec8 qtdemux: Check presence of bitrate tags
Check whether the tag was present before printing it out

CID #1418501
2017-11-23 07:57:44 +01:00
Jan Schmidt
3ba556a54d qtdemux: Use new GST_SEQNUM_INVALID constant 2017-11-18 02:33:01 +11:00
Jun Xie
7c8aeff262 qtdemux: reset reused QtDemuxStream while parsing a new 'trak'
if QtDemuxStream is reused, then we need to reset it.

https://bugzilla.gnome.org/show_bug.cgi?id=788759
2017-11-17 11:49:24 +02:00
Seungha Yang
8aa5c59b5f isomp4: Add official fourcc for VP8 codec
fourcc for VP8 codec is "vp08" defined by spec. To follow it,
add it to demux and change legacy VP8 fourcc "VP80" to "vp08" in mux.
Also, enable sync table in case of VP8 codec.
See also https://www.webmproject.org/vp9/mp4/

https://bugzilla.gnome.org/show_bug.cgi?id=790026
2017-11-13 10:08:14 -05:00
Seungha Yang
93f19b19d2 isomp4: Add support VP9 codec
Add fourcc for VP9 codec and support it by qtdemux and qtmux
See also https://www.webmproject.org/vp9/mp4/

https://bugzilla.gnome.org/show_bug.cgi?id=790026
2017-11-13 10:08:14 -05:00
Ashish Kumar
1aed3948a8 gst-plugins-good: atoms_recovery: Handled buffer mapping failure
https://bugzilla.gnome.org/show_bug.cgi?id=789413
2017-10-24 22:04:27 -07:00
Thiago Santos
923b83a48c atomsrecovery: read from mdat only what is on headers
It is possible that the mdat has more data than what was stored in the
headers file. If we put that to the output the file will have bogus data
at the end and some players will complain.

https://bugzilla.gnome.org/show_bug.cgi?id=784258
2017-10-24 21:33:25 -07:00
Thiago Santos
69605b6c61 isomp4: atomsrecovery: handle common and large atom headers
Do not assume all files are large files. Check and use the short or
extended atom size field only if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=784258
2017-10-24 21:33:25 -07:00
Sebastian Dröge
728a1629cf qtdemux: Fix compiler warning
qtdemux.c: In function ‘gst_qtdemux_configure_stream’:
qtdemux.c:7764:34: error: suggest parentheses around ‘&&’ within ‘||’ [-Werror=parentheses]
     if ((stream->n_samples == 1) && (stream->first_duration == 0)
         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-10-10 18:04:50 +03:00
Nael Ouedraogo
5874bafa4f qtdemux: fix assert when moof containing one sample
Avoid computing frame rate when a stream contain moof with only one
sample, to avoid an assert. The moof is considered as still picture.

The same is already done for one sample given in the moov.

https://bugzilla.gnome.org/show_bug.cgi?id=782217
2017-10-10 18:03:42 +03:00
Jan Schmidt
d191584531 qtmux: Allow MPEG layer 1/2, AC3 and Opus in qtmux
qtmux is supposed to be the muxer that allows all formats,
with others (mp4mux and friends) being profile-restricted.
2017-09-06 23:55:38 +10:00
Michael Olbrich
61429a78a8 qtdemux: allow larger files
For really long files such as contiguous recordings of a whole day, the
50MB limit is not sufficient.

https://bugzilla.gnome.org/show_bug.cgi?id=781458
2017-08-10 16:17:56 +03:00
Sebastian Dröge
7d89e73336 qtdemux: Fix offsets for reading lpcm specific fields
We were reading at the completely wrong positions, 16 bytes later in the
data.

Also add support for high-aligned samples.
2017-08-10 16:13:05 +03:00
Mark Nauwelaerts
7bd439efb5 qtdemux: preferably send open-ended segment rather than repeated segment events 2017-07-19 18:35:58 +02:00
Mark Nauwelaerts
854f85acb4 qtdemux: fix seeking in fragmented file without mfra random access info
... which no longer worked due to unconditionally clearing sample info and
ending up in inconsistent state.  Let's tread a bit more carefully and also
allow for the old seek handling that resorts to scanning if no mfra info
is available.
2017-07-19 18:35:49 +02:00
Sebastian Dröge
c0318f3d60 qtdemux: Fix parsing of RLE depth
Regression introduced by 86b427dc70

https://bugzilla.gnome.org/show_bug.cgi?id=784812
2017-07-13 12:47:27 +03:00
Mark Nauwelaerts
f9f1a03653 qtmux: robustify time tracking for sparse subtitle stream 2017-07-01 18:59:14 +02:00
Mark Nauwelaerts
d1d149ce82 qtmux: correctly track chunk size of subtitle stream
... thereby ensuring correct chunk offset tracking for all streams.
2017-07-01 18:59:07 +02:00
Mark Nauwelaerts
83987b5037 qtdemux: specify '_swr' atom as a container atom
... so it is parsed as an mp4 style metadata atom as written by muxer
2017-06-28 20:00:44 +02:00
Mark Nauwelaerts
dbcb99ac1d qtmux: initialize mdhd language code as undefined 2017-06-28 20:00:44 +02:00
Mark Nauwelaerts
949902f1e2 qtmux: correctly calculate overall first_ts to ensure stream sync
... by minding and compensating for the dts_adjustment that may have
been introduced in the PTS timeline.
2017-06-24 17:36:54 +02:00
Tim-Philipp Müller
3a0fe9c2f5 qtmux: add support for muxing PNG
Demuxer already supported it.
2017-06-15 23:31:24 +01:00
Sebastian Dröge
deb9c62cd9 qtmux: Un-merge the last two stsc entries after serializing
The last entry will most likely get new samples added to it in "robust"
muxing mode, changing the samples_per_chunk and thus making it wrong to
keep the last two entries merged. It will run into an assertion later
when adding a new sample to the chunk.

Thanks to gdiener@cardinalpeak.com for the analysis of the bug and
proposal for a solution.
2017-06-15 11:50:44 +03:00
Jimmy Ohn
55e0b18186 qtdemux: remove not needed code
remove not needed code about res variable.

https://bugzilla.gnome.org/show_bug.cgi?id=783422
2017-06-06 11:02:59 +02:00
Edward Hervey
4f713717de isomp4: Safely ignore [skip] atoms
Instead of warning about them
2017-05-18 18:12:15 +02:00
Nicolas Dufresne
b68d936ae0 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:41:19 -04:00