[FFmpeg-user] Can't synchronize two webcam streams side by side using ffmpeg

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Dec 3 21:30:04 EET 2016


2016-12-03 18:50 GMT+01:00 bob Darkblue <darkbluewonderfulworld at gmail.com>:

> Input #0, video4linux2,v4l2, from '/dev/video1':
>   Duration: N/A, start: 15838.916456, bitrate: N/A
>     Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown),
> 1280x720, -2 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
> Input #1, video4linux2,v4l2, from '/dev/video0':
>   Duration: N/A, start: 15839.810583, bitrate: N/A
>     Stream #1:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown),
> 1280x720, -2 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc

I know this is most likely not related to your issue but could
you test if the following inlined patch fixes "-2"?

Thank you, Carl Eugen

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index ae51d83..c6f739c 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -960,7 +960,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
     st->codecpar->width = s->width;
     st->codecpar->height = s->height;
     if (st->avg_frame_rate.den)
-        st->codecpar->bit_rate = s->frame_size *
av_q2d(st->avg_frame_rate) * 8;
+        st->codecpar->bit_rate = (int64_t)s->frame_size *
av_q2d(st->avg_frame_rate) * 8;

     return 0;


More information about the ffmpeg-user mailing list