Mailing List Archive

Joining MP4s
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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
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

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
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

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
> On 1 Feb 2023, at 1:16 am, John Pilkington <johnpilk222@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


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
On 01/02/2023 05:05, James wrote:
>
>
>> On 1 Feb 2023, at 1:16 am, John Pilkington <johnpilk222@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

A playlist!

John

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
> On 1 Feb 2023, at 5:15 pm, John Pilkington <johnpilk222@gmail.com> wrote:
>
> On 01/02/2023 05:05, James wrote:
>>> On 1 Feb 2023, at 1:16 am, John Pilkington <johnpilk222@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
>
> A playlist!
>

I was totally unaware, but it looks most interesting, thanks
James

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
[snip] not relevant

>>
>> A playlist!
>>
>
> I was totally unaware, but it looks most interesting, thanks

The wiki is somewhat opaque, can someone explain please:

The metadata editor 'Next File' seems to be a simple 'Chose file from list'. My 'next file' is 1000 entries down. There *must* be an easier way ??

mythvideo_autoplaylists.pl
has gems like

$query = "SELECT intid, title, filename FROM ".$db.".videometadata WHERE 1=1 ...

The wiki does not explain and I can't grok what it is trying to do.

Help
thanks
James
Re: Joining MP4s [ In reply to ]
On 01/02/2023 14:38, James wrote:
> [snip] not relevant
>
>>>
>>> A playlist!

I have never used one in MythTV, but your solution looked as if that's
what you had. ISTR seeing provision
for them in vlc. Good luck.
>>>
>>
>> I was totally unaware, but it looks most interesting, thanks
>
> The wiki is somewhat opaque, can someone explain please:
>
> The metadata editor 'Next File' seems to be a simple 'Chose file from
> list'. My 'next file' is 1000 entries down. There *must* be an easier way ??
>
> mythvideo_autoplaylists.pl
> has gems like
>
> $query = "SELECT intid, title, filename FROM ".$db.".videometadata WHERE
> 1=1 ...
>
> The wiki does not explain and I can't grok what it is trying to do.
>
> Help
> thanks
> James
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
On 01/02/2023 14:38, James wrote:

> [snip] not relevant
>
>>>
>>> A playlist!
>>>
>>
>> I was totally unaware, but it looks most interesting, thanks
>
> The wiki is somewhat opaque, can someone explain please:
>
> The metadata editor 'Next File' seems to be a simple 'Chose file from
> list'. My 'next file' is 1000 entries down. There *must* be an easier
> way ??
>
> mythvideo_autoplaylists.pl
> has gems like
>
> $query = "SELECT intid, title, filename FROM ".$db.".videometadata
> WHERE 1=1 ...
>
> The wiki does not explain and I can't grok what it is trying to do.
>
> Help
> thanks
> James
>

Congratulations it looks like you have found your very first project to
help improve MythTV :)


Until them I have a suggestion to use the List Search function. It's
really only useful if you have a keyboard but can be used with a remote
if everything is set up properly. You press Ctrl-S by default which
should show a search box into which you can type part of the filename or
item you are looking for. You can find the next or previous matches etc.
By default the search will match if the item contains the search text.
There is a magic key press that turns the search into a begins with
match but I can't remember what it is off hand. It should work in all
buttonlists but sometimes depending on the theme the search box can
obscure the list you are trying to search. There is a way to tweak the
theme to move the search box into a more appropriate position if I
recall correctly but few theme use it.


Paul H.


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
> On 2 Feb 2023, at 1:45 am, Paul Harrison <mythtv@mythqml.net> wrote:
>
> On 01/02/2023 14:38, James wrote:
>
>> [snip] not relevant
>>
>>>>
>>>> A playlist!
>>>>
>>>
>>> I was totally unaware, but it looks most interesting, thanks
>>
>> The wiki is somewhat opaque, can someone explain please:
>>
>> The metadata editor 'Next File' seems to be a simple 'Chose file from list'. My 'next file' is 1000 entries down. There *must* be an easier way ??
>>
>> mythvideo_autoplaylists.pl
>> has gems like
>>
>> $query = "SELECT intid, title, filename FROM ".$db.".videometadata WHERE 1=1 ...
>>
>> The wiki does not explain and I can't grok what it is trying to do.
>>
>> Help
>> thanks
>> James
>>
>
> Congratulations it looks like you have found your very first project to help improve MythTV :)
>
>
> Until them I have a suggestion to use the List Search function. It's really only useful if you have a keyboard but can be used with a remote if everything is set up properly. You press Ctrl-S by default which should show a search box into which you can type part of the filename or item you are looking for. You can find the next or previous matches etc. By default the search will match if the item contains the search text. There is a magic key press that turns the search into a begins with match but I can't remember what it is off hand. It should work in all buttonlists but sometimes depending on the theme the search box can obscure the list you are trying to search. There is a way to tweak the theme to move the search box into a more appropriate position if I recall correctly but few theme use it.

Paul once-upon-a-me I taught C and C++ for HP. I used to teach my students to write code you could read your daughter as a bed time story.
My jest was to say write simple code that will fit in your head. I understand (I really do) writing code to demonstrate how clever you are, but in general mythtv code is complex and takes a good study before one can wade in and do anything useful.
Years ago mythtv failed to disable the screen-blanking. After a week of trying to understand I settled for a timer wiggling the mouse every 5 mins. Never-the-less I shall have a go
James

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
On 02/02/2023 06:59, James wrote:
> On 2 Feb 2023, at 1:45 am, Paul Harrison <mythtv@mythqml.net> wrote:
>> Congratulations it looks like you have found your very first project to help improve MythTV :)
>>
>>
>> Until them I have a suggestion to use the List Search function. It's really only useful if you have a keyboard but can be used with a remote if everything is set up properly. You press Ctrl-S by default which should show a search box into which you can type part of the filename or item you are looking for. You can find the next or previous matches etc. By default the search will match if the item contains the search text. There is a magic key press that turns the search into a begins with match but I can't remember what it is off hand. It should work in all buttonlists but sometimes depending on the theme the search box can obscure the list you are trying to search. There is a way to tweak the theme to move the search box into a more appropriate position if I recall correctly but few theme use it.
> Paul once-upon-a-me I taught C and C++ for HP. I used to teach my students to write code you could read your daughter as a bed time story.
> My jest was to say write simple code that will fit in your head. I understand (I really do) writing code to demonstrate how clever you are, but in general mythtv code is complex and takes a good study before one can wade in and do anything useful.
> Years ago mythtv failed to disable the screen-blanking. After a week of trying to understand I settled for a timer wiggling the mouse every 5 mins. Never-the-less I shall have a go
> James
>

Did you try the search list method? Does it make things any easier?


I just tried it using MythCenter-wide theme and it works OK but I was
right by default the search dialog overlaps the selector we are trying
to search so you can't see what you have found. Very easy to fix though
just need to add <searchposition>220,310</searchposition> to the
"child_select> widget definition for the edit_metadata window definition
in video-ui.xml.


The magic key to change the search from a "contains" to a "starts with"
type search is the '0' key but don't tell anyone it's a top secret
hidden feature that no one must ever know so shh!!!


My suggestion to help improve MythTV was a little tongue-in-cheek :)
It's become a bit of joke really I quite often ask users to help out
when they find something they don't like about MythTV. They always
without fail chicken out. I'm still waiting for one of them to get back
to me with their fix. It's easy to complain but I think they soon find
it's a dame sight harder to do anything better. I do understand not all
users can code my usual reply is to ask them to draw an image of a UI
and explain how it should work then! I'm not a developer or even
computer literate. I'm a user who learned to code c/c++/xml/python etc
just so I could contribute to MythTV so if I can do it everyone can
really if they care enough.


Regarding the problem with finding the next file to play. My guess is
whoever coded it thought how can I do this? I can either just add a
selector with a big list, it's quick and easy to do, probably less that
an hour most of it tweaking the theme or I can maybe add a popup dialog
with a fancy UI to help find the required file which could easily take a
week or more fiddling with layouts to get something that works properly.
Most devs will think I will do the first one and get it working and then
come back and do it properly later. Of cause later never comes there is
always something else to work on :)


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
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
/mnt/sdb1/Vids/20055_20220702074100_184524.ts
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 :-)

John

John
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Joining MP4s [ In reply to ]
> On 2 Feb 2023, at 11:31 pm, John Pilkington <johnpilk222@gmail.com> wrote:
>
> 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 /mnt/sdb1/Vids/20055_20220702074100_184524.ts
> 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 :-)

In a roundabout way you have totally solved my problem.
I wax lyrical incase it helps someone else:

Adding my end segment with your flags shows the error

[mpegts @ 0x895880] Non-monotonous DTS in output stream 0:1; previous: 425255154, current: 241752704; changing to 425255155. This may result in incorrect timestamps in the output file.

And the resultant file is AFU in the extreme. A 2 hour file becomes 4 hours long. vlc plays but wont skip forward, then plays segments out of order.

Combining .ts not .mp4 segments results in perfect lip sync in shotcut
Adding my end segment and telling shotcut to transcode and create an mp4 (that is how it works) results in an output with perfect lip sync, end properly appended that plays with VLC and mythfrontend

James

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org