I have a file that ends in .ts, which according to wikipedia is an MPEG2 file. I've never run into a file like this so I want it want the file to be in a more common format/container to use on multiple devices.
I tend to recommend leaving files in their original state, as any conversion has a chance to introduce loss. The
.ts video format is a container format for MPEG, known as "Transport Stream", which is used most frequently by digital broadcasting systems (digital cable, satellite, etc). Many applications are unfamiliar with how to decode it, since it has a very different multiplexing format than the more conventional MPEG container known as "Program Stream", which is what is used on DVDs, and what is produced by many encoder cards. The difference between TS and PS is only how the packet structure is built; the A/V data inside it is the same.
To get better interoperability, I recommend converting the container from TS to PS. Virtually every piece of software that can decode TS can decode PS, so it's almost always better to have PS file. One of the simplest remuxing tools I've found to use is
avidemux. Just choose "copy" for the video and audio streams, and choose the "PS" container format for MPEG:
Then just save out the result. This can also be done using
ffmpeg. You just need to select the copy codec for each stream type:
ffmpeg -i input.ts -vcodec copy -acodec copy output.mpg
.TS files are technically just MPEG2 files. You can use pretty much any converter (avidemux, handbrake or even ffmpeg directly).
But the only reason to do so would be filesize. Mpeg2 files play pretty much everywhere. The only confusing part is the actual file-extension.
You can safely and freely rename them to .mpeg
PS. By turning it into Matroska, you just made is very hard for people on other systems to be able to play the file. I understand picking a free codec, and then choosing the appropiate container, but if you keep it at MPEG2, why change the container to something relatively obscure?
From looking at this forums thread I can make it into a matroska file, which I already use.
ffmpeg -i input.ts -vcodec copy -sameq -acodec copy -f matroska output.ts
I was able to encode this despite this information the seems to indicate that I needed to compile ffmpeg from source. The downside to this is that it doesn't encode the file, so the file is as large as the MPEG2 file. More answers with recommendations for encoding .ts->MPEG4 would help me out.
Actually .ts files are created by DVB-S/DVB-S2 tuners capable of recording transponder streams and can contain mpg2 AC3 AAC h264 mp3, as well as other data ie Teletext or EPG. .ts files contain in most cases just AV data but are not limited to that. VLC can play ts files directly and give You some info about some of the streams in it. Im personally using a sat tuner that records HD channels in .ts files (h264 video and in most cases multiple AAC mp3 mpg2 audio streams). So basically .ts files can contain many different things Its just container format created for sending digital broadcasts over loosy media. VLC can also convert betwen formats (hevent done this myself)
I usually use HandBrake to convert all kind of video files to iPhone-compatible format. Maybe you can use it to convert the .ts files into MP4. Check this HandBrake PPA to install it.
The handling of TransportStream files produced by DVB-S recorders depends on the contained video and audio stream. For material in SD quality it is likely that you can use a tool chain consisting of ProjectX and mplex to convert the stream into a standard MPEG container. If the video stream is HD, try MKVMerge to convert it into an MKV file. Both ways are described in detail this blog post.
ffmpeg program has been deprecated in favor of
You can pass the same arguments to
avconv to convert from transport stream to program stream mpeg or matroska.
avconv -i input.ts -acodec copy -vcodec copy output.mpg
avconv -i input.ts -acodec copy -vcodec copy output.mkv