Commit Graph

1067 Commits

Author SHA1 Message Date
Moritz Bunkus
ca67e757bb mkvmerge: use timestamps instead of timecodes in JSON identification
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-04 20:45:30 +02:00
Moritz Bunkus
67e2a0e3e6 extract: use timestamp in cue extraction
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-04 19:18:25 +02:00
Moritz Bunkus
9fcef391ad Dirac: re-render track headers after changing them 2017-10-04 18:35:41 +02:00
Moritz Bunkus
3a76340d0c VC-1: re-render track headers after changing them
Fixes #2113.
2017-10-04 18:35:41 +02:00
Moritz Bunkus
0f43bd5b05 mkvmerge, mkvextract: use timestamp in format line of timestamp files
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-04 18:35:41 +02:00
Moritz Bunkus
0d158357be mkvextract: accept timestamps_v2 in addition to timecodes_v2
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-04 14:53:09 +02:00
Moritz Bunkus
1f7f3ef02b mkvmerge: accept --timestamp* in addition to --timecode*
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-04 14:51:41 +02:00
Moritz Bunkus
ec0b8c627c all: replace timecode with timestamp in the code
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-10-03 23:26:41 +02:00
Moritz Bunkus
f3ea2937ad byte_buffer_c: move to namespace mtx::bytes 2017-10-03 11:26:03 +02:00
Moritz Bunkus
56adacc202 bit_reader_c, bit_writer_c: move to namespace mtx::bits 2017-10-03 10:41:52 +02:00
Moritz Bunkus
5b91030a8a at_scope_exit: move at_scope_exit_c class to namespace mtx 2017-10-03 10:23:17 +02:00
Moritz Bunkus
ed67f1000c AC-3: identify regular AC-3 and E-AC-3 tracks differently via their codec 2017-10-03 10:23:17 +02:00
Moritz Bunkus
e6f3c42796 Matroska reader: AC-3: let packetizer re-frame content
There are Matroska files where the AC-3 core and the corresponding
E-AC-3 extension are stored in two different blocks. That's against
the specs, so mkvmerge has to fix it. Additionally only the first
block's timestamp should be used; otherwise mkvmerge will double the
total duration: in the source the core's and the extension's timestamp
are the same, but mkvmerge was assigning the core's block one
timestamp and the extension's block an incremented timestamp.
2017-10-01 23:34:04 +02:00
Moritz Bunkus
958af14d27 AAC ADTS parser: parse program_config_element in frame for channel detection
The `program_config_element` (PCE) in the frame is authoritative
regarding the number of channels encoded in the frame. The container
information might be wrong (e.g. the ADTS headers containing a channel
configuration of 0, which is invalid). Therefore parse the PCE if it's
located at the start of the frame and override the ADTS header
content.

Fixes #2107.
2017-10-01 20:20:54 +02:00
Moritz Bunkus
4bb8ad6f55 hevcc_c: fix reserved bits in lists & number of sub-layers 2017-09-26 22:04:31 +02:00
Moritz Bunkus
2e238ed122 configure: require libMatroska v1.4.8
That version fixes writing block groups and simple blocks for tracks
with track number 128 (see #2103).

Also adds a test case for writing 130 tracks.
2017-09-25 20:27:25 +02:00
Moritz Bunkus
6d21a24a42 Opus output: give frames with discard padding their own BlockGroup
Fixes #2100.
2017-09-24 23:06:03 +02:00
Moritz Bunkus
46832b5f30 tests: intentional update due to a2887a3ab 2017-09-16 18:21:38 +02:00
Moritz Bunkus
12720e2eec Matroska reader: don't write "white colour coordinate x" to "…coordinate y" 2017-09-16 11:45:27 +02:00
Moritz Bunkus
08f6adfb63 MP4 reader: add support for Vorbis
Implements #2093.
2017-09-10 18:01:18 +02:00
Moritz Bunkus
06bebb1613 AVC ES: only mark frames with nal_ref_idc==0 as "discardable" in SimpleBlocks
Fixes #2047.
2017-08-30 21:00:16 +02:00
Moritz Bunkus
c61a8a1e74 Matroska reader: keep SimpleBlock's "key" and "discardable" flags as they are
Partial fix for #2047.
2017-08-30 20:18:04 +02:00
Moritz Bunkus
01a6380760 AVC: fix reference calculation for P and B frames 2017-08-30 19:33:46 +02:00
Moritz Bunkus
52d51e78a8 mkvmerge: don't write MinCache, MaxCache 2017-08-23 09:50:33 +02:00
Moritz Bunkus
394a38acec DTS packetizer: take stream position of provided timestamps into account
Some source files only provide one timestamp every `n` DTS frames. In
such situations the next provided timestamp might arrive before all of
the data for the previous DTS frame has been flushed (due to the DTS
parser buffering data in order to determine whether or not a dependent
frame is following). The result is a single gap of one frame after frame
number `n - 1`.

Fixes #2071.
2017-08-13 17:52:05 +02:00
Moritz Bunkus
bb896d49e3 tests: add case for mkvinfo null pointer dereference bug #2072. 2017-08-13 10:40:23 +02:00
Moritz Bunkus
a7bccabdd1 merge: add support for "video projection" track header attributes
Part of the implementation of #2064.
2017-08-13 09:52:37 +02:00
Moritz Bunkus
a0889bb88c all: don't add missing mandatory Matroska elements with known default values
This change requires the upcoming libEBML release v1.3.5 as earlier
versions will complain about missing mandatory elements even if said
mandatory elements have default values in the specifications.
2017-08-12 10:59:11 +02:00
Moritz Bunkus
932fc8f8bd tests: mark certain commands as not to produce a hash result
This is used by the controller to determine which commands to prefix
with (*) markers in case of test failure.
2017-08-12 10:51:33 +02:00
Moritz Bunkus
9282f65953 tests: don't record ebml_validator calls in old test classes 2017-08-12 10:51:33 +02:00
Moritz Bunkus
97747396d8 propedit: change colour-matrix property to colour-matrix-coefficients
That's more in line with the specs, and it's clearer for the user what
this is actually about. See #2038.
2017-08-05 16:09:34 +02:00
Moritz Bunkus
07ed6bd656 propedit: add support for video colour attributes
This implements one half of #2038.

Note that this commit breaks the GUI's header editor until support for
editing sub-sub-sub-masters will be added to it (soon).
2017-08-03 21:06:55 +02:00
Moritz Bunkus
95092247aa mkvmerge: identify track's "encoding" if known and fixed
This is preparation for making the GUI present the encoding detected
by e.g. a byte order mark to the user so that she doesn't have to (and
cannot) chose a subtitle character set herself. Implements mkvmerge's
part of #2053.
2017-07-23 09:22:31 +02:00
Moritz Bunkus
4037f1aa0d translations: integrate Romanian translation 2017-07-22 16:00:11 +02:00
Moritz Bunkus
8e270adcef WAV reader: implement Wave64 support
Implements #2042.
2017-07-21 22:17:04 +02:00
Moritz Bunkus
3b2ff9b6ae memory_c: add comparison operators with strings constants 2017-07-21 17:16:18 +02:00
Moritz Bunkus
7fb3003919 AAC: store GA specific config & handle 960 samples/frame
Implements #2031.
2017-07-20 21:57:53 +02:00
Moritz Bunkus
9baa010848 bit_writer_c: let writer manage memory on its own 2017-07-19 23:07:27 +02:00
Moritz Bunkus
319c8009e0 bit_writer_c: tests, eof(), get_remaining_bits() 2017-07-19 16:45:27 +02:00
Moritz Bunkus
f01afa73fb bit_cursor.h: split into bit_reader.h and bit_writer.h 2017-07-19 15:49:06 +02:00
Moritz Bunkus
b6276208b0 AAC: refactor packetizer to take audio_config_t
Also refactors SBR detection & handling. There were cases in which
reading AAC from MPEG TS resulted in 2-byte `CodecPrivate` with no
`OutputSamplingFrequency` set, even though the sampling frequency was
24.000 Hz and therefore an indicator for SBR.
2017-07-16 17:26:44 +02:00
Moritz Bunkus
541348d7da MPEG-1/-2: remove feature "remove stuffing bytes"
The feature was implemented by removing all 0 bytes in before the next
start code (and all 0 bytes at the end of the buffer). The problem is
that a slice structure may very well end in 0 bytes. The only way to
determine the end of the slice structure with confidence is
implementing a parser for the whole slice structure.

The result of removing bytes belonging to the slice structure may or
may not end in visual artifacts upon decoding. Other results include
error message by the decoder (e.g. ffmpeg which reports errors such as
"slice mismatch" or "motion vectors not available").

I lack the time and motivation to implement a proper slice parser. As
the current behavior is dangerous and just plain wrong, I'm removing
the feature again. It was introduced in release 5.8.0 response to
issue #734, which will now remain not implemented.

Fixes #2045.
2017-07-15 21:37:04 +02:00
Moritz Bunkus
4047a54a35 all: rename parse_timecode functions to parse_timestamp
Part of an ongoing effort to replace the use of the term `timecode`
with `timestamp`. Timecodes have a very specific meaning in the
audio/video world, and it's not what MKVToolNix has been using the
term for.
2017-07-14 11:44:40 +02:00
Moritz Bunkus
5e6d91ccc3 XML: replace XML declaration's encoding attribute with UTF-8
Old pugixml versions didn't recode to UTF-8 themselves. Therefore
mkvmerge contains code to determine the encoding from the XML
declaration's `encoding` attribute and recoding the content to UTF-8
before passing it to pugixml. The old `encoding` attribute was left
untouched.

Newer pugixml versions do recode to UTF-8. In order to prevent
that (and therefore recoding twice), the XML declaration's `encoding`
attribute must be set to `UTF-8`.
2017-07-09 21:38:55 +02:00
Moritz Bunkus
def48b2606 AVC/h.264 parser: flush queued frames on SPS/PPS changes
Whenever a sequence parameter set or picture parameter set
changes (meaning an SPS with the same ID as an earlier SPS but with
different content is found), all frames queued for order & timestamp
calculation must be flushed. Otherwise frame order calculation will be
based on wrong values for some frames and on correct values for other
frames.

Fixes #2028.
2017-07-04 21:18:33 +02:00
Moritz Bunkus
88464c2f72 tests: add case for c7422daa4d 2017-06-24 10:58:59 +02:00
Moritz Bunkus
867ea96d04 mkvmerge: calculate NUMBER_OF_BYTES before content encoding is applied
Fixes #2022.
2017-06-24 10:56:47 +02:00
Moritz Bunkus
bc010d4c62 MPEG PS: probe for more (E-)AC-3 data if detection fails
Other track types such as DTS will already fetch more PS packets from
the stream if detection fails on the first packet. The same logic is
now applied to (E-)AC-3 tracks: as long as the track parameters cannot
be determined and the probe range hasn't been exceeded, fetch more
data from the stream and retry detection.

This enables track detection even if the first PS packets contain too
little (E-)AC-3 data.

Fixes #2016.
2017-06-24 09:25:21 +02:00
Moritz Bunkus
0bf1e14100 identification: output stream_id & sub_stream_id as integers; drop ts_pid 2017-06-22 20:04:40 +02:00
Moritz Bunkus
7915e67086 MPEG PS: ignore garbage at start during file type detection
Fixes #2008.
2017-06-19 18:59:19 +02:00