[mythtv-users] Joining MP4s

John Pilkington johnpilk222 at gmail.com
Tue Jan 31 17:16:53 UTC 2023


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.

John



More information about the mythtv-users mailing list