[FFmpeg-user] Problem with TS file

Moritz Barsnick barsnick at gmx.net
Tue Feb 11 13:57:11 EET 2020

On Tue, Feb 11, 2020 at 12:22:33 +0100, Gabriele Greco wrote:
> About the sample, it's a bit tricky, ffmpeg fails every operation on it
> (both muxing and encoding), also something as simple as:
> ffmpeg -i source.ts -c copy -to 30.0 out.ts
> ... so using the properties of ts files (not having an index) I cut with dd
> the first 25MB of the file.

That's the right way to do it, otherwise you would already be changing
the sample.

> That's enough for VLC to playback it correctly, and gave the very same
> errors when trying to encode/probe with the ff tools.

mpv also plays this fine.

You should have shown us the complete log from the erroneous *encoding*
process, because, apparently, that's where the issue occurs. ffmpeg has
no (or little) problem decoding this sample. The errors you are getting
are sometimes expected at the beginning of MPEG-TS samples.

And with a closer look at your ffprobe console output, we see this
relevant error:
> [mpegts @ 0x7ff544004a00] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size
> Consider increasing the value for the 'analyzeduration' and 'probesize' options

ffmpeg and ffprobe are unable to find the video dimensions, making it
impossible for most encoders to re-encode the stream.

If you try those options, such as:

$ ffmpeg -analyzeduration 2000000000 -probesize 25000000 -i sample-25mb.ts -c:v copy sample-25mb.mkv

it works, albeit only a bit better. This still doesn't solve your
issue, as you will see, there are still errors. An encoding by ffmpeg
should also be decoded cleanly by ffmpeg. (I can only tell that your
sample was muxed with ffmpeg though, perhaps not encoded.)

> 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.

We will have you arrested for sharing your information here! ;-)


More information about the ffmpeg-user mailing list