The first thing I do when working with .ts (transport stream) files is to run it through ffmpeg and put a file header on it with a working time index.
Code:
ffmpeg -i file.ts -c:a copy -c:v copy file.mp4
Then you can edit
file.mp4 any way that you wish. If you for examples want to edit out the commercials.
Made up Examples:
Get video from 3:00 to 8:34 in the video
Code:
ffmpeg -ss 00:03:00 -t 00:05:34 -i file.mp4 -c:a copy -c:v copy out1.mp4
10:00 to 20:26
Code:
ffmpeg -ss 00:10:00 -t 00:10:26 -i file.mp4 -c:a copy -c:v copy out2.mp4
22:00 to 30:38
Code:
ffmpeg -ss 00:22:00 -t 00:08:38 -i file.mp4 -c:a copy -c:v copy out3.mp4
That will give you
out1.mp4 out2.mp4 and
out3.mp4
To put those together for final video:
Either edit file.txt in your text editor or redirect to it
file.txt
Code:
file '/path/to/out1.mp4'
file '/path/to/out2.mp4'
file '/path/to/out3.mp4'
Code:
ffmpeg -f concat -i file.txt -c:a copy -c:v copy final.mp4
or
Code:
ffmpeg -i "concat:/path/to/out1.mp4|/path/to/out2.mp4|/path/to/out3.mp4" -c:a copy -c:v copy final.mp4
.ts steams are mpeg2 video and aac audio. If you want to reencode that to something different or smaller then you can. Look at the man page for ffmpeg.
You will want the
-c:a and
-c:v switches.
if you want more, ask.