[mythtv-users] FFMPeg Commercial cutting puts audio out of sync

John Finlay finlay at moeraki.com
Sun Sep 14 00:13:03 UTC 2014


On 9/13/2014 1:02 PM, Justin Alcorn wrote:
> On Sat, Sep 13, 2014 at 3:59 PM, Justin Alcorn <justin at jalcorn.net> wrote:
>> OK, that info helps.  One problem is that the script I found
>> translates the Myth cutlist to seconds and uses that to specify the
>> cuts.  I guess I better switch to using frames. I assume there's some
>> way to do that in ffmpeg?
>>
>> The biggest unanswered question - HOW do I always specify keyframes as
>> cutpoints?  I don't know how to find keyframes.
>>
>> Sorry, but I'm still pretty new at video
>
> I think I see from the docs.  Examples would be welcome, but thank
> you, it's clear using time-based cutting was the mistake.
>
I use something like this to split the file at given frames and throw 
away the commercial segments and save the program segments into a file 
which is remuxed:

mythffmpeg -i {file_path} -map 0 -c copy -f ssegment -segment_frames 
{frame_list} -segment_format mpegts pipe:1%d 10>/dev/null 11>{tmp_file} 
12>/dev/null 13>{tmp_file} ...

mythffmpeg -y -i {tmp_file} -map 0 -c copy -f {args.format} {output_file}

Where the items in {} need to be replaced with specific info. The second 
pass of mythffmpeg remuxes the output file to correct the timestamps. 
There may be an easier or better way to do this but this works for me.

John


More information about the mythtv-users mailing list