[FFmpeg-user] Remux to matroska an h264 track without timestamps

Gabriele Greco gabriele.greco at wyscout.com
Wed Aug 22 13:59:14 EEST 2018


I have some input TS with H264 payload that do not have timestamps
correctly set in the video streams (or at least ffmpeg complains about it),
this cause no problem if I extract the video track as ts:

ffmpeg -i input.ts -c copy -an test.ts

completes with the warning:
[mpegts @ 0x7f87d2021a00] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code to
set the timestamps properly

... but the previous warning became an error if I try to remux it in
matroska:

ffmpeg -i input.ts -c copy -an test.mkv

[matroska @ 0x7ff323897e00] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code to
set the timestamps properly
[matroska @ 0x7ff323897e00] Can't write packet with unknown timestamp

I tried to force ffmpeg to generate pts for this file:

ffmpeg -fflags +genpts -i input.ts -c copy -an test.mkv

without any luck...

The only workaround I found at the moment is to do a double remux:

ffmpeg -i input.ts -c copy -an input.mp4
ffmpeg -i input.mp4 -c copy input.mkv

... but this is a big problem with large files (often we receive 20GB +
video files) and I cannot use mp4 as container for the video track since it
doesn't support a lot of video codecs...

Here is a link to a sample file (as small as I could make it, but it's
still 8MB):

https://www.dropbox.com/s/1o75ibqdz6fi9ul/test.ts?dl=0

-- 
*Bye,*
* Gabry*

-- 


Le informazioni contenute nella presente comunicazione e i relativi 
allegati possono essere riservate e sono, comunque, destinate 
esclusivamente alle persone o alla Società sopraindicati e non sono da 
considerarsi comunicazioni personali, quindi eventuali risposte potranno 
essere conosciute da persone appartenenti all’azienda. La diffusione, 
distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi 
soggetto diverso dal destinatario è proibita ai sensi dell’art. 616 c.p. I 
dati forniti verranno trattati ai sensi dell'art. 13 del Regolamento UE 
2016/679 (normativa sulla privacy). Se ha ricevuto questo messaggio per 
errore Ti preghiamo di distruggerlo e di informarci immediatamente 
contattandoci mandando una mail a privacy at wyscout.com 
<mailto:privacy at wyscout.com>. Copia integrale dell’informativa potrà essere 
visionata presso le nostre sedi. 

Any information herein included (even 
any attachments) shall be considered confidential and/or privileged 
material and meant to be only for the abovementioned persons and/or 
Company, therefore such communication is intended to be for the addressee 
only. Such information is not personal, that is why this e-mail and any 
replies may be known exclusively by people belonging to the company. It is 
expressively not allowed communicate, disclose and/or copy any 
documentation transmitted by a person other than the recipient, according 
to the Italian Criminal Code, Section 616 and the Regulation EU 2016/679. 
Your provided data are processed in accordance with Regulation EU 2016/679 
(Data Protection Law), Section 13. A full copy of the relevant information 
notice is available at the company’s registered office upon request. If you 
received this in error, please destroy it and inform us immediately by 
sending an e-mail to the following e-mail address privacy at wyscout.com 
<mailto:privacy at wyscout.com>. A full copy of the relevant information 
notice is available at the company’s registered office upon request.


More information about the ffmpeg-user mailing list