[mythtv-users] Joining MP4s

James jam at tigger.ws
Wed Feb 1 05:05:56 UTC 2023



> On 1 Feb 2023, at 1:16 am, John Pilkington <johnpilk222 at gmail.com> wrote:
> 
> SeeOn 31/01/2023 15: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 wasn't sure about concatenating progressive and interlaced segments, but since they are transmitted as equivalent here (ie in the UK) it ought to be ok.  I would suggest demuxing both segments with '-fflags +genpts' and perhaps '-avoid_negative_ts make_zero', and then concatenating with the fflag/genpts options added to what you used above.  This 'issue' has similar examples:
> 
>  https://github.com/MythTV/mythtv/issues/600#issuecomment-1172873672
> 
> I doubt that you will get an undetectable smooth join but it might be acceptable.  I'm having to use this technique now with mpeg2 SD recordings from the ITV/Ch4/Ch5 mux, as well as with h264, since they changed encoders around the New Year.

Clearly a phD's worth of learning to be made

$ mkvmerge -o result.mp4 TheVow.mp4 end.mp4 (with or without +)

results in ONLY the end.mp4 and bad (more than 1000ms) lip sync.

So I bite bullet and scan and have
The Vow.mp4
The Vow Ending.mp4

both of which play perfectly with mythfrontend and with vlc

I'm happy, but if anyone wants to (see I'm not lying) play then say so and I will post them. My www is Bluehost in the US and they have BIG taps!
James




More information about the mythtv-users mailing list