3

I have a lot of MPEG-TS video files (H.264 video with AC3 or MP3 in a .TS container) captured from a DVB-S capture card.

When I play these videos it's much slower to seek in the video (ie. skip 30 seconds, etc) than with other files.

I'm not sure if the problem is the H.264 encoding (reference frame count?) or the MPEG-TS container, or if the MPEG-TS file contains sync errors, etc.

Does anybody have a good workflow for converting and repairing these files?

2 Answers 2

3

The seek intervals depend on how often the Transport Stream sends synchronization information. This really depends on how it was created – the MPEG TS allows to individually set this interval and in your case, it's probably just missing. I'm not sure if it's easy enough to fix an existing TS file, so I'd rather convert the Transport Stream to a more user-oriented container like:

  • MKV
  • MP4
  • MOV

Note that AVI is not an option since its support for h.264 is … well, not good.


Your first option is to try and copy the raw audio and video bitstreams. With FFmpeg, this is as simple as:

ffmpeg -i input.ts -c:v copy -c:a libfaac out.mp4

You can install FFmpeg on Windows by downloading a build, in OS X through Homebrew with brew install ffmpeg, and on Linux by compiling from source.

If you want to reduce the size of the video, you can try to set a Constant Rate Factor (something like "constant quality") and re-encode it using x264, the most popular h.264 encoder:

ffmpeg -i input.ts -c:v libx264 -crf 24 -c:a libfaac out.mp4

Set CRF to anything between 19 and 25, or even more. The more, the worse the quality, but the smaller the file size.

0

You might look at VideoRedo (http://www.videoredo.com). I have used it to convert other types of streaming video. And it does list the .ts as an acceptable input.

2
  • Charging for something that gazillions of free tools can do? Hm.
    – slhck
    Commented Jun 18, 2012 at 20:13
  • @slhck - it's more than just a video converter. Its primary function is a frame-precise video editor. When I bought VideoRedo about 6 years ago, it was the least expensive MPEG2 editor (among the dozen that I surveyed) that could also handle AC3 audio (as in ATSC broadcasts).
    – sawdust
    Commented Jun 19, 2012 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .