[mythtv-users] Joining MP4s

John Pilkington johnpilk222 at gmail.com
Thu Feb 2 15:31:46 UTC 2023

On 31/01/2023 15:43, Peter Bennett wrote:
> On 1/31/23 10:10, James wrote:
>> I recorded a movie that I want to save. Due to the whims of the 
>> Australian Open my 20 min post record failed by 2 minutes. Playing 
>> Amazon Prime in a VM I screen captured the last 2 min of the movie..
>> I now have my movie-2min with commercials cut stored as a 'Movie' It 
>> plays perfectly.
>> I have the last 2 minues as a clip. It too plays perfectly.
>> Each is 720x576 16:9 24.99 Hz. Both are h264 in a mp4 container. The 
>> OTA recordings are interlaced.
>> How on earth can I append the end.mp4?
>> I tried shotcut which re-rendered giving perfect video but lip sync of 
>> 500ms variable, with the end clip in sync
>> I tried mythffmpeg which muddled everything ie repeated sections 
>> general chaos
>> mythffmpeg -f concat -safe 0 -i /store/TScut_work/file -c copy 
>> /store/Movies/Myth-V/Thur\ Vow.mp4
>> Any experts with handbrake et al
>> Of interest *some* OTA 720 and 1080 videos maintain lip sync, some do 
>> not. I've not looked why I occasionally shotcut a snip to put the MOV 
>> atom at the front of the file for downloads.
>> EG http://tigger.ws/downloads/qna.mp4
>> James
>> _______________________________________________
> I use mkvmerge, which can split and append, as long as the parts use the 
> same tracks, resolution, etc. It reads any type of input and creates an 
> mkv file. mkv files can be played by most players including mythtv. You 
> can also adjust the audio sync if necessary. I have used it for editing 
> out the commercials in a show, by splitting and joining parts.
> Peter

Going back in this thread:  this was the bit of the issue #600 text I 
was pointing to


----Segments are  (cat seglist_184524)

file /var/RSG4/TScut_work/20055_20220702074100_184524_001.ts
file /var/RSG4/TScut_work/20055_20220702074100_184524_002.ts
file /var/RSG4/TScut_work/20055_20220702074100_184524_003.ts

File segments have been written, Concatenating.

ionice -c3 mythffmpeg -hide_banner -ignore_unknown -fflags +genpts -f 
concat -safe 0 -i seglist_184524 -c copy 
Output file is /home/john/SGs/RecsSG3/20055_20220702074100.ts

I think the essential difference from the raw recording format is ' 
fflags +genpts '


The list of segments would now be your two segments, in the 'file' 
format as shown, and in a filename replacing the 'seglistxxxx' above, 
and with the output file_name_conforming_to_your_system.mp4.  It might 
work, if you can get the input segments compatible  :-)



More information about the mythtv-users mailing list