Transcoding MPEG .ts results in slow playback speed
Hi everyone :)
I have a tricky source video:
It's an MPEG TS file, that regardless of what I try to transcode it to,
the resulting file has its duration doubled.
The resulting file plays back to slow (at only half the normal speed).
I've tried transcoding to FFV1, and Huffyuv: Same behavior - so I
presume it's the source.
The exact details of how the source was created are not known, but I'm
pretty sure it was done using some "regular" tool designed for home
video editing. No "AV-nerd" or expert involved.
Mediainfo says 25fps for the source, but when I transcode it to e.g.
FFV1, Mediainfo shows no value for framerate at all and says it's
variable framerate. Whereas VLC or ffprobe say it's 25fps... Seems odd.
If I rewrap to MKV in an extra step before, and then transcode (using
same command!), timing seems to be fine.
Any ideas what's happening here, and how to skip that extra rewrapping step?
Thank you very much in advance for any ideas/help :)
Re: Transcoding MPEG .ts results in slow playback speed
Hi Carl Eugen :)
On 25/01/2019 20:12, Carl Eugen Hoyos wrote:
> (Please do not compress compressed files and no, I don't think
> an md5 sum is necessary in this case, if it is necessary you can
> put it in your email)
You're absolutely right of course.
I usually don't compress compress files (no size gain), but I wanted to
provide a hashcode.
And since I usually leave the samples on my server "forever" I thought a
package might be convenient to keep it tidier (though tar would have
> How did you create this file?
> The file looks as if you used FFmpeg to cut instead of dd...
Not this time :D
We spoke about this last time, so I used dd:
$ dd if=ORIGINAL.ts of=short.ts bs=1k count=8100
> If this is the original file, it is most likely broken but I must say
> it could be interesting to find out what happened...
I'm also curious.
Unfortunately, this file was provided by some private individual to the
archive, so this part of the story is unknown.
But I'll try to find out, as I'm curious how files like these are
created with "regular" workflows :P
> (The file was created with FFmpeg.)
I saw that in the metadata, too:
And was surprised, because I'm pretty sure they created it using a GUI.
> You can "fix" it by forcing the input frame rate to "25" but this
> often has unintended side-effects (like desync), setpts should
> have the same effect but may be more difficult to tune.
Works with added "-r 25" before "-i":
$ ffmpeg-git -r 25 -i ORIGINAL.ts -c:v ffv1 -c:a copy out/test-fps25.avi
But how come it requires the 25fps information, when ffprobe, mediainfo
and VLC all say that the source already has 25fps set anyways?
I'm currently reading the docs  for setpts... :D