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

Mike Perkins mikep at randomtraveller.org.uk
Sat Sep 13 17:27:11 UTC 2014


On 13/09/14 17:55, Justin Alcorn wrote:
> On Sat, Sep 13, 2014 at 5:21 AM, Mike Perkins
> <mikep at randomtraveller.org.uk> wrote:
>>> After hours of reading posts and playing with settings, I've cot a
>>> couple of theories.
>>>
>>> A) the video is cutting on 'key frames', not at exactly the time I say
>>> to cut, but the audio cuts at the exact mark
>>> B) The video being in variable bitrate throws off the cutting
>>>
>>> But I'm not sure how to solve either of these problems.
>>>
>> [snip]
>>>
>>>
>> The most obvious thing to say is that you should make sure your cuts are all
>> on keyframes. This should reduce any difference between audio and video to
>> the minimum.
>>
>> If you don't make cuts on keyframes then the video processor has to try and
>> bridge data that really belongs to two different scenes and adjust
>> dynamically, which can look terrible on-screen. Keyframes is the way to go.
>
>
> That fits with one of my theories so the question is - how do I get
> ffmpeg to cut at the keyframe closest to the time I specify?
>
I think that's more to do with how you specify the cuts.

If you are just allowing the commercial-detecion program to do its thing then 
you really ought to check it afterwards and make sure the edits fall at keyframes.

Otherwise, if you do it manually, then again, make sure you select keyframes as 
cut points.

To clarify, cutting at the end of a program segment you want to keep, you can 
run /up to/ but not including the next keyframe (if suitable). That's the 
natural way that the frames will arrive in any event. For the start of any 
wanted segment, you really should begin it on a fresh keyframe to avoid flicker 
and sound discrepancies.

-- 

Mike Perkins



More information about the mythtv-users mailing list