<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <br>
    <div class="moz-cite-prefix">Den 03.05.2025 13:00, skrev Terje J.
      Hanssen:<br>
    </div>
    <blockquote type="cite"
      cite="mid:b59e5dc8-0829-46d8-9bf0-0ac3df83188b@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <br>
      <div class="moz-cite-prefix">Den 02.05.2025 21:42, skrev Andrew
        Randrianasulu:<br>
      </div>
      <blockquote type="cite"
cite="mid:CA+rFky6hQ0StVCL5YT-rgZZpZXSsAu9fmZtpqr9pbKUndLF=dg@mail.gmail.com">
        <meta http-equiv="content-type"
          content="text/html; charset=UTF-8">
        <div dir="auto">
          <div><br>
            <br>
            <div class="gmail_quote gmail_quote_container">
              <div dir="ltr" class="gmail_attr">пт, 2 мая 2025 г., 22:37
                Terje J. Hanssen <<a
                  href="mailto:terjejhanssen@gmail.com"
                  moz-do-not-send="true" class="moz-txt-link-freetext">terjejhanssen@gmail.com</a>>:<br>
              </div>
              <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div> <a
href="https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg05748.html"
                    target="_blank" rel="noreferrer"
                    moz-do-not-send="true" class="moz-txt-link-freetext">https://www.mail-archive.com/cin@lists.cinelerra-gg.org/msg05748.html</a><br>
                  <br>
                  I contine this new thread with an short extract from
                  the long growing<br>
                  [Cin] ms2130 HDMI-USB3 UHD capture card - not quite as
                  expected?<br>
                  <br>
                  But shouldn't a 422 and not a 420 output format be
                  created?<br>
                  <br>
                  <blockquote>>> it seems in some cases ffmpeg not
                    geared towards preserving most information, just
                    picks up most commonly defined/first pixel format. <br>
                    >> Try mpeg2video as output codec, and/or
                    specify pixel format (pix_fmt) more explicitly
                    before output's filename?<br>
                    <br>
                    >>> Could you possibly examplify the
                    latter?<br>
                    <br>
                    >>>> I think I just theorized ffmpeg may
                    try to get some info from alsa device file directly,
                    as it tries with /dev/video. But I never
                    >>>> tried this way, so I can be totally
                    wrong!<br>
                  </blockquote>
                  -------------------------------<br>
                  <br>
                  Instead of 50i (pal interlaced fields), I try 50 fps
                  (progressive) that at least is a pal frequence.<br>
                  <br>
                  And yes, it seems from the output that ffmpeg uses
                  mpeg1video as default output codec.<br>
                  <br>
                  Furter I try to combine the current line<br>
                  <blockquote>ffmpeg -hide_banner -f v4l2 -input_format
                    yuyv422 -video_size 720x576 -framerate 25 -t 20 -i
                    /dev/video2 out-720x576_ms2130.mpeg<br>
                  </blockquote>
                  <br>
                  with and utilize the syntax developed 2021 for
                  "Blu-ray compliant MPEG-2 SD video with LPCM audio"<br>
                  <blockquote>ffmpeg -i dv28.dv -c:v mpeg2video -refs 1
                    -bf 2 -b:v 25M -maxrate 25M -minrate 25M -bufsize
                    45M -muxrate 45M -dc 10 -c:a pcm_s16be -f vob
                    dv28.mpg <br>
                  </blockquote>
                  and for the current ongoing "DVD compliant MPEG-2
                  Video and PCM Audio"<br>
                  <blockquote>ffmpeg -hide_banner -i dv01.dv -c:v
                    mpeg2video -refs 1 -bf 2 -b:v 8M -maxrate 8M
                    -minrate 8M -bufsize 20M -muxrate 11M -dc 10 -c:a
                    pcm_dvd -f vob -flags +ilme+ildct dv01.mpg<br>
                  </blockquote>
                  to first<br>
                  <blockquote>ffmpeg -hide_banner -f v4l2 -input_format
                    yuyv422 -video_size 720x576 -framerate 50 -c:v
                    mpeg2video -refs 1 -bf 2 -b:v 8M -maxrate 8M
                    -minrate 8M -bufsize 20M -muxrate 11M -dc 10 -c:a
                    pcm_dvd -f vob -t 20 -i /dev/video2
                    720x576_50p_ms2130.mpg <br>
                    Option b:v (video bitrate (please use -b:v)) cannot
                    be applied to input url /dev/video2 -- you are
                    trying to apply an input option to an output file or
                    vice versa. Move this option before the file it
                    belongs to.<br>
                    Error parsing options for input file /dev/video2.<br>
                    Error opening input files: Invalid argument<br>
                  </blockquote>
                  <br>
                  and next revised with no output. That is I need help
                  to debug the syntax error: <br>
                  <blockquote>ffmpeg -hide_banner -f v4l2 -input_format
                    yuyv422 -video_size 720x576 -framerate 50 -i
                    /dev/video2 -c:v mpeg2video -refs 1 -bf 2 -b:v 8M
                    -maxrate 8M -minrate 8M -bufsize 20M -muxrate 11M
                    -dc 10 -c:a pcm_dvd -f vob -t 20
                    720x576_50p_ms2130.mpg<br>
                    [video4linux2,v4l2 @ 0x55db770ef9c0] Dequeued v4l2
                    buffer contains corrupted data (0 bytes).<br>
                    Input #0, video4linux2,v4l2, from '/dev/video2':<br>
                      Duration: N/A, start: 0.000000, bitrate: 331776
                    kb/s<br>
                      Stream #0:0: Video: rawvideo (YUY2 / 0x32595559),
                    yuyv422, 720x576, 331776 kb/s, 50 fps, 50 tbr, 1000k
                    tbn<br>
                    Stream mapping:<br>
                      Stream #0:0 -> #0:0 (rawvideo (native) ->
                    mpeg2video (native))<br>
                    Press [q] to stop, [?] for help<br>
                    [video4linux2,v4l2 @ 0x55db770ef9c0] Dequeued v4l2
                    buffer contains corrupted data (0 bytes).<br>
                        Last message repeated 30 times<br>
                    [mpeg2video @ 0x55db77114f00] Warning vbv_delay will
                    be set to 0xFFFF (=VBR) as the specified vbv buffer
                    is too large for the given bitrate!<br>
                    Output #0, vob, to '720x576_50p_ms2130.mpg':<br>
                      Metadata:<br>
                        encoder         : Lavf59.27.100<br>
                      Stream #0:0: Video: mpeg2video (4:2:2),
                    yuv422p(tv, progressive), 720x576, q=2-31, 8000
                    kb/s, 50 fps, 90k tbn<br>
                        Metadata:<br>
                          encoder         : Lavc59.37.100 mpeg2video<br>
                        Side data:<br>
                          cpb: bitrate max/min/avg:
                    8000000/8000000/8000000 buffer size: 20000000
                    vbv_delay: N/A<br>
                    frame=    0 fps=0.0 q=0.0 Lsize=       0kB
                    time=00:00:00.00 bitrate=N/A speed=   0x    <br>
                    video:0kB audio:0kB subtitle:0kB other streams:0kB
                    global headers:0kB muxing overhead: unknown<br>
                    Output file is empty, nothing was encoded (check -ss
                    / -t / -frames parameters if used)<br>
                  </blockquote>
                </div>
              </blockquote>
            </div>
          </div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">well, I think framerate still 25 for 50i
            stream ....</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">can you re-check last line with framerate
            parameter removed or changed back to 25?</div>
          <div dir="auto"><br>
          </div>
        </div>
      </blockquote>
      <br>
      Ok, as this old post by my mistake already has been forwarded to
      the list and replied, I will follow it up later today, but need to
      rig rig up my camcorder and devices <br>
    </blockquote>
    <br>
    Finally ready, I had to recall a lot since 2023.<br>
    <br>
    ls /dev/video*<br>
    /dev/video0  /dev/video1  /dev/video2  /dev/video3<br>
    <br>
    <br>
    for i in /dev/video*; do echo "$i"; udevadm info --query=all
    --attribute-walk --name=$i | grep -E "name"; done<br>
    /dev/video0<br>
        ATTR{name}=="USB3.0 UHD: USB3.0 UHD"<br>
    /dev/video1<br>
        ATTR{name}=="USB3.0 UHD: USB3.0 UHD"<br>
    /dev/video2<br>
        ATTR{name}=="USB 2.0 Camera: HD 720P Webcam"<br>
    /dev/video3<br>
        ATTR{name}=="USB 2.0 Camera: HD 720P Webcam"<br>
    <br>
    <br>
    v4l2-ctl --list-devices<br>
    USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11.2):<br>
        /dev/video2<br>
        /dev/video3<br>
        /dev/media1<br>
    <br>
    USB3.0 UHD: USB3.0 UHD (usb-0000:00:14.0-3):<br>
        /dev/video0<br>
        /dev/video1<br>
        /dev/media0<br>
    <br>
    As seen the HDMI-USB3 capture card + the S-Video/HDMI converter
    (with the analog S-video camcorder) is now on /dev/video0<br>
    while the USB2 webcam is on /dev/video2<br>
    <br>
    ffplay can playback the S-video camcorder's imaging stream<br>
    <br>
    <blockquote>Default without framerate specified:<br>
      <br>
      ffplay -hide_banner -f video4linux2 /dev/video0<br>
      [video4linux2,v4l2 @ 0x7fe3c0000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
      Input #0, video4linux2,v4l2, from '/dev/video0':<br>
        Duration: N/A, start: 0.000000, bitrate: 398131 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      720x576, 398131 kb/s, 60 fps, 60 tbr, 1000k tbn<br>
      [video4linux2,v4l2 @ 0x7fe3c0000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
          Last message repeated 30 times<br>
      ^Cterje@localhost:~> d=   2 aq=    0KB vq=    0KB sq=    0B <br>
      <br>
      With 25 fps specified:<br>
      <br>
      ffplay -hide_banner -f video4linux2 -framerate 25 /dev/video0<br>
      [video4linux2,v4l2 @ 0x7f7fa8000c80] The driver changed the time
      per frame from 1/25 to 1/30<br>
      [video4linux2,v4l2 @ 0x7f7fa8000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
      Input #0, video4linux2,v4l2, from '/dev/video0':<br>
        Duration: N/A, start: 0.000000, bitrate: 199065 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      720x576, 199065 kb/s, 30 fps, 30 tbr, 1000k tbn<br>
      [video4linux2,v4l2 @ 0x7f7fa8000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
          Last message repeated 30 times<br>
      ^Cterje@localhost:~> d=   0 aq=    0KB vq=    0KB sq=    0B <br>
      <br>
      With 30 fps specified:<br>
      <br>
      ffplay -hide_banner -f video4linux2 -framerate 30 /dev/video0<br>
      [video4linux2,v4l2 @ 0x7f3878000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
      Input #0, video4linux2,v4l2, from '/dev/video0':<br>
        Duration: N/A, start: 0.000000, bitrate: 199065 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      720x576, 199065 kb/s, 30 fps, 30 tbr, 1000k tbn<br>
      [video4linux2,v4l2 @ 0x7f3878000c80] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
          Last message repeated 30 times<br>
    </blockquote>
    -----------------<br>
    <br>
    But empty output file with ffmpeg:<br>
    <br>
    With 25 fps specified<br>
    <blockquote>ffmpeg -hide_banner -f v4l2 -input_format yuyv422
      -video_size 720x576 -framerate 25 -i /dev/video0 -c:v mpeg2video
      -refs 1 -bf 2 -b:v 8M -maxrate 8M -minrate 8M -bufsize 20M
      -muxrate 11M -dc 10 -c:a pcm_dvd -f vob -t 20
      720x576_25fps_ms2130.mpg<br>
      [video4linux2,v4l2 @ 0x560fe5926740] The driver changed the time
      per frame from 1/25 to 1/30<br>
      [video4linux2,v4l2 @ 0x560fe5926740] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
      Input #0, video4linux2,v4l2, from '/dev/video0':<br>
        Duration: N/A, start: 0.000000, bitrate: 199065 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      720x576, 199065 kb/s, 30 fps, 30 tbr, 1000k tbn<br>
      Stream mapping:<br>
        Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video
      (native))<br>
      Press [q] to stop, [?] for help<br>
      [video4linux2,v4l2 @ 0x560fe5926740] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
          Last message repeated 30 times<br>
      [mpeg2video @ 0x560fe5927140] Warning vbv_delay will be set to
      0xFFFF (=VBR) as the specified vbv buffer is too large for the
      given bitrate!<br>
      Output #0, vob, to '720x576_25fps_ms2130.mpg':<br>
        Metadata:<br>
          encoder         : Lavf61.7.100<br>
        Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv,
      progressive), 720x576, q=2-31, 8000 kb/s, 30 fps, 90k tbn<br>
            Metadata:<br>
              encoder         : Lavc61.19.101 mpeg2video<br>
            Side data:<br>
              cpb: bitrate max/min/avg: 8000000/8000000/8000000 buffer
      size: 20000000 vbv_delay: N/A<br>
      [out#0/vob @ 0x560fe5928d00] video:0KiB audio:0KiB subtitle:0KiB
      other streams:0KiB global headers:0KiB muxing overhead: unknown<br>
      [out#0/vob @ 0x560fe5928d00] Output file is empty, nothing was
      encoded(check -ss / -t / -frames parameters if used)<br>
      frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A
      speed=N/A    <br>
    </blockquote>
    <br>
    Without framerate specified:<br>
    <blockquote>ffmpeg -hide_banner -f v4l2 -input_format yuyv422
      -video_size 720x576 -i /dev/video0 -c:v mpeg2video -refs 1 -bf 2
      -b:v 8M -maxrate 8M -minrate 8M -bufsize 20M -muxrate 11M -dc 10
      -c:a pcm_dvd -f vob -t 20 720x576_ms2130.mpg<br>
      [video4linux2,v4l2 @ 0x55e707fd8740] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
      Input #0, video4linux2,v4l2, from '/dev/video0':<br>
        Duration: N/A, start: 0.000000, bitrate: 398131 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      720x576, 398131 kb/s, 60 fps, 60 tbr, 1000k tbn<br>
      Stream mapping:<br>
        Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video
      (native))<br>
      Press [q] to stop, [?] for help<br>
      [video4linux2,v4l2 @ 0x55e707fd8740] Dequeued v4l2 buffer contains
      corrupted data (0 bytes).<br>
          Last message repeated 30 times<br>
      [mpeg2video @ 0x55e707fd9140] Warning vbv_delay will be set to
      0xFFFF (=VBR) as the specified vbv buffer is too large for the
      given bitrate!<br>
      Output #0, vob, to '720x576_ms2130.mpg':<br>
        Metadata:<br>
          encoder         : Lavf61.7.100<br>
        Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv,
      progressive), 720x576, q=2-31, 8000 kb/s, 60 fps, 90k tbn<br>
            Metadata:<br>
              encoder         : Lavc61.19.101 mpeg2video<br>
            Side data:<br>
              cpb: bitrate max/min/avg: 8000000/8000000/8000000 buffer
      size: 20000000 vbv_delay: N/A<br>
      [out#0/vob @ 0x55e707fdacc0] video:0KiB audio:0KiB subtitle:0KiB
      other streams:0KiB global headers:0KiB muxing overhead: unknown<br>
      [out#0/vob @ 0x55e707fdacc0] Output file is empty, nothing was
      encoded(check -ss / -t / -frames parameters if used)<br>
      frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A
      speed=N/A    <br>
    </blockquote>
    --------------<br>
    <br>
    On the other hand, capturing with the USB webcam creates output file<br>
    <br>
    Here with 50 fps specified<br>
    <blockquote>ffmpeg -hide_banner -f v4l2 -input_format yuyv422
      -video_size 720x576 -framerate 50 -i /dev/video2 -c:v mpeg2video
      -refs 1 -bf 2 -b:v 8M -maxrate 8M -minrate 8M -bufsize 20M
      -muxrate 11M -dc 10 -c:a pcm_dvd -f vob -t 20
      720x576_50p_ms2130.mpg<br>
      [video4linux2,v4l2 @ 0x56418fd52740] The V4L2 driver changed the
      video from 720x576 to 800x600<br>
      [video4linux2,v4l2 @ 0x56418fd52740] The driver changed the time
      per frame from 1/50 to 1/20<br>
      Input #0, video4linux2,v4l2, from '/dev/video2':<br>
        Duration: N/A, start: 1969.283514, bitrate: 153600 kb/s<br>
        Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
      800x600, 153600 kb/s, 20 fps, 20 tbr, 1000k tbn<br>
      Stream mapping:<br>
        Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video
      (native))<br>
      Press [q] to stop, [?] for help<br>
      [mpeg2video @ 0x56418fd53200] Warning vbv_delay will be set to
      0xFFFF (=VBR) as the specified vbv buffer is too large for the
      given bitrate!<br>
      Output #0, vob, to '720x576_50p_ms2130.mpg':<br>
        Metadata:<br>
          encoder         : Lavf61.7.100<br>
        Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv,
      progressive), 800x600, q=2-31, 8000 kb/s, 20 fps, 90k tbn<br>
            Metadata:<br>
              encoder         : Lavc61.19.101 mpeg2video<br>
            Side data:<br>
              cpb: bitrate max/min/avg: 8000000/8000000/8000000 buffer
      size: 20000000 vbv_delay: N/A<br>
      [out#0/vob @ 0x56418fd54e00] video:13281KiB audio:0KiB
      subtitle:0KiB other streams:0KiB global headers:0KiB muxing
      overhead: 1.230734%<br>
      frame=  284 fps= 22 q=2.0 Lsize=   13444KiB time=00:00:14.15
      bitrate=7783.3kbits/s dup=97 drop=0 speed=1.08x    <br>
      Exiting normally, received signal 2.<br>
      <br>
    </blockquote>
    <blockquote>ffprobe -hide_banner 720x576_50p_ms2130.mpg<br>
      Input #0, mpeg, from '720x576_50p_ms2130.mpg':<br>
        Duration: 00:00:14.20, start: 0.550000, bitrate: 7755 kb/s<br>
        Stream #0:0[0x1e0]: Video: mpeg2video (4:2:2), yuv422p(tv,
      progressive), 800x600 [SAR 1:1 DAR 4:3], 20 fps, 20 tbr, 90k tbn<br>
            Side data:<br>
              cpb: bitrate max/min/avg: 8000000/0/0 buffer size:
      20004864 vbv_delay: N/A<br>
      <br>
    </blockquote>
    <br>
    <br>
    <blockquote><br>
    </blockquote>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
  </body>
</html>