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

bob Darkblue darkbluewonderfulworld at gmail.com
Sat Dec 3 23:09:03 EET 2016


I patched the code but there is still

*-2 kb/s*
If I set a specific value *1000, I can read back specific value instead of
-2 kb/s

With a little printf debugging code added :

        printf("MYDEBUGSTART %0d %lf   MYDEBUGEND\n", s->frame_size,
av_q2d(st->avg_frame_rate) );
        st->codecpar->bit_rate = (int64_t)s->frame_size *
av_q2d(st->avg_frame_rate) * 8;


Which outputs :

MYDEBUGSTART *-22* 15.000000   MYDEBUGEND
Input #0, video4linux2,v4l2, from '/dev/video1':
  Duration: N/A, start: 27554.436870, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown),
1280x720, MYDEBUG -2 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
MYDEBUGSTART *-22* 15.000000   MYDEBUGEND
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 27555.194871, bitrate: N/A
    Stream #1:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown),
1280x720, MYDEBUG -2 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc

Hopefully it'll help.



On Sat, Dec 3, 2016 at 8:30 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> 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;
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://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