Den 04.05.2025 05:49, skrev Andrew Randrianasulu:


вс, 4 мая 2025 г., 01:37 Terje J. Hanssen <[email protected]>:


    Den 03.05.2025 13:00, skrev Terje J. Hanssen:

    Den 02.05.2025 21:42, skrev Andrew Randrianasulu:


    пт, 2 мая 2025 г., 22:37 Terje J. Hanssen <[email protected]>:

        https://www.mail-archive.com/[email protected]/msg05748.html

        I contine this new thread with an short extract from the
        long growing
        [Cin] ms2130 HDMI-USB3 UHD capture card - not quite as expected?

        But shouldn't a 422 and not a 420 output format be created?

            >> it seems in some cases ffmpeg not geared towards
            preserving most information, just picks up most commonly
            defined/first pixel format.
            >> Try mpeg2video as output codec, and/or specify pixel
            format (pix_fmt) more explicitly before output's filename?

            >>> Could you possibly examplify the latter?

            >>>> 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!

        -------------------------------

        Instead of 50i (pal interlaced fields), I try 50 fps
        (progressive) that at least is a pal frequence.

        And yes, it seems from the output that ffmpeg uses
        mpeg1video as default output codec.

        Furter I try to combine the current line

            ffmpeg -hide_banner -f v4l2 -input_format yuyv422
            -video_size 720x576 -framerate 25 -t 20 -i /dev/video2
            out-720x576_ms2130.mpeg


        with and utilize the syntax developed 2021 for "Blu-ray
        compliant MPEG-2 SD video with LPCM audio"

            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

        and for the current ongoing "DVD compliant MPEG-2 Video and
        PCM Audio"

            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

        to first

            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
            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.
            Error parsing options for input file /dev/video2.
            Error opening input files: Invalid argument


        and next revised with no output. That is I need help to
        debug the syntax error:

            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
            [video4linux2,v4l2 @ 0x55db770ef9c0] Dequeued v4l2
            buffer contains corrupted data (0 bytes).
            Input #0, video4linux2,v4l2, from '/dev/video2':
              Duration: N/A, start: 0.000000, bitrate: 331776 kb/s
              Stream #0:0: Video: rawvideo (YUY2 / 0x32595559),
            yuyv422, 720x576, 331776 kb/s, 50 fps, 50 tbr, 1000k tbn
            Stream mapping:
              Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video
            (native))
            Press [q] to stop, [?] for help
            [video4linux2,v4l2 @ 0x55db770ef9c0] Dequeued v4l2
            buffer contains corrupted data (0 bytes).
                Last message repeated 30 times
            [mpeg2video @ 0x55db77114f00] Warning vbv_delay will be
            set to 0xFFFF (=VBR) as the specified vbv buffer is too
            large for the given bitrate!
            Output #0, vob, to '720x576_50p_ms2130.mpg':
              Metadata:
                encoder         : Lavf59.27.100
              Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv,
            progressive), 720x576, q=2-31, 8000 kb/s, 50 fps, 90k tbn
                Metadata:
                  encoder         : Lavc59.37.100 mpeg2video
                Side data:
                  cpb: bitrate max/min/avg: 8000000/8000000/8000000
            buffer size: 20000000 vbv_delay: N/A
            frame=    0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00
            bitrate=N/A speed=   0x
            video:0kB audio:0kB subtitle:0kB other streams:0kB
            global headers:0kB muxing overhead: unknown
            Output file is empty, nothing was encoded (check -ss /
            -t / -frames parameters if used)


    well, I think framerate still 25 for 50i stream ....

    can you re-check last line with framerate parameter removed or
    changed back to 25?


    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

    Finally ready, I had to recall a lot since 2023.

    ls /dev/video*
    /dev/video0  /dev/video1  /dev/video2  /dev/video3


    for i in /dev/video*; do echo "$i"; udevadm info --query=all
    --attribute-walk --name=$i | grep -E "name"; done
    /dev/video0
        ATTR{name}=="USB3.0 UHD: USB3.0 UHD"
    /dev/video1
        ATTR{name}=="USB3.0 UHD: USB3.0 UHD"
    /dev/video2
        ATTR{name}=="USB 2.0 Camera: HD 720P Webcam"
    /dev/video3
        ATTR{name}=="USB 2.0 Camera: HD 720P Webcam"


    v4l2-ctl --list-devices
    USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11.2):
        /dev/video2
        /dev/video3
        /dev/media1

    USB3.0 UHD: USB3.0 UHD (usb-0000:00:14.0-3):
        /dev/video0
        /dev/video1
        /dev/media0

    As seen the HDMI-USB3 capture card + the S-Video/HDMI converter
    (with the analog S-video camcorder) is now on /dev/video0
    while the USB2 webcam is on /dev/video2



but what is on video1 ?

Nothing as far as I can see(?). It seems both camera devices allocate or are associated with three devices each.


it seems that whole thing fail at

Dequeued v4l2 buffer contains corrupted data (0 bytes).

I seems to happend when and after using unsupported fps

Does anything else (guvcview, vlc ..) process video stream this usb3 UHD device?

mplayer tv:// -demuxer tv ?

Not that I use, but have not haven't found a way to verify it.

However, I have recalled and found out more with progress.

The most important it seems required to reboot the machine with the camcorder ON (video signal) on beforehand, before ffmpeg get the video input.

Reboot also seems required to clean up v4L2 buffer after using unsupported fps ffplay or ffmpeg cause the
"Dequeued v4l2 buffer contains corrupted data (0 bytes)."
Hopefully there are a v4L command to easier cleanup the latter?

Beside the already listed Video4Linux devices, there are also

cat /proc/asound/cards

     0 [PCH_1          ]: HDA-Intel - HDA Intel PCH
                          HDA Intel PCH at 0x4200910000 irq 168
     1 [PCH            ]: HDA-Intel - HDA Intel PCH
                          HDA Intel PCH at 0x41300000 irq 169
     2 [UHD            ]: USB-Audio - USB3.0 UHD
                          MACROSILICON USB3.0 UHD at
   usb-0000:00:14.0-3, super speed
     3 [Camera         ]: USB-Audio - USB 2.0 Camera
                          Sonix Technology Co., Ltd. USB 2.0 Camera at
   usb-0000:00:14.0-11.2, high speed


However, so far ffmpeg has yet to find any audio streams via v4l2 as seen below. S-vido as well as audio L/R cables are connected between the camcorder out and A/D converter IN. Maybe additional configuration is required (I didn't think the separate sound card (Behringer U-Phono should be necessary)
----------

To list the v4l2 device capabilities;

v4l2-ctl -d /dev/video0 --list-formats-ext

   ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YUYV' (YUYV 4:2:2)
            Size: Discrete 1920x1080
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1600x1200
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1360x768
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1280x1024
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1280x960
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1280x720
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 1024x768
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 800x600
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 720x576
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 720x480
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)
            Size: Discrete 640x480
                Interval: Discrete 0.017s (60.000 fps)
                Interval: Discrete 0.020s (50.000 fps)
                Interval: Discrete 0.033s (30.000 fps)
                Interval: Discrete 0.050s (20.000 fps)
                Interval: Discrete 0.100s (10.000 fps)


That is supported 10-20-30-50-60 fps for all sizes, not 25 fps!
-------------

Try the same test for /dev/video1

v4l2-ctl -d /dev/video1 --list-formats-ext

   ioctl: VIDIOC_ENUM_FMT

===========

ffmpeg listed available formats (supported pixel formats, video formats, and frame sizes) for a particular input device:

ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0

[video4linux2,v4l2 @ 0x55a384b214c0] Raw       :     yuyv422 :           YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480
[in#0 @ 0x55a384b21200] Error opening input: Immediate exit requested
Error opening input file /dev/video0.

And similar test for /dev/video1

ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1

[video4linux2,v4l2 @ 0x557e1a5164c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device
[in#0 @ 0x557e1a516200] Error opening input: Inappropriate ioctl for device
Error opening input file /dev/video1.
Error opening input files: Inappropriate ioctl for device

===============

With supported 50 fps specified, ffplay playback looks ok visually:

ffplay -hide_banner -f v4l2 -input_format yuyv422 -video_size 720x576 -framerate 50 /dev/video0

   Input #0, video4linux2,v4l2, from '/dev/video0':B sq= 0B
      Duration: N/A, start: 311.577886, bitrate: 331776 kb/s
      Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
   720x576, 331776 kb/s, 50 fps, 50 tbr, 1000k tbn
   ^Cterje@localhost:/Videoklipp/HDMI-USB3_Capture>  sq=    0B

===============

Capture DVD compatible MPG video (no audio found) with supported 50 fps progressive video.
No Audio stream!?

ffmpeg -hide_banner -f v4l2 -input_format yuyv422 -video_size 720x576 -framerate 50 -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_50fps_ms2130.mpg

   Input #0, video4linux2,v4l2, from '/dev/video0':
      Duration: N/A, start: 323.195348, bitrate: 331776 kb/s
      Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
   720x576, 331776 kb/s, 50 fps, 50 tbr, 1000k tbn
   Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
   Press [q] to stop, [?] for help
   [mpeg2video @ 0x55e390580200] Warning vbv_delay will be set to
   0xFFFF (=VBR) as the specified vbv buffer is too large for the given
   bitrate!
   Output #0, vob, to '720x576_50fps_ms2130.mpg':
      Metadata:
        encoder         : Lavf61.7.100
      Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, progressive),
   720x576, q=2-31, 8000 kb/s, 50 fps, 90k tbn
          Metadata:
            encoder         : Lavc61.19.101 mpeg2video
          Side data:
            cpb: bitrate max/min/avg: 8000000/8000000/8000000 buffer
   size: 20000000 vbv_delay: N/A
   [out#0/vob @ 0x55e390581e00] video:18921KiB audio:0KiB subtitle:0KiB
   other streams:0KiB global headers:0KiB muxing overhead: 1.242550%
   frame= 1000 fps= 50 q=2.5 Lsize=   19156KiB time=00:00:19.98
   bitrate=7854.2kbits/s speed=0.998x


Stopped automatic ! Why?

----------------

du -sh *

   19M    720x576_50fps_ms2130.mpg


ffprobe -hide_banner 720x576_50fps_ms2130.mpg

   Input #0, mpeg, from '720x576_50fps_ms2130.mpg':
      Duration: 00:00:20.00, start: 0.520000, bitrate: 7846 kb/s
      Stream #0:0[0x1e0]: Video: mpeg2video (4:2:2), yuv422p(tv,
   progressive), 720x576 [SAR 1:1 DAR 5:4], 50 fps, 50 tbr, 90k tbn
          Side data:
            cpb: bitrate max/min/avg: 8000000/0/0 buffer size: 20004864
   vbv_delay: N/A


The video file playback looks ok with correct SD aspect ratio using ffplay and VLC, though "1080P" is printer near the top-right corner.

============================




-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to