[Libav-user] help with raw fifo as movie src & overlay

gstream at ccc2.com gstream at ccc2.com
Tue Feb 14 11:29:54 CET 2012

> 2012/2/13  <gstream at ccc2.com>:
>> Hi All,
>> I am hoping you can help with getting the libavfilter movie and overlay
>> working correctly.
>> My objective is to get two RTSP camera feeds to go side by side in sync.
>> I started with the below that works to transmit the final image but due
>> to
>> the loading times of each overlay the streams are out of sync.
>> ffmpeg  -loop_input -i 800x600.jpg -an -s 1288x360 -vf
>> 'movie=rtsp\\://\\:551/channel1,scale=640:352[wm];
>>  movie=rtsp\\://\\:551/channel1,scale=640:352[wm2];
>> [in][wm] overlay=2:4[in+wm];
>> [in+wm][wm2] overlay=646:4 [out]'
>> -s 1288x360 -vcodec rawvideo /home/fifo/mpegpipe99.yuv
>> so firstly, is there a way I can add a video buffer to the first overlay
>> so it syncs with the second?
> I assume you have de-sync of nearly 5 seconds, with video coming from
> first mentioned URL coming late. Is that correct?
> If so, point must be the streams recognition delay (during opening). I
> suspect that libavfilter opens your sources sequentially, not in
> parallel. (Just speculations, haven't check in sources.)
> You could try adding to second source the "setpts" filter, to shift
> its timestamps. So your invoke should look like
> ffmpeg  -loop_input -i 800x600.jpg -an -s 1288x360 -vf
> 'movie=rtsp\\://\\:551/channel1,scale=640:352[wm];
>  movie=rtsp\\://\\:551/channel1,scale=640:352,setpts=PTS+5[wm2];
> [in][wm] overlay=2:4[in+wm];
> [in+wm][wm2] overlay=646:4 [out]'
> -s 1288x360 -vcodec rawvideo /home/fifo/mpegpipe99.yuv
> If that doesn't help, imo it requires hacking libavfilter or writing
> an application.
> --
> Andrey Utkin
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

Thanks Andrey

the delay is about 1 sec and is 1st behind 2nd as you suggested. I tried
the PTS but no change in the delay at all. -filters says setpts is
available. Is there any other setting I need to check?


More information about the Libav-user mailing list