[FFmpeg-user] Please help with weird video problems

Alexander Gribanov sunrisecoder at gmail.com
Wed Feb 8 19:41:46 EET 2023


ср, 8 февр. 2023 г. в 17:53, Anatoly <anatoly at kazanfieldhockey.ru>:

> On Wed, 8 Feb 2023 14:46:04 +0300
> Alexander Gribanov <sunrisecoder at gmail.com> wrote:
>
> > ср, 8 февр. 2023 г. в 02:11, Anatoly <anatoly at kazanfieldhockey.ru>:
> >
> > > On Tue, 7 Feb 2023 22:00:35 +0300
> > > Alexander Gribanov <sunrisecoder at gmail.com> wrote:
> > >
> > > > Hello!
> > > >
> > > > Here is a downloaded Facebook Livestream video which I'm trying to
> > > > process:
> > > >
> > >
> https://drive.google.com/file/d/1mVkQbzVSzhOlQbT2mB1J2yvPFV5kl5Dq/view?usp=share_link
> > >
> > > >
> > > > I can play it correctly in MPC-HC Media Player Classic, but when I
> > > > try to add this video to Adobe Premiere 2022, there around 3:00:00
> > > > position audio is about 40 seconds ahead of video...
> > > >
> > > > I tried to remux and re-encode this video using ffmpeg, it showed
> > > > a lot of warnings like this:
> > > > [aac @ 000001c1bfe68e40] env_facs_q 254 is invalid
> > > >
> > > > I tried different options like "-vsync cfr", "-fps_mode drop" and
> > > > some other stuff which I don't remember already, but nothing
> > > > helped :( In MPC-HC it was ok, but in Adobe Premiere still
> > > > 40-seconds a/v unsync.
> > > >
> > > > I assume that the problem is with timestamps on the audio track.
> > > >
> > > > I would like to make using ffmpeg just a simple cfr video 29.97
> > > > fps / audio 48kHz without any timestamp gaps and offsets.
> > > >
> > > > Could anybody please help me to understand how to analyze and
> > > > diagnose such problems in such videos to be sure what the exact
> > > > problem is?
> > > >
> > > > Could You please help me find the solution (i.e. options or
> > > > subcommands to ffmpeg).
> > > >
> > > > Thank You very much in advance :)
> > >
> > > Maybe re-encode it with constant framerate using 'framerate' filter?
> > > ffmpeg -i in.mp4 -vf framerate=fps=29.97 -c:a copy -c:v libx264 -b:v
> > > 800k out.mp4
> > >
> >
> > Hello Anatoly!
> > Thank You very much for the reply, but it didn't help, the problem
> > remains :(
> >
> > Any other ideas?
>

Hello Anatoly! Thank You very very much for the reply.
Handbrake 1.6.1 helped me, but still, I would like to figure out what the
exact problem with my file is.


> I took a deeper look at your file. It seems that aac audio stream
> contains undecodable frames (by all decoders I have aac, aac_fixed,
> libfdk_aac).

1. Do You think Handbrake has the decoder which was able to decode or it
just muted broken frames?
2. I have an assumption that those frames could be really broken due to bad
internet during the live stream
and incomplete frame chunks were saved as they are (incomplete) in the
audio stream, what do You think?

And ffmpeg just drops undecodable audio parts instead of
> silence them.

Is there any way to hint to ffmpeg not to drop them but keep silent?

This results in audio track becomes shorter than video and
> out of sync.

Yes, I agree


> Mplayer handles this properly, playing audio in sync, but
> with very short and rare audio droputs.

How is it possible?
If ffmpeg dropped about 50 seconds of audio, it doesn't look like "some
very rare samples"...
So I assume, after it dropped some samples, it should add kind of timestamp
to the next audio block,
which MPC-HC can digest, but Adobe Premiere can not, is it right? Or how
does it work?
Could You please explain in a few words or give me a link to an article to
read about it?


> But mencoder does same way as
> ffmpeg.
>
What is the mencoder? Google says that it is a part of MPC-HC, but I'm not
sure... is it right?


> I succeed transcoding this file with Handbrake https://handbrake.fr, I
> have version 1.3.3 installed with FDK aac.

Yes, this worked fine, I tried with Hardbrake 1.6.1, then used the output
as input for Adobe Premiere 2022,
and the result file was not out of sync.


> This also results in short
> audio dropouts like playing with Mplayer.
>
Yes, I will listen to it carefully to see whether there are some dropouts
or not.

Anyway, thank You very very much, at least, I found a working solution :)


> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list