On 09/11/2025 17.45, hydra3333 via ffmpeg-user wrote:
>> From: Mark Filipak via ffmpeg-user <[email protected]> 
>> Sent: Monday, November 10, 2025 7:06 AM
>> Hi Gerd, I'm guessing you have an unclean source. FFmpeg can clean
>> unclean sources, but sometimes FFmpeg makes things worse. It's best to
>> make a clean copy and then work with that. Sometimes that means using
>> programs that are not FFmpeg.
> 
> Thanks for that info about ffmpeg cleaning up.
> 
> I had a look several months ago and also thought that ffmpeg could not really 
> clean
> crusty sources.
> 
> I had an impression that ffmpeg could only ignore some bad stuff and thus
> introduce gaps (lost frames, lost audio) and loss of lip sync.  The doco 
> seemed
> to me to be a bit light on for examples of dealing with the range of bad 
> source
> video issues and the relevant options seemed hard-to-find, at least for me, 
> since IIRC there were a few.
> 
> I currently continue to use a now-defunct product "VideoReDo" which
> has a feature called QuickStreamFix which recognises and deals with those 
> things
> (as well as removing audio delay) and maintains lip sync.  
> VideoReDo was paid-for but FANTASTIC (the owner died and his wife won’t sell 
> the IP,
> which is why the product is defunct) but it still works EXTREMELY well for 
> the time being.
> 
> I wish ffmpeg would consider putting a project together to be able to fix bad 
> sources
> at least as well as VRD's QSF does, it'd be a great boon to the entire world 😊
> 
> I also had a look around and found there's nothing on the planet (close to 
> free) which
> does things as well, and saw some which purported to but did not (especially 
> in a
> non-interactive "batch mode", ie a scheduled task, since they relied on a gui 
> interface).
> 
> If you have examples of ffmpeg doing such things then I would very much
> appreciate the information you have.

Okay, here's some.

setpts, like adding °F and °C
-----------------------------
You know of the
    setpts=PTS-STARTPTS
filter, right? It sets the starting PTS to zero and it works very well.
How about
    setpts=PTS-<number>?
Well, PTS is in ticks, ticks of the timebase clock. So, you'd expect
    setpts=PTS-<ticks>
would be correct, right? For example, to cut 24/1.001 FPS video at frame
100,
    setpts=PTS-375375.

Nooooooo! That's wrong. It should be
    setpts=PTS-100.
So the setpts filter appears to add ticks and frames. That's like adding
°F and °C, which produces nonsense of course.

    setpts=PTS-<number>
is not documented. It's the key to making frame-accurate cuts via FFmpeg
and it's not documented at all. Setting <number> to anything other than
<frames> and x264 gives you video with negative PTSes, non-monotonic DTS
errors and worse.

The same holds true for asetpts, except that PTS for audio is actually
SR (sample rate), usually 48000 samples/s. The documentation combines
setpts and asetpts and uses "PTS" for both. Oh dear.

What about when a video has studio splash screens at 30i that precede a
24i (i.e. soft telecine) movie?

Now, don't think too hard about this. You'll get brain damage.

Full Disclosure: I have not fully figured out asetpts yet, so I'm still
getting audio sync problems when I cut. But they're pretty quick and
easy to fix once I have transcoded video in hand.

If you'd like to work together, hydra3333, I'm keen.

_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to