[FFmpeg-user] dynamically sync video and audio - is it possible?
Feurstein, Michael
Michael.Feurstein at wu.ac.at
Fri May 27 11:28:16 CEST 2011
Example ffmpeg command using vsync and mapping option would be:
# syncing video (0.0) to audio (1.0)
ffmpeg -i udp://@224.0.0.1:1234 -vcodec copy -i http://192.168.1.12:8000 -acodec copy -re -threads 2 -vsync 2 -map 0.0:1.0 -map 1.0 -f mpegts udp://224.0.0.2:1236
# syncing audio (1.0) to video (0.0)
ffmpeg -i udp://@224.0.0.1:1234 -vcodec copy -i http://192.168.1.12:8000 -acodec copy -re -threads 2 -vsync 2 -map 0.0 -map 1.0:0.0 -f mpegts udp://224.0.0.2:1236
Both commands run - BUT - don't sync correctly.
Anyone know what I am doing wrong?
thx//mike
On May 26, 2011, at 2:19 PM, Feurstein, Michael wrote:
> Hi,
>
>
> My testruns show that when muxing an incoming udp stream with another audio stream the video stream always seems to be delayed plus minus 2 seconds. Is there a way to dynamically sync audio and video, or maybe tell ffmpeg to start muxing when both video and audio are available. I reckon the dynamic delay comes from opening the streams, therefore I can't assume a 2 second delay for each run, because sometimes the delay will be 3 seconds. My goal would be to automate this.
>
>
>
> I already tried itsoffset, which only helps if I know the delay beforehand, which I don't.
>
>
>
> I've been playing around with vsync and async as well as isync, but without success. The manual tells me I can sync one part (video or audio) to another, only thing is I can't find a working command setup
>
>
>
> Does someone out there have knowledge in how to use vsync and map the audio to the video? Maybe an example?
>
> If not... is it even possible what I want to achieve?
>
>
>
> I appreciate any input.
>
>
>
> Thanks and greetings!
>
> Michael Feurstein
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
More information about the ffmpeg-user
mailing list