I am looking also for a Linux solution (in a separate question)
I have two recorded video files with the extension
.ts. I need to remove some part of the first, split the second, and then merge the first file with the first (split) part of the second file.
They both have the same characteristics:
Format : MPEG-TS File size : 3.16 GiB Duration : 1h 39mn Overall bit rate mode : Variable Overall bit rate : 4 527 Kbps Video ID : 720 (0x2D0) Menu ID : 6181 (0x1825) Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4 Format settings, CABAC : Yes Format settings, ReFrames : 4 frames Codec ID : 27 Duration : 1h 39mn Width : 1 440 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : MBAFF
They also contain multiple audio tracks and subtitles.
I want to process them without transcoding the files, at least be able to remove the beginning etc.
ffmpeg -i source.mts gives:
Input #0, mpegts, from 'source1.mts': Duration: 01:40:00.76, start: 2995.511878, bitrate: 4526 kb/s Program 6181 Stream #0:0[0x46](fra,fra): Subtitle: dvb_teletext ( / 0x0006) Stream #0:1[0x2d0]: Video: h264 (High) ( / 0x001B), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x2da](fra): Audio: aac (HE-AAC) ( / 0x000F), 48000 Hz, stereo, fltp, 73 kb/s Stream #0:3[0x2db](qaa): Audio: aac (HE-AAC) ( / 0x000F), 48000 Hz, stereo, fltp, 67 kb/s Stream #0:4[0x2dc](deu): Audio: aac (HE-AAC) ( / 0x000F), 48000 Hz, stereo, fltp, 49 kb/s Stream #0:5[0x2dd](qad): Audio: aac (HE-AAC) ( / 0x000F), 48000 Hz, stereo, fltp, 57 kb/s
I think it is very well doable with
ffmpeg, which is also cross-platform, as a command that I found here to remove a part of one file.
ffmpeg -i InputFile -vcodec copy -acodec copy -ss 00:12:34.567 -t 00:34:56.789 OutputFile
works, excepting the fact that the input has four audio tracks and in this way only the first (
Stream #0:2[0x2da](fra)) audio is taken. What I want is: either all audio, either the third (
Stream #0:3[0x2db](qaa)). How to adjust?
ffmpeg should therefore work to:
1. Cut off the beginning of the first file (remove first 2 minutes out of 1h40 min file)
2. Split a second (1 hour) file in two parts (after 3.05 minutes)
3. Join (append) to the end of the first file the 3.05 min part obtained from splitting the second file.
What I have tried:
Openshot: cannot process without transcoding.
Avidemux (Linux): when trying to save it says "This is not MPEG compatible - You cannot use the Copy codec."
Avidemux in Windows: audio is out of sync.