<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="markdown-here-wrapper" data-md-url="" style="">
<p style="margin: 0px 0px 1.2em !important;"> Hi,</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<div class="moz-cite-prefix">On 16/3/23 03:05, Michael Jones via
gstreamer-devel wrote:<br>
</div>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<blockquote type="cite"
cite="mid:CABfmKS+WZ0hmvEvjMqTozChBRfkHeGb1CDwuLf2SXUrnp7+TeA@mail.gmail.com">
<pre class="moz-quote-pre" wrap="">On Sun, Mar 12, 2023 at 2:52 PM Michael Jones <a class="moz-txt-link-rfc2396E" href="mailto:jonesmz@jonesmz.com"><jonesmz@jonesmz.com></a> wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Question also posted on stackoverflow:
<a class="moz-txt-link-freetext" href="https://stackoverflow.com/questions/75714501/use-gstreamer-to-remux-a-single-title-out-of-a-dvd-without-re-encoding">https://stackoverflow.com/questions/75714501/use-gstreamer-to-remux-a-single-title-out-of-a-dvd-without-re-encoding</a>
I am trying to re-mux the video of a specific title out of a DVD into
a video file, without decoding then re-encoding the video.
[snip]
So what am I missing from my pipeline that prevents the buffers read
from the DVD from having a valid timestamp when they get to the
matroskamux ?</pre>
</blockquote>
</blockquote>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">This is a guess, but
one difference between MPEG-TS and matroska is that MPEG-TS only
requires that you place a PTS/DTS on buffers at least every
700ms, so timestamps may be sparse. It’s then up to the decoder
to reconstruct the full timestamp sequence as it processes and
outputs frames, interpolating missing ones. Matroska needs
continuous timestamps, hence the complaint when they are
missing.</p>
<p style="margin: 0px 0px 1.2em !important;">In GStreamer 1.22
there is a new element <code style="font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; font-weight: 550; background-color: rgba(119, 119, 119, 0.3); border-radius: 3px; display: inline;">h264timestamper</code>
that can interpolate missing DTS from the PTS information -
useful for the case where you only have PTS. It could possibly
be enhanced to also fill in missing PTS.</p>
<ul style="margin: 1.2em 0px;padding-left: 2em;">
<li style="margin: 0.5em 0px;">Jan</li>
</ul>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<blockquote type="cite"
cite="mid:CABfmKS+WZ0hmvEvjMqTozChBRfkHeGb1CDwuLf2SXUrnp7+TeA@mail.gmail.com">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
My best guess is that I need to insert something between
mpegvideoparse and the matroskmamux, but I don't know what it would
be.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
This appears to be a bug in the matroskamux.
This pipeline
GST_DEBUG=2 \
gst-launch-1.0 -v -e \
dvdreadsrc title=${TITLE} device=${DVD} \
! mpegpsdemux name=demux \
\
tee name=vtee \
tee name=atee \
demux. ! mpegvideoparse ! vtee. \
demux. ! ac3parse ! atee. \
\
multiqueue name=convqueue \
vtee. ! convqueue. \
atee. ! convqueue. \
\
mpegtsmux name=mux \
convqueue. ! mux. \
convqueue. ! mux. \
\
mux. ! filesink location=~/test.mkv
produces a video file with smooth audio and video playback
This pipeline
GST_DEBUG=2 \
gst-launch-1.0 -v -e \
dvdreadsrc title=${TITLE} device=${DVD} \
! mpegpsdemux \
! mpegvideoparse \
! mpegtsmux \
! tsdemux \
! mpegvideoparse \
! matroskamux \
! filesink location=~/test.mkv
Produces a video file (sans audio, of course) that has jittery but not
"slide show" video.
Notably, the first pipeline has no warnings but the second has warnings like
matroskamux matroska-mux.c:4035:gst_matroska_mux_write_data:<matroskamux0:video_0>
Invalid buffer timestamp; dropping buffer
Though only about a 100th of the number of them that i get when
converting directly to matroskamux.
What's wrong with the matroskamux that it can't handle video that the
mpegtsmux can?
Trying mpegpsmux instead of mpegtsmux in the first pipeline gives me
smooth playback, but no audio, and thousands of these warnings
mpegpsmux mpegpsmux.c:421:mpegpsmux_queue_buffer_for_stream:<mux:pad0>
got DTS without PTS
So there appears to be a problem with the timestamps of my video file,
as i originally thought, but instead of matroskamux or mpegpsmux
gracefully handling this problem, they spews warnings that don't tell
me what to do about it.
This lack of graceful handling or helpful diagnostics would be a bug
in matroskamux and mpegpsmux.
</pre>
</blockquote>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div
title="MDH:PHA+Jm5ic3A7SGksPGJyPjwvcD48ZGl2IGNsYXNzPSJtb3otY2l0ZS1wcmVmaXgiPk9uIDE2LzMvMjMgMDM6MDUsIE1pY2hhZWwgSm9uZXMgdmlhIGdzdHJlYW1lci1kZXZlbCB3cm90ZTo8YnI+PC9k
aXY+PGJsb2NrcXVvdGUgdHlwZT0iY2l0ZSIgY2l0ZT0ibWlkOkNBQmZtS1MrV1owaG12RXZqTXFU
b3pDaEJSZmtIZUdiMUNEd3VMZjJTWFVybnA3K1RlQUBtYWlsLmdtYWlsLmNvbSI+PHByZSBjbGFz
cz0ibW96LXF1b3RlLXByZSIgd3JhcD0iIj5PbiBTdW4sIE1hciAxMiwgMjAyMyBhdCAyOjUy4oCv
UE0gTWljaGFlbCBKb25lcyAmbHQ7am9uZXNtekBqb25lc216LmNvbSZndDsgd3JvdGU6CjwvcHJl
PjxibG9ja3F1b3RlIHR5cGU9ImNpdGUiPjxwcmUgY2xhc3M9Im1vei1xdW90ZS1wcmUiIHdyYXA9
IiI+ClF1ZXN0aW9uIGFsc28gcG9zdGVkIG9uIHN0YWNrb3ZlcmZsb3c6Cmh0dHBzOi8vc3RhY2tv
dmVyZmxvdy5jb20vcXVlc3Rpb25zLzc1NzE0NTAxL3VzZS1nc3RyZWFtZXItdG8tcmVtdXgtYS1z
aW5nbGUtdGl0bGUtb3V0LW9mLWEtZHZkLXdpdGhvdXQtcmUtZW5jb2RpbmcKCkkgYW0gdHJ5aW5n
IHRvIHJlLW11eCB0aGU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Ag
IHRlZSBuYW1lPXZ0ZWUgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICB0ZWUgbmFtZT1h
dGVlICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgIGRlbXV4LiAhIG1wZWd2aWRl
b3BhcnNlICEgdnRlZS4gICAgIFwKICAgICAgICBkZW11eC4gISBhYzNwYXJzZSAgICAhIGF0ZWUu
ICAgICBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAg
bXVsdGlxdWV1ZSBuYW1lPWNvbnZxdWV1ZSAgICAgICAgICAgICAgIFwKICAgICAgICB2dGVlLiAh
IGNvbnZxdWV1ZS4gICAgICAgICAgICAgICAgICBcCiAgICAgICAgYXRlZS4gISBjb252cXVldWUu
ICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIFwKICAgIG1wZWd0c211eCBuYW1lPW11eCAgICAgICAgICAgICAgICAgIFwKICAgICAg
ICBjb252cXVldWUuICEgbXV4LiAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgY29udnF1ZXVl
LiAhIG11eC4gICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIFwKICAgIG11eC4gISBmaWxlc2luayBsb2NhdGlvbj1+L3Rlc3QubWt2
CgoKCnByb2R1Y2VzIGEgdmlkZW8gZmlsZSB3aXRoIHNtb290aCBhdWRpbyBhbmQgdmlkZW8gcGxh
eWJhY2sKCgpUaGlzIHBpcGVsaW5lCgpHU1RfREVCVUc9MiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgXApnc3QtbGF1bmNoLTEuMCAtdiAtZSAgICAgICAgICAgICAgICAgICAgICAgXAog
ICBkdmRyZWFkc3JjIHRpdGxlPSR7VElUTEV9IGRldmljZT0ke0RWRH0gXAogICAgICAgISBtcGVn
cHNkZW11eCAgICAgICAgICAgICA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ZSBnaXZlcyBtZQpz
bW9vdGggcGxheWJhY2ssIGJ1dCBubyBhdWRpbywgYW5kIHRob3VzYW5kcyBvZiB0aGVzZSB3YXJu
aW5ncwptcGVncHNtdXggbXBlZ3BzbXV4LmM6NDIxOm1wZWdwc211eF9xdWV1ZV9idWZmZXJfZm9y
X3N0cmVhbTombHQ7bXV4OnBhZDAmZ3Q7CmdvdCBEVFMgd2l0aG91dCBQVFMKClNvIHRoZXJlIGFw
cGVhcnMgdG8gYmUgYSBwcm9ibGVtIHdpdGggdGhlIHRpbWVzdGFtcHMgb2YgbXkgdmlkZW8gZmls
ZSwKYXMgaSBvcmlnaW5hbGx5IHRob3VnaHQsIGJ1dCBpbnN0ZWFkIG9mIG1hdHJvc2thbXV4IG9y
IG1wZWdwc211eApncmFjZWZ1bGx5IGhhbmRsaW5nIHRoaXMgcHJvYmxlbSwgdGhleSBzcGV3cyB3
YXJuaW5ncyB0aGF0IGRvbid0IHRlbGwKbWUgd2hhdCB0byBkbyBhYm91dCBpdC4KClRoaXMgbGFj
ayBvZiBncmFjZWZ1bCBoYW5kbGluZyBvciBoZWxwZnVsIGRpYWdub3N0aWNzIHdvdWxkIGJlIGEg
YnVnCmluIG1hdHJvc2thbXV4IGFuZCBtcGVncHNtdXguCjwvcHJlPjwvYmxvY2txdW90ZT4="
aria-hidden="true"
style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0;padding:0;margin:0;"></div>
</div>
</body>
</html>