[FFmpeg-user] audio and video out of sync

Patrick Fischer patrick.fischer at vitec.com
Fri Jul 11 08:56:12 CEST 2014


Hello Merat,

I think the problem is the ffmpeg mpegts decoder or demuxer.

How did you save the RAW File to disk?

You could use netcat (nc) to receive RAW.

nc 192.168.1.1 1234 > mpegts_raw.ts

You need to know that a valid TS File should start with an 0x47 byte and an GOP Header.
So if you try to play the file with VLC, VLC will detect garbage at the beginning.
but with a saved file it is much easier to analyze the problem.

The TS file includes timing information(PCR, PTS, DTS) for audio and video.
So if some audio or video frames are missing, a good player (like VLC) will detect that frames are missing and the player will fill the missing frames.
(some will double the last or the next frame to adjust the sync)

If i understand the ffmpeg right, the async=1 flag will only sync the start point of the file.
If in the middle some frames are missing, the audio/video sync will drift away.

So now you should have a mpegts_raw.ts which maybe have some missing frames.
If you play the TS file with a good player, all looks fine.

If you convert this file to mp4 the fill will be async at some point.

It is hard to get a good example for that. Any maybe i'm wrong.

I think ffmpeg will not handle missing audio/video frames in the middle right.

Best regards
Patrick 


________________________________________
Von: ffmpeg-user-bounces at ffmpeg.org <ffmpeg-user-bounces at ffmpeg.org> im Auftrag von Murat Maman <murat.maman at gmail.com>
Gesendet: Freitag, 11. Juli 2014 07:34
An: FFmpeg user questions
Betreff: [FFmpeg-user] audio and video out of sync

Hi Carl,

Do you have any idea about source of the problem, i did not get any
comment from you.

Could you make any comment.


regards,


Murat


Hi Carl,

Yesterday out of sync problem again occurred and i saved file where to my
disk, i saw that there is no out of sync problem. What does it mean, what
is the source of problem, am i have internet problem, why frame drop during
the broadcasting, is it rtmp problem.

Our internet speed approximately 150 mbps.

regards,

Murat


On Fri, Jul 4, 2014 at 3:32 PM, Eugene Gekhter <egekhter at pixcel.com
<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>> wrote:

>* Carl,
*>>* Can you explain why sudo ffmpeg is a bad idea?
*>>* Thx.
*>>* Sent from my iPhone
*>>* > On Jul 4, 2014, at 4:07 AM, Carl Eugen Hoyos <cehoyos at
ag.or.at <http://ffmpeg.org/mailman/listinfo/ffmpeg-user>> wrote:
*>* >
*>* >> On Thursday 03 July 2014 10:10:39 am Murat Maman wrote:
*>* >>
*>* >> sudo ffmpeg -y -f mpegts -i 'udp://@ <udp://@>
*>* >
*>* > Unrelated: I believe that everybody on this list agrees
*>* > that "sudo ffmpeg" is a very bad idea.
*>* >
*>* >> 00.00.00.00:1111?fifo_size=1000000&overrun_nonfatal=1
<http://00.00.00.00:1111?fifo_size=1000000&overrun_nonfatal=1> \
*>* >> -maxrate 2M -bufsize 2M \
*>* >> -af volume=1.1 \
*>* >> -strict experimental \
*>* >> -c:a libfaac -ar 22050 -ac 2 -b:a 64k \
*>* >> -vsync 1 -c:v libx264 -r 25 -vf yadif,scale=640:480 -aspect:v 16:9 -b:v
*>* >> 900k \
*>* >> -preset superfast -tune zerolatency -threads 8 -crf 25 \
*>* >> -map 0:0 -map 0:1 \
*>* >> -f flv 'rtmp://testt:testt@00.00.00.00:0000/live/1111
<rtmp://testt:testt@00.00.00.00:0000/live/1111>'
*>* >
*>* > (Complete, uncut console output missing.)
*>* >
*>* > Why are you using -vsync 1?
*>* > Did you try -async 1?
*>* >
*>* > Am I correct that the problem is reproducible with file output
*>* > instead of network output?
*>* >
*>* > Is the problem reproducible if you save the udp stream to a file
*>* > (including the reception problems) and transcode the file with
*>* > FFmpeg?
*>* >
*>* > Carl Eugen
*>* > _______________________________________________
*>* > ffmpeg-user mailing list
*>* > ffmpeg-user at ffmpeg.org <http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
*>* > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
*>* _______________________________________________
*>* ffmpeg-user mailing list
*>* ffmpeg-user at ffmpeg.org <http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
*>* http://ffmpeg.org/mailman/listinfo/ffmpeg-user
<http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
*>
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list