Analog S-Video or HDV capture via HDMI-USB to FFV1.mkv in realtime
I have no plan to compete with our National Library located locally here :) https://www-nrk-no.translate.goog/nordland/her-skal-den-norske-kulturarven-b... but I prepare myself to test and use one method left with regards to "Personal Video Archiving". Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language): 1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... * Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned. 2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625 * The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling, Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!? 3.1 FFmpeg recipe (PAL) ffmpeg -i VIDEO_IN \ -c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv 3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1 Copy audio "as-is" and use FFV1.3 as video codec. Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on: ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video> 3.3 Various Encoding examples for Video capture from USB camera /dev/video0: ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv Check that video is captured properly using ffplay: ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay - Check the overall flow using ffplay before capturing: ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay - 4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below: http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup. Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013) Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5> Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5> PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed. Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here? 5. Related 2021-[Cin] threads as background references [Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html [Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html [Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html [Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html [Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
I have no plan to compete with our National Library located locally here :) https://www-nrk-no.translate.goog/nordland/her-skal-den-norske-kulturarven-b...
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
While awaiting the HDMI-USB3 capture dongle next week, I have tested to transcode a couple of video files to FFV1/MKV. In lack of available uncompressed 10-bit 422 video files (like v210), I have used two previous encoded 10-bit ProRes-422HQ (denoted visually or near lossless compression) as input files, to see what happens. Input files: ------------ du -sh *.mov 40G Hi8_tape_1_1992+1993.mov # converted to SD from PAL analog Hi8/S-Video, Sony CCD-TR2000E 1,7G hd01.mov # a short FHD clip from Sony FX7E camcorder directly via EIP & HDMI # The Imaging Processor works at 1920x1080 in a 4:2:2 colorspace. ffmpeg -i Hi8_tape_1_1992+1993.mov 2>&1 >/dev/null | egrep "Video|Audio|Duration" Duration: 01:11:25.28, start: 0.000000, bitrate: 79566 kb/s Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 720x576, 61100 kb/s, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 2500 tbn, 2500 tbc (default) handler_name : Apple Video Media Handler Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default) ffmpeg -i hd01.mov 2>&1 >/dev/null | egrep "Video|Audio|Duration" Duration: 00:01:11.24, start: 0.000000, bitrate: 200607 kb/s Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080, 182130 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 2500 tbn, 2500 tbc (default) handler_name : Apple Video Media Handler Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default) Transcoding to FFV1/MKV: ------------------------ ffmpeg -i Hi8_tape_1_1992+1993.mov -acodec copy -vcodec ffv1 -level 3 -threads 8 -coder 1 -context 1 -g 1 -slices 24 -slicecrc 1 Hi8_tape_1_1992+1993_ffv1.mkv ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (SUSE Linux) ................... [prores @ 0x5613af6cef40] error, wrong slice data size26.64 bitrate=131749.8kbits/s speed=3.88x [prores @ 0x5613af6cef40] error decoding picture header Error while decoding stream #0:0: Invalid data found when processing input frame=107131 fps= 95 q=-0.0 Lsize=70256226kB time=01:11:25.27 bitrate=134306.1kbits/s speed=3.82x video:60607655kB audio:9641880kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.009525% # 18.5 minutes on a fast internal SSD nvme0n1 Samsung model: MZVPV512HDG # (26 minutes on a USB3 Expansion HDD Seagate, %CPU (top): 610-280, FFMpeg speed: 3.92x-2.68x) ffmpeg -i hd01.mov -acodec copy -vcodec ffv1 -level 3 -threads 8 -coder 1 -context 1 -g 1 -slices 24 -slicecrc 1 hd01_ffv1.mkv ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (SUSE Linux) .............. frame= 1781 fps= 23 q=-0.0 Lsize= 4495998kB time=00:01:11.27 bitrate=516733.5kbits/s speed=0.929x video:4335507kB audio:160380kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002472% # ca. 2 minutes on a fast internal SSD nvme0n1 Samsung model: MZVPV512HDG Output files: ------------- du -sh *.mkv 4,3G hd01_ffv1.mkv 68G Hi8_tape_1_1992+1993_ffv1.mkv ffmpeg -i Hi8_tape_1_1992+1993_ffv1.mkv 2>&1 >/dev/null | egrep "Video|Audio|Duration" Duration: 01:11:25.28, start: 0.000000, bitrate: 134306 kb/s Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 720x576, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) HANDLER_NAME : Apple Video Media Handler Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default) ffmpeg -i hd01_ffv1.mkv 2>&1 >/dev/null | egrep "Video|Audio|Duration" Duration: 00:01:11.28, start: 0.000000, bitrate: 516719 kb/s Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv422p10le(tv, bt709/unknown/unknown, top coded first (swapped)), 1920x1080, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) HANDLER_NAME : Apple Video Media Handler Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, hexadecagonal, s32 (24 bit), 18432 kb/s (default) Summary and comments: --------------------- As seen above the SD (Hi8) output FFV1.MKV file has grown with 78/ 40 = 1.7 compared with the input ProRes.mov file, while the HD output file has grown with 4.3/ 1.7 = 2.5 compared with the input ProRes.mov clip. Possibly not as expected, but decoding the compressed ProRes first might not be optimum. At least I hope that encoding both from a common, lossless codec like v210 or more actual from an input video stream, would have shown another, closer picture?
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera". I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service. But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual): 1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running. 2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI. That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback. Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this? Another (setup) problem, there was no audio recorded or heard during playback!? In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick. Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 ----------------------------- lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera -------------------- ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3 ----------------------- v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3 USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1 ------------------------- ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ---------------- v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0 ----------------- v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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) Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) ......... Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10 ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5 ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5 Recorded test video files and probing formats: --------------------------------------------- du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv ----------------------------- ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 ----------- ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 -------------- ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ---------------- ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000 ---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg? Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
- The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. - Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013) Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps: ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5 I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc. The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive. it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ... https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
- The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. - Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013) Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax |ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov| but it didn't work for me, just quitted ffmpeg with Unrecognized option 'timestamps'. Error splitting the argument list: Option not found Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg * video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available. But what should be set as input_format in this case?
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
- The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. - Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013) Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:( sorry, may be ask on ffmpeg support channel then? p.s. fake 1080@60 usb dongles def. exist, made me sad https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/ p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else? https://github.com/BertoldVdb/ms-tools "Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
- The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. - Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013) Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.) https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
* Fluid video recordings without delays or distortions during live streaming * Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000 Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files? inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
* The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. * Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB camera /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 output_data.mkv
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le \ -f matroska output_video.mkv
Check that video is captured properly using ffplay:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -r 25 -thread_queue_size 1024 -i $VIDEO \ -codec copy -f matroska - | ffplay -
Check the overall flow using ffplay before capturing:
ffmpeg -ar 44100 -thread_queue_size 1024 -f alsa -i $AUDIO \ -itsoffset -0.5 -r 25 -thread_queue_size 1024 -i $VIDEO \ -filter_complex 'channelmap=FL-0' -filter_complex 'crop=w=700:h=556:x=8:y=0' \ -map 1:v -map 0:a -codec:v ffv1 -codec:a pcm_s16le \ -f matroska - | ffplay -
4, Regarding FFV1 lossless compression in realtime Comparison tests (2013/2015) have shown that FFV1 produced the smallest files at the fastest speed. It can be used to capture SD material in realtime, and HD possibly, too. This according to a 2012/2015 article, where I have extracted the results for FFV1 v.3 in the tables below:
http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#c... NOTE: This is a consumer grade, off-the-shelf PC setup.
Hardware: CPU: Intel(R) QuadCore(TM) i7-2600K CPU @ 3.40GHz RAM: 8 GB Disk: Intel SSDSA2CW080G3 (SSD) Software: Operating System: GNU/Linux (Xubuntu 12.04.1, 64bit) Transcoding tool: FFmpeg (version git N-59183-g3e62654, Dec 17 2013)
Video source file: VQEG reference video "football" <http://media.xiph.org/video/derf/y4m/football_422_ntsc.y4m> (NTSC-SD, 720x486px, 30fps, yuv422p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 216 fps 277 fps 111 MiB 46.1% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/football-720x486i30/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
Video source file: SVT reference video "park joy" <http://media.xiph.org/video/derf/y4m/park_joy_1080p50.y4m> (full-HD/1080p, 1920x1080px, 50fps, yuv420p, 8bpc) Codec Encoding Decoding Filesize % of uncompressed Implementation Details FFV1 <http://www.av-rd.com/knowhow/video/comparison_video_codecs_containers.html#codec_ffv1> (version 3) 31 fps 63 fps 879 MiB 57.2% libavcodec (FFmpeg) <http://en.wikipedia.org/wiki/Libavcodec> log <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.log>, framemd5 <http://www.av-rd.com/knowhow/video/test_results/park_joy-1920x1080p50/ffv1.3-libavcodec_ffmpeg_avi.framemd5>
PAL-SD 720x576 stored as YUV422, 10 bpc (bits per component), instead of the tested 8 bpc above, seems to me would have enlarged the the filesizes with about 25%, or to about 40 GB/hr with FFV1 lossless compressed.
Although the FFV1 compression results above obviously used yuv422p, 8bps source SD and FHD files as input, it seems for me that the encoding speeds at 216 fps and 31 fps for SD and FHD respectively, assumingly should manage realtime FFV1 encoding and streaming of PAL SD and HDV at 25 fps as well, especially with a faster i7-6700 x 8 cpu. Comments here?
5. Related 2021-[Cin] threads as background references
[Cin] hdmi capture card (with v4l2) https://www.mail-archive.com/[email protected]/msg02865.html
[Cin] offtopic: Digitize and record Video with A/D USB adapters https://www.mail-archive.com/[email protected]/msg03269.html
[Cin] offtopic: HDMI capture https://www.mail-archive.com/[email protected]/msg02084.html
[Cin] Is SD and HD 422 Video Capture obtainable with V4L(2)? https://www.mail-archive.com/[email protected]/msg03719.html
[Cin] Uncompressed video to lossless compression FFV1/MKV https://www.mail-archive.com/[email protected]/msg03791.html
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches: https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210... something like this but find/use your own alsa device :) for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
2) Scart AV SV to HDMI Converter Switcher S Video Composite RCA DVD HD TV adapter (3-4 weeks delivery time https://www.ebay.com.au/itm/295472602625
- The 3-in-1 S-/video/RCA/SCART to HDMI converter is a universal converter for analog video input to HDMI output. - Analog to digital converter (ADC), 10 bits maximum 1,62 MSPS sampling,
Q I have not yet found a definitiv ffmpeg FFV1 v 3 syntax guide for SD and HDV capturing and hope for suggestions and comments here!?
3.1 FFmpeg recipe (PAL)
ffmpeg -i VIDEO_IN \
-c:v ffv1 -level 3 -coder 1 -context 0 -slices 24 -slicecrc 1 \ -color_primaries bt470bg \ -color_trc bt709 \ -colorspace bt470bg \ -color_range mpeg \ -map 0 \ -top 1 \ -c:a copy \ -g 1 -pix_fmt + \ VIDEO_OUT.mkv
3.2 Reference Example https://trac.ffmpeg.org/wiki/Encode/FFV1
Copy audio "as-is" and use FFV1.3 as video codec.
Parameters are 8 threads, coder=1, context=1, GOP-size=1, 24 slices and slice-CRC on:
ffmpeg -i <input_video> \ -acodec copy \ -vcodec ffv1 -level 3 \ -threads 8 \ -coder 1 \ -context 1 \ -g 1 \ -slices 24 \ -slicecrc 1 \ <output_video>
3.3 Various Encoding examples for Video capture from USB
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin <[email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen: > .......
> but I prepare myself to test and use one > method left with regards to "Personal Video > Archiving". > > Therefore I have ordered two selected, > inexpensive devices (the urls here are just > for English language): > > 1) Capture Card USB HDMI 4K to 1080P USB-C > adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and > 1080p FHD.) > https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... > > * Fluid video recordings without delays or > distortions during live streaming > * Linux not mentioned, but assumed this is > a standard supported UVC. OBS and VLC is > mentioned. >
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found: ffmpeg \ -f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA -f pulse -ac 2 -i default https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41... Suggestions here what to use from the listing below? cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17 arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, ALC892 Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC892 Analog Front output / input
for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:53.400000000 ----------------
ffprobe -hide_banner 1920x1080_v210.mkv [matroska,webm @ 0x5563ca6d30c0] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, matroska,webm, from '1920x1080_v210.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:41.40, start: 0.000000, bitrate: 221185 kb/s Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(tv, progressive), 1920x1080, 5 fps, 1k tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 v210 DURATION : 00:00:41.400000000
---------------------------
> > 2) Scart AV SV to HDMI Converter Switcher S > Video Composite RCA DVD HD TV adapter (3-4 > weeks delivery time > https://www.ebay.com.au/itm/295472602625 > > * The 3-in-1 S-/video/RCA/SCART to HDMI > converter is a universal converter for > analog video input to HDMI output. > * Analog to digital converter (ADC), 10 > bits maximum 1,62 MSPS sampling, > > > > Q I have not yet found a definitiv ffmpeg > FFV1 v 3 syntax guide for SD and HDV > capturing and hope for suggestions and > comments here!? > > 3.1 FFmpeg recipe (PAL) > > ffmpeg -i VIDEO_IN \ > > -c:v ffv1 -level 3 -coder 1 -context > 0 -slices 24 -slicecrc 1 \ > -color_primaries bt470bg \ > -color_trc bt709 \ > -colorspace bt470bg \ > -color_range mpeg \ > -map 0 \ > -top 1 \ > -c:a copy \ > -g 1 -pix_fmt + \ > VIDEO_OUT.mkv > > > 3.2 Reference Example > https://trac.ffmpeg.org/wiki/Encode/FFV1 > > Copy audio "as-is" and use FFV1.3 as > video codec. > > Parameters are 8 threads, coder=1, > context=1, GOP-size=1, 24 slices and > slice-CRC on: > > ffmpeg -i <input_video> \ > -acodec copy \ > -vcodec ffv1 -level 3 \ > -threads 8 \ > -coder 1 \ > -context 1 \ > -g 1 \ > -slices 24 \ > -slicecrc 1 \ > <output_video> > > > 3.3 Various Encoding examples for Video > capture from USB
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
Den 02.02.2023 01:46, skrev Terje J. Hanssen:
.......
but I prepare myself to test and use one method left with regards to "Personal Video Archiving".
Therefore I have ordered two selected, inexpensive devices (the urls here are just for English language):
1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB 3.2/3.1/3.0, 60 Hz and 1080p FHD.)
https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca...
- Fluid video recordings without delays or distortions during live streaming - Linux not mentioned, but assumed this is a standard supported UVC. OBS and VLC is mentioned.
Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is received. It promises: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. Transform high-quality video cameras into a high-resolution USB web camera".
I have done a quick, first test using my Sony HDR-FX7E camera. This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette deck is broken and needs repair service.
But according to Steve Mullen's V1 and FX7 handbook (not mentioned in the manual):
1. When the camera is operating, the EIP (Enhanced Image Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via component-out. Therefore, you can record 4:2:2 live HD video from the camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, PCM, 16-bit, 48kHz audio When the camera is running.
2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI chip downscales 1440 to 1280 while it up-scales 540 to 720. The result is 720p50 or 720p60, which is output via HDMI.
That is, I have tested section 1 now, but see now that I didn't test 1440x1080 resolution. The only resolution I got to work at 25 fps was 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps and 5 fps respectively by the driver and caused jumpy playback.
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
Someone here that have suggestion to possibly modified syntax or can verify that the driver doesn't manage this?
Another (setup) problem, there was no audio recorded or heard during playback!?
In the following I list the test command syntax I've collectedf and tried with shortened output (yet long): To explain, I have also another USB 2.0 Webcam connected, beside the new HDMI-USB3 Videstick.
Verify the devices, drivers and formats: --------------------------------------- dmesg | tail [22706.060759] perf: interrupt took too long (2521 > 2500), lowering kernel.perf_event_max_sample_rate to 79250 [32105.561575] perf: interrupt took too long (3158 > 3151), lowering kernel.perf_event_max_sample_rate to 63250 [40586.477420] usb 1-5: USB disconnect, device number 2 [40599.099612] usb 1-5: new high-speed USB device number 5 using xhci_hcd [40599.250960] usb 1-5: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00 [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [40599.250978] usb 1-5: Product: USB Video [40599.250984] usb 1-5: Manufacturer: MACROSILICON [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 -----------------------------
lsusb Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' E: DEVNAME=/dev/video0 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video1 E: ID_V4L_PRODUCT=USB Video: USB Video E: DEVNAME=/dev/video2 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam E: DEVNAME=/dev/video3 E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam
lsusb | egrep 'Video|Camera' Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video Bus 001 Device 004: ID 0c45:6340 Microdia Camera
--------------------
ll /dev/video* crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3
-----------------------
v4l2-ctl --list-devices USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): /dev/video2 /dev/video3
USB Video: USB Video (usb-0000:00:14.0-5): /dev/video0 /dev/video1
-------------------------
ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 1280x720 1024x768 800x600 720x576 720x480 640x480 /dev/video0: Immediate exit requested
ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): Inappropriate ioctl for device /dev/video1: Inappropriate ioctl for device ----------------
v4l2-ctl --all Driver Info (not using libv4l2): Driver name : uvcvideo Card type : USB Video: USB Video Bus info : usb-0000:00:14.0-5 Driver version: 5.14.21 Capabilities : 0x84A00001 Video Capture Metadata Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Priority: 2 Video input : 0 (Camera 1: ok) Format Video Capture: Width/Height : 1920/1080 Pixel Format : 'MJPG' Field : None Bytes per Line : 0 Size Image : 4147200 Colorspace : sRGB Transfer Function : Rec. 709 YCbCr/HSV Encoding: ITU-R 601 Quantization : Default (maps to Full Range) Flags : Crop Capability Video Capture: Bounds : Left 0, Top 0, Width 1920, Height 1080 Default : Left 0, Top 0, Width 1920, Height 1080 Pixel Aspect: 1/1 Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 Streaming Parameters Video Capture: Capabilities : timeperframe Frames per second: 30.000 (30/1) Read buffers : 0 brightness 0x00980900 (int) : min=-128 max=127 step=1 default=-11 value=-11 contrast 0x00980901 (int) : min=0 max=255 step=1 default=148 value=148 saturation 0x00980902 (int) : min=0 max=255 step=1 default=180 value=180 hue 0x00980903 (int) : min=-128 max=127 step=1 default=0 value=0
-----------------
v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'MJPG' (compressed) Name : Motion-JPEG Size: Discrete 1920x1080 Interval: Discrete 0.017s (60.000 fps) Interval: Discrete 0.033s (30.000 fps) Interval: Discrete 0.040s (25.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 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)
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default
https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device? for -f alsa try -i hw:CARD=MS2109,DEV=0 default audio should be 2 ch/48khz pcm see https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-... Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, ALC892 Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC892 Analog Front output / input
for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
Index : 1 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps) ...... Size: Discrete 1280x720 Interval: Discrete 0.100s (10.000 fps) ....... Size: Discrete 720x576 Interval: Discrete 0.040s (25.000 fps) Interval: Discrete 0.050s (20.000 fps) Interval: Discrete 0.100s (10.000 fps) Interval: Discrete 0.200s (5.000 fps) .........
Encoding: -------- ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 720x576_ffv1.mkv
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1280x720_ffv1.mkv [video4linux2,v4l2 @ 0x559d031190c0] The driver changed the time per frame from 1/25 to 1/10
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -codec:a pcm_s16le -f matroska 1920x1080_ffv1.mkv [video4linux2,v4l2 @ 0x55ce18d060c0] The driver changed the time per frame from 1/25 to 1/5
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
Recorded test video files and probing formats: ---------------------------------------------
du -sh * 258M 1280x720_ffv1.mkv 292M 1920x1080_ffv1.mkv 1,1G 1920x1080_v210.mkv 61M 720x576_ffv1.mkv -----------------------------
ffprobe -hide_banner 720x576_ffv1.mkv Input #0, matroska,webm, from '720x576_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:09.20, start: 0.000000, bitrate: 55385 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:09.200000000 -----------
ffprobe -hide_banner 1280x720_ffv1.mkv Input #0, matroska,webm, from '1280x720_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:38.90, start: 0.000000, bitrate: 55512 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:38.900000000 --------------
ffprobe -hide_banner 1920x1080_ffv1.mkv Input #0, matroska,webm, from '1920x1080_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:53.40, start: 0.000000, bitrate: 45747 kb/s Stream #0:0: Video: ffv1 (FFV1 /
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu: > > > ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen > via Cin <[email protected]>: > > > > Den 02.02.2023 01:46, skrev Terje J. > Hanssen: >> ....... > >> but I prepare myself to test and use >> one method left with regards to >> "Personal Video Archiving". >> >> Therefore I have ordered two selected, >> inexpensive devices (the urls here are >> just for English language): >> >> 1) Capture Card USB HDMI 4K to 1080P >> USB-C adapter (Speedy USB 3.2/3.1/3.0, >> 60 Hz and 1080p FHD.) >> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >> >> * Fluid video recordings without >> delays or distortions during live >> streaming >> * Linux not mentioned, but assumed >> this is a standard supported UVC. >> OBS and VLC is mentioned. >> > > Then the first item, Hama Video > Recording Stick, HDMI 4k - USB3.x is > received. It promises: > "Fluid video recordings without delays > or distortions during live streaming, > thanks to a picture frequency of 60 Hz > and 1080p with Full HD. Transform > high-quality video cameras into a > high-resolution USB web camera". > > I have done a quick, first test using my > Sony HDR-FX7E camera. This is a HDV > 1080i camcorder with MPEG-2 video > compression at 25 mbps on tape > 1440x1080, 50i25fps, 4:2:0 and MP2 > stereo audio. Currently it's cassette > deck is broken and needs repair service. > > But according to Steve Mullen's V1 and > FX7 handbook (not mentioned in the manual): > > 1. When the camera is operating, the > EIP (Enhanced Image Processor) > generates uncompressed 1440x1080i > with a 4:2:2 color space. Digital > 4:2:2 data are output via the HDMI > port while 4:2:2 analog is output > via component-out. Therefore, you > can record 4:2:2 live HD video from > the camera without MPEG-2 > compression. V1 and FX7 provide an > HDMI output port that carries > uncompressed 4:2:2, 8-bit, digital > video plus dual-channel, PCM, > 16-bit, 48kHz audio When the camera > is running. > > 2. If you are playing a 1080i50 or > 1080i60 HDV tape. The 4:2:0 MPEG-2 > is decoded and chroma up-scaled to a > 4:2:2. The HDMI > chip downscales 1440 to 1280 while > it up-scales 540 to 720. The result > is 720p50 or 720p60, which is output > via HDMI. > > That is, I have tested section 1 now, > but see now that I didn't test 1440x1080 > resolution. The only resolution I got to > work at 25 fps was 720x576 (SD), while > HD 1280x720 and FHD 1920x1080 were set > down to 10 fps and 5 fps respectively by > the driver and caused jumpy playback. > > > Did you tried to force specific format > (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam. https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
> Also look out for usb2 vs usb3 ports? > Shouldn't capture device hang on bus 002 > (usb 3.0) root hub, instead of bus 001 (usb > 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
> > > > Someone here that have suggestion to > possibly modified syntax or can verify > that the driver doesn't manage this? > > Another (setup) problem, there was no > audio recorded or heard during playback!? > > In the following I list the test command > syntax I've collectedf and tried with > shortened output (yet long): > To explain, I have also another USB 2.0 > Webcam connected, beside the new > HDMI-USB3 Videstick. > > Verify the devices, drivers and formats: > --------------------------------------- > dmesg | tail > [22706.060759] perf: interrupt took too > long (2521 > 2500), lowering > kernel.perf_event_max_sample_rate to 79250 > [32105.561575] perf: interrupt took too > long (3158 > 3151), lowering > kernel.perf_event_max_sample_rate to 63250 > [40586.477420] usb 1-5: USB disconnect, > device number 2 > [40599.099612] usb 1-5: new high-speed > USB device number 5 using xhci_hcd > [40599.250960] usb 1-5: New USB device > found, idVendor=534d, idProduct=2109, > bcdDevice=21.00 > [40599.250972] usb 1-5: New USB device > strings: Mfr=1, Product=2, SerialNumber=0 > [40599.250978] usb 1-5: Product: USB Video > [40599.250984] usb 1-5: Manufacturer: > MACROSILICON > [40599.252310] usb 1-5: Found UVC 1.00 > device USB Video (534d:2109) > [40599.256234] hid-generic > 0003:534D:2109.0006: hiddev96,hidraw0: > USB HID v1.10 Device [MACROSILICON USB > Video] on usb-0000:00:14.0-5/input4 > ----------------------------- > > lsusb > Bus 002 Device 003: ID 05e3:0732 Genesys > Logic, Inc. All-in-One Cardreader > Bus 002 Device 002: ID 0bc2:2038 Seagate > RSS LLC Expansion HDD > Bus 002 Device 001: ID 1d6b:0003 Linux > Foundation 3.0 root hub > Bus 001 Device 003: ID 046d:c534 > Logitech, Inc. Unifying Receiver > Bus 001 Device 005: ID 534d:2109 > MacroSilicon USB Video > Bus 001 Device 004: ID 0c45:6340 > Microdia Camera > Bus 001 Device 001: ID 1d6b:0002 Linux > Foundation 2.0 root hub > > > udevadm info /dev/video* | egrep > 'DEVNAME|ID_V4L_PRODUCT' > E: DEVNAME=/dev/video0 > E: ID_V4L_PRODUCT=USB Video: USB Video > E: DEVNAME=/dev/video1 > E: ID_V4L_PRODUCT=USB Video: USB Video > E: DEVNAME=/dev/video2 > E: ID_V4L_PRODUCT=USB 2.0 Camera: HD > 720P Webcam > E: DEVNAME=/dev/video3 > E: ID_V4L_PRODUCT=USB 2.0 Camera: HD > 720P Webcam > > lsusb | egrep 'Video|Camera' > Bus 001 Device 005: ID 534d:2109 > MacroSilicon USB Video > Bus 001 Device 004: ID 0c45:6340 > Microdia Camera > > -------------------- > > ll /dev/video* > crw-rw----+ 1 root video 81, 0 feb. 7 > 20:22 /dev/video0 > crw-rw----+ 1 root video 81, 1 feb. 7 > 20:22 /dev/video1 > crw-rw----+ 1 root video 81, 2 feb. 7 > 09:05 /dev/video2 > crw-rw----+ 1 root video 81, 3 feb. 7 > 09:05 /dev/video3 > > ----------------------- > > v4l2-ctl --list-devices > USB 2.0 Camera: HD 720P Webcam > (usb-0000:00:14.0-11): > /dev/video2 > /dev/video3 > > USB Video: USB Video (usb-0000:00:14.0-5): > /dev/video0 > /dev/video1 > > ------------------------- > > ffmpeg -f v4l2 -list_formats all -i > /dev/video0 > ffmpeg -hide_banner -f v4l2 > -list_formats all -i /dev/video0 > [video4linux2,v4l2 @ 0x556cf63570c0] > Compressed: mjpeg : Motion-JPEG : > 1920x1080 1600x1200 1360x768 1280x1024 > 1280x960 1280x720 1024x768 800x600 > 720x576 720x480 640x480 > [video4linux2,v4l2 @ 0x556cf63570c0] > Raw : yuyv422 : YUYV 4:2:2 : > 1920x1080 1600x1200 1360x768 1280x1024 > 1280x960 1280x720 1024x768 800x600 > 720x576 720x480 640x480 > /dev/video0: Immediate exit requested > > ffmpeg -hide_banner -f v4l2 > -list_formats all -i /dev/video1 > [video4linux2,v4l2 @ 0x5560c0bc70c0] > ioctl(VIDIOC_G_INPUT): Inappropriate > ioctl for device > /dev/video1: Inappropriate ioctl for device > ---------------- > > v4l2-ctl --all > Driver Info (not using libv4l2): > Driver name : uvcvideo > Card type : USB Video: USB Video > Bus info : usb-0000:00:14.0-5 > Driver version: 5.14.21 > Capabilities : 0x84A00001 > Video Capture > Metadata Capture > Streaming > Extended Pix Format > Device Capabilities > Device Caps : 0x04200001 > Video Capture > Streaming > Extended Pix Format > Priority: 2 > Video input : 0 (Camera 1: ok) > Format Video Capture: > Width/Height : 1920/1080 > Pixel Format : 'MJPG' > Field : None > Bytes per Line : 0 > Size Image : 4147200 > Colorspace : sRGB > Transfer Function : Rec. 709 > YCbCr/HSV Encoding: ITU-R 601 > Quantization : Default (maps to Full Range) > Flags : > Crop Capability Video Capture: > Bounds : Left 0, Top 0, Width 1920, > Height 1080 > Default : Left 0, Top 0, Width 1920, > Height 1080 > Pixel Aspect: 1/1 > Selection: crop_default, Left 0, Top 0, > Width 1920, Height 1080 > Selection: crop_bounds, Left 0, Top 0, > Width 1920, Height 1080 > Streaming Parameters Video Capture: > Capabilities : timeperframe > Frames per second: 30.000 (30/1) > Read buffers : 0 > brightness > 0x00980900 (int) : min=-128 max=127 > step=1 default=-11 value=-11 > contrast > 0x00980901 (int) : min=0 max=255 > step=1 default=148 value=148 > saturation > 0x00980902 (int) : min=0 max=255 > step=1 default=180 value=180 > hue > 0x00980903 (int) : min=-128 max=127 > step=1 default=0 value=0 > > ----------------- > > v4l2-ctl --list-formats-ext > ioctl: VIDIOC_ENUM_FMT > Index : 0 > Type : Video Capture > Pixel Format: 'MJPG' (compressed) > Name : Motion-JPEG > Size: Discrete 1920x1080 > Interval: > Discrete 0.017s (60.000 fps) > Interval: > Discrete 0.033s (30.000 fps) > Interval: > Discrete 0.040s (25.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 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) >
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax? ffmpeg \ -codec:a pcm_s16le Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there. Thanks for useful help!
see https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, ALC892 Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC892 Analog Front output / input
for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
> > Index : 1 > Type : Video Capture > Pixel Format: 'YUYV' > Name : YUYV 4:2:2 > Size: Discrete 1920x1080 > Interval: > Discrete 0.200s (5.000 fps) > ...... > Size: Discrete 1280x720 > Interval: > Discrete 0.100s (10.000 fps) > ....... > Size: Discrete 720x576 > Interval: > Discrete 0.040s (25.000 fps) > Interval: > Discrete 0.050s (20.000 fps) > Interval: > Discrete 0.100s (10.000 fps) > Interval: > Discrete 0.200s (5.000 fps) > ......... > > Encoding: > -------- > ffmpeg -hide_banner -f v4l2 -framerate > 25 -video_size 720x576 -i /dev/video0 > -codec:v ffv1 -codec:a pcm_s16le -f > matroska 720x576_ffv1.mkv > > ffmpeg -hide_banner -f v4l2 -framerate > 25 -video_size 1280x720 -i /dev/video0 > -codec:v ffv1 -codec:a pcm_s16le -f > matroska 1280x720_ffv1.mkv > [video4linux2,v4l2 @ 0x559d031190c0] The > driver changed the time per frame from > 1/25 to 1/10 > > ffmpeg -hide_banner -f v4l2 -framerate > 25 -video_size 1920x1080 -i /dev/video0 > -codec:v ffv1 -codec:a pcm_s16le -f > matroska 1920x1080_ffv1.mkv > [video4linux2,v4l2 @ 0x55ce18d060c0] The > driver changed the time per frame from > 1/25 to 1/5 > > ffmpeg -hide_banner -f v4l2 -framerate > 25 -video_size 1920x1080 -i /dev/video0 > -codec:v v210 -codec:a pcm_s16le -f > matroska 1920x1080_v210.mkv > [video4linux2,v4l2 @ 0x55944900e0c0] The > driver changed the time per frame from > 1/25 to 1/5 > > > Recorded test video files and probing > formats: > --------------------------------------------- > > du -sh * > 258M 1280x720_ffv1.mkv > 292M 1920x1080_ffv1.mkv > 1,1G 1920x1080_v210.mkv > 61M 720x576_ffv1.mkv > ----------------------------- > > > ffprobe -hide_banner 720x576_ffv1.mkv > Input #0, matroska,webm, from > '720x576_ffv1.mkv': > Metadata: > ENCODER : Lavf58.76.100 > Duration: 00:00:09.20, start: > 0.000000, bitrate: 55385 kb/s > Stream #0:0: Video: ffv1 (FFV1 / > 0x31564646), yuv422p(tv, progressive), > 720x576, 25 fps, 25 tbr, 1k tbn, 1k tbc > (default) > Metadata: > ENCODER : Lavc58.134.100 ffv1 > DURATION : 00:00:09.200000000 > ----------- > > ffprobe -hide_banner 1280x720_ffv1.mkv > Input #0, matroska,webm, from > '1280x720_ffv1.mkv': > Metadata: > ENCODER : Lavf58.76.100 > Duration: 00:00:38.90, start: > 0.000000, bitrate: 55512 kb/s > Stream #0:0: Video: ffv1 (FFV1 / > 0x31564646), yuv422p(tv, progressive), > 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc > (default) > Metadata: > ENCODER : Lavc58.134.100 ffv1 > DURATION : 00:00:38.900000000 > -------------- > > ffprobe -hide_banner 1920x1080_ffv1.mkv > Input #0, matroska,webm, from > '1920x1080_ffv1.mkv': > Metadata: > ENCODER : Lavf58.76.100 > Duration: 00:00:53.40, start: > 0.000000, bitrate: 45747 kb/s > Stream #0:0: Video: ffv1 (FFV1 / >
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 00:52, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < [email protected]>:
> > > Den 02.02.2023 01:46, skrev Terje J. Hanssen: > > ....... > > > but I prepare myself to test and use one method left with regards to > "Personal Video Archiving". > > Therefore I have ordered two selected, inexpensive devices (the urls > here are just for English language): > > 1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB > 3.2/3.1/3.0, 60 Hz and 1080p FHD.) > > https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... > > - Fluid video recordings without delays or distortions during > live streaming > - Linux not mentioned, but assumed this is a standard supported > UVC. OBS and VLC is mentioned. > > > Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x is > received. It promises: > "Fluid video recordings without delays or distortions during live > streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. > Transform high-quality video cameras into a high-resolution USB web camera". > > I have done a quick, first test using my Sony HDR-FX7E camera. This > is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape > 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette > deck is broken and needs repair service. > > But according to Steve Mullen's V1 and FX7 handbook (not mentioned > in the manual): > > 1. When the camera is operating, the EIP (Enhanced Image Processor) > generates uncompressed 1440x1080i with a 4:2:2 color space. Digital > 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via > component-out. Therefore, you can record 4:2:2 live HD video from the > camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port > that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, > PCM, 16-bit, 48kHz audio When the camera is running. > > 2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 > MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI > chip downscales 1440 to 1280 while it up-scales 540 to 720. The > result is 720p50 or 720p60, which is output via HDMI. > > That is, I have tested section 1 now, but see now that I didn't test > 1440x1080 resolution. The only resolution I got to work at 25 fps was > 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps > and 5 fps respectively by the driver and caused jumpy playback. >
Did you tried to force specific format (uncompressed) before -i parameter for ffmpeg?
Just "-framerate 25 -video_size 1920x1080" before -i as repeated in the code as follows, where I tested to encode to uncompressed v210 instead of ffv1, but with no change with regards to low 5 fps:
ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per frame from 1/25 to 1/5
I also read a related issue and reply to this post at Superuser, where 1920x1080 was not supported on the webcam.
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
Also look out for usb2 vs usb3 ports? Shouldn't capture device hang on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from lsusb below?
This may well work better. I have to admit that I have never studied the difference between shared usb buses. My thought was to try to change the connected usb devices, but tested first the only free usb3 port (blue) on the add-on frontpanel of the workstation. The other two usb3 ports are on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate expansion video disc.
The other usb ports on both panels are usb2 ports, whereof two for the wireless keyboard and mouse on the fronpanel. What I possibly already have mentioned before, is that sometimes if I connect a usb(2) device or memory to the usb3 port on the frontpanel, this cause hang on the keyboard or mouse. But this didn't happend this time with the USB3 capture stick.
> Someone here that have suggestion to possibly modified syntax or can > verify that the driver doesn't manage this? > > Another (setup) problem, there was no audio recorded or heard during > playback!? > > In the following I list the test command syntax I've collectedf and > tried with shortened output (yet long): > To explain, I have also another USB 2.0 Webcam connected, beside the > new HDMI-USB3 Videstick. > > Verify the devices, drivers and formats: > --------------------------------------- > dmesg | tail > [22706.060759] perf: interrupt took too long (2521 > 2500), lowering > kernel.perf_event_max_sample_rate to 79250 > [32105.561575] perf: interrupt took too long (3158 > 3151), lowering > kernel.perf_event_max_sample_rate to 63250 > [40586.477420] usb 1-5: USB disconnect, device number 2 > [40599.099612] usb 1-5: new high-speed USB device number 5 using > xhci_hcd > [40599.250960] usb 1-5: New USB device found, idVendor=534d, > idProduct=2109, bcdDevice=21.00 > [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, > SerialNumber=0 > [40599.250978] usb 1-5: Product: USB Video > [40599.250984] usb 1-5: Manufacturer: MACROSILICON > [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) > [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: > USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 > ----------------------------- > > lsusb > Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One > Cardreader > Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD > Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub > Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver > Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video > Bus 001 Device 004: ID 0c45:6340 Microdia Camera > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > > > udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' > E: DEVNAME=/dev/video0 > E: ID_V4L_PRODUCT=USB Video: USB Video > E: DEVNAME=/dev/video1 > E: ID_V4L_PRODUCT=USB Video: USB Video > E: DEVNAME=/dev/video2 > E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam > E: DEVNAME=/dev/video3 > E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam > > lsusb | egrep 'Video|Camera' > Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video > Bus 001 Device 004: ID 0c45:6340 Microdia Camera > > -------------------- > > ll /dev/video* > crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 > crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 > crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 > crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3 > > ----------------------- > > v4l2-ctl --list-devices > USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): > /dev/video2 > /dev/video3 > > USB Video: USB Video (usb-0000:00:14.0-5): > /dev/video0 > /dev/video1 > > ------------------------- > > ffmpeg -f v4l2 -list_formats all -i /dev/video0 > ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 > [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg > : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 > 1280x720 1024x768 800x600 720x576 720x480 640x480 > [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 > : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 > 1280x720 1024x768 800x600 720x576 720x480 640x480 > /dev/video0: Immediate exit requested > > ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 > [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): > Inappropriate ioctl for device > /dev/video1: Inappropriate ioctl for device > ---------------- > > v4l2-ctl --all > Driver Info (not using libv4l2): > Driver name : uvcvideo > Card type : USB Video: USB Video > Bus info : usb-0000:00:14.0-5 > Driver version: 5.14.21 > Capabilities : 0x84A00001 > Video Capture > Metadata Capture > Streaming > Extended Pix Format > Device Capabilities > Device Caps : 0x04200001 > Video Capture > Streaming > Extended Pix Format > Priority: 2 > Video input : 0 (Camera 1: ok) > Format Video Capture: > Width/Height : 1920/1080 > Pixel Format : 'MJPG' > Field : None > Bytes per Line : 0 > Size Image : 4147200 > Colorspace : sRGB > Transfer Function : Rec. 709 > YCbCr/HSV Encoding: ITU-R 601 > Quantization : Default (maps to Full Range) > Flags : > Crop Capability Video Capture: > Bounds : Left 0, Top 0, Width 1920, Height 1080 > Default : Left 0, Top 0, Width 1920, Height 1080 > Pixel Aspect: 1/1 > Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 > Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 > Streaming Parameters Video Capture: > Capabilities : timeperframe > Frames per second: 30.000 (30/1) > Read buffers : 0 > brightness 0x00980900 (int) : min=-128 > max=127 step=1 default=-11 value=-11 > contrast 0x00980901 (int) : min=0 max=255 > step=1 default=148 value=148 > saturation 0x00980902 (int) : min=0 max=255 > step=1 default=180 value=180 > hue 0x00980903 (int) : min=-128 > max=127 step=1 default=0 value=0 > > ----------------- > > v4l2-ctl --list-formats-ext > ioctl: VIDIOC_ENUM_FMT > Index : 0 > Type : Video Capture > Pixel Format: 'MJPG' (compressed) > Name : Motion-JPEG > Size: Discrete 1920x1080 > Interval: Discrete 0.017s (60.000 fps) > Interval: Discrete 0.033s (30.000 fps) > Interval: Discrete 0.040s (25.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 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) >
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default
https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax?
I hope yes!
ffmpeg \
-codec:a pcm_s16le
Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there.
good luck, while I suspect for this specific device it will not improve framerates much due to chip used. but please share your actual results!
Thanks for useful help!
see
https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, ALC892 Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC892 Analog Front output / input
for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
> Index : 1 > Type : Video Capture > Pixel Format: 'YUYV' > Name : YUYV 4:2:2 > Size: Discrete 1920x1080 > Interval: Disc >
Den 08.02.2023 23:16, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu: > > > ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen > <[email protected]>: > > > > Den 08.02.2023 00:52, skrev Andrew > Randrianasulu: >> >> >> ср, 8 февр. 2023 г., 01:35 Terje J. >> Hanssen via Cin >> <[email protected]>: >> >> >> >> Den 02.02.2023 01:46, skrev Terje >> J. Hanssen: >>> ....... >> >>> but I prepare myself to test and >>> use one method left with regards >>> to "Personal Video Archiving". >>> >>> Therefore I have ordered two >>> selected, inexpensive devices (the >>> urls here are just for English >>> language): >>> >>> 1) Capture Card USB HDMI 4K to >>> 1080P USB-C adapter (Speedy USB >>> 3.2/3.1/3.0, 60 Hz and 1080p FHD.) >>> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >>> >>> * Fluid video recordings without >>> delays or distortions during >>> live streaming >>> * Linux not mentioned, but >>> assumed this is a standard >>> supported UVC. OBS and VLC is >>> mentioned. >>> >> >> Then the first item, Hama Video >> Recording Stick, HDMI 4k - USB3.x >> is received. It promises: >> "Fluid video recordings without >> delays or distortions during live >> streaming, thanks to a picture >> frequency of 60 Hz and 1080p with >> Full HD. Transform high-quality >> video cameras into a >> high-resolution USB web camera". >> >> I have done a quick, first test >> using my Sony HDR-FX7E camera. This >> is a HDV 1080i camcorder with >> MPEG-2 video compression at 25 mbps >> on tape 1440x1080, 50i25fps, 4:2:0 >> and MP2 stereo audio. Currently >> it's cassette deck is broken and >> needs repair service. >> >> But according to Steve Mullen's V1 >> and FX7 handbook (not mentioned in >> the manual): >> >> 1. When the camera is >> operating, the EIP (Enhanced >> Image Processor) generates >> uncompressed 1440x1080i with a >> 4:2:2 color space. Digital >> 4:2:2 data are output via the >> HDMI port while 4:2:2 analog is >> output via component-out. >> Therefore, you can record 4:2:2 >> live HD video from the camera >> without MPEG-2 compression. V1 >> and FX7 provide an HDMI output >> port that carries uncompressed >> 4:2:2, 8-bit, digital video >> plus dual-channel, PCM, 16-bit, >> 48kHz audio When the camera is >> running. >> >> 2. If you are playing a 1080i50 >> or 1080i60 HDV tape. The 4:2:0 >> MPEG-2 is decoded and chroma >> up-scaled to a 4:2:2. The HDMI >> chip downscales 1440 to 1280 >> while it up-scales 540 to 720. >> The result is 720p50 or 720p60, >> which is output via HDMI. >> >> That is, I have tested section 1 >> now, but see now that I didn't test >> 1440x1080 resolution. The only >> resolution I got to work at 25 fps >> was 720x576 (SD), while HD 1280x720 >> and FHD 1920x1080 were set down to >> 10 fps and 5 fps respectively by >> the driver and caused jumpy playback. >> >> >> Did you tried to force specific format >> (uncompressed) before -i parameter for >> ffmpeg? > > Just "-framerate 25 -video_size > 1920x1080" before -i as repeated in the > code as follows, where I tested to > encode to uncompressed v210 instead of > ffv1, but with no change with regards to > low 5 fps: > > ffmpeg -hide_banner -f v4l2 -framerate > 25 -video_size 1920x1080 -i /dev/video0 > -codec:v v210 -codec:a pcm_s16le -f > matroska 1920x1080_v210.mkv > [video4linux2,v4l2 @ 0x55944900e0c0] The > driver changed the time per frame from > 1/25 to 1/5 > > I also read a related issue and reply to > this post at Superuser, where 1920x1080 > was not supported on the webcam. > https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... > >> Also look out for usb2 vs usb3 ports? >> Shouldn't capture device hang on bus >> 002 (usb 3.0) root hub, instead of bus >> 001 (usb 2.0 root hub), from lsusb below? > > This may well work better. I have to > admit that I have never studied the > difference between shared usb buses. My > thought was to try to change the > connected usb devices, but tested first > the only free usb3 port (blue) on the > add-on frontpanel of the workstation. > The other two usb3 ports are on the > backpanel and are used for the Asus > blu-ray burner and 8TB Seagate expansion > video disc. > > The other usb ports on both panels are > usb2 ports, whereof two for the wireless > keyboard and mouse on the fronpanel. > What I possibly already have mentioned > before, is that sometimes if I connect a > usb(2) device or memory to the usb3 port > on the frontpanel, this cause hang on > the keyboard or mouse. But this didn't > happend this time with the USB3 capture > stick. > >> >> >> >> Someone here that have suggestion >> to possibly modified syntax or can >> verify that the driver doesn't >> manage this? >> >> Another (setup) problem, there was >> no audio recorded or heard during >> playback!? >> >> In the following I list the test >> command syntax I've collectedf and >> tried with shortened output (yet long): >> To explain, I have also another USB >> 2.0 Webcam connected, beside the >> new HDMI-USB3 Videstick. >> >> Verify the devices, drivers and >> formats: >> --------------------------------------- >> dmesg | tail >> [22706.060759] perf: interrupt took >> too long (2521 > 2500), lowering >> kernel.perf_event_max_sample_rate >> to 79250 >> [32105.561575] perf: interrupt took >> too long (3158 > 3151), lowering >> kernel.perf_event_max_sample_rate >> to 63250 >> [40586.477420] usb 1-5: USB >> disconnect, device number 2 >> [40599.099612] usb 1-5: new >> high-speed USB device number 5 >> using xhci_hcd >> [40599.250960] usb 1-5: New USB >> device found, idVendor=534d, >> idProduct=2109, bcdDevice=21.00 >> [40599.250972] usb 1-5: New USB >> device strings: Mfr=1, Product=2, >> SerialNumber=0 >> [40599.250978] usb 1-5: Product: >> USB Video >> [40599.250984] usb 1-5: >> Manufacturer: MACROSILICON >> [40599.252310] usb 1-5: Found UVC >> 1.00 device USB Video (534d:2109) >> [40599.256234] hid-generic >> 0003:534D:2109.0006: >> hiddev96,hidraw0: USB HID v1.10 >> Device [MACROSILICON USB Video] on >> usb-0000:00:14.0-5/input4 >> ----------------------------- >> >> lsusb >> Bus 002 Device 003: ID 05e3:0732 >> Genesys Logic, Inc. All-in-One >> Cardreader >> Bus 002 Device 002: ID 0bc2:2038 >> Seagate RSS LLC Expansion HDD >> Bus 002 Device 001: ID 1d6b:0003 >> Linux Foundation 3.0 root hub >> Bus 001 Device 003: ID 046d:c534 >> Logitech, Inc. Unifying Receiver >> Bus 001 Device 005: ID 534d:2109 >> MacroSilicon USB Video >> Bus 001 Device 004: ID 0c45:6340 >> Microdia Camera >> Bus 001 Device 001: ID 1d6b:0002 >> Linux Foundation 2.0 root hub >> >> >> udevadm info /dev/video* | egrep >> 'DEVNAME|ID_V4L_PRODUCT' >> E: DEVNAME=/dev/video0 >> E: ID_V4L_PRODUCT=USB Video: USB Video >> E: DEVNAME=/dev/video1 >> E: ID_V4L_PRODUCT=USB Video: USB Video >> E: DEVNAME=/dev/video2 >> E: ID_V4L_PRODUCT=USB 2.0 Camera: >> HD 720P Webcam >> E: DEVNAME=/dev/video3 >> E: ID_V4L_PRODUCT=USB 2.0 Camera: >> HD 720P Webcam >> >> lsusb | egrep 'Video|Camera' >> Bus 001 Device 005: ID 534d:2109 >> MacroSilicon USB Video >> Bus 001 Device 004: ID 0c45:6340 >> Microdia Camera >> >> -------------------- >> >> ll /dev/video* >> crw-rw----+ 1 root video 81, 0 >> feb. 7 20:22 /dev/video0 >> crw-rw----+ 1 root video 81, 1 >> feb. 7 20:22 /dev/video1 >> crw-rw----+ 1 root video 81, 2 >> feb. 7 09:05 /dev/video2 >> crw-rw----+ 1 root video 81, 3 >> feb. 7 09:05 /dev/video3 >> >> ----------------------- >> >> v4l2-ctl --list-devices >> USB 2.0 Camera: HD 720P Webcam >> (usb-0000:00:14.0-11): >> /dev/video2 >> /dev/video3 >> >> USB Video: USB Video >> (usb-0000:00:14.0-5): >> /dev/video0 >> /dev/video1 >> >> ------------------------- >> >> ffmpeg -f v4l2 -list_formats all -i >> /dev/video0 >> ffmpeg -hide_banner -f v4l2 >> -list_formats all -i /dev/video0 >> [video4linux2,v4l2 @ >> 0x556cf63570c0] Compressed: >> mjpeg : Motion-JPEG : 1920x1080 >> 1600x1200 1360x768 1280x1024 >> 1280x960 1280x720 1024x768 800x600 >> 720x576 720x480 640x480 >> [video4linux2,v4l2 @ >> 0x556cf63570c0] Raw : >> yuyv422 : YUYV 4:2:2 : 1920x1080 >> 1600x1200 1360x768 1280x1024 >> 1280x960 1280x720 1024x768 800x600 >> 720x576 720x480 640x480 >> /dev/video0: Immediate exit requested >> >> ffmpeg -hide_banner -f v4l2 >> -list_formats all -i /dev/video1 >> [video4linux2,v4l2 @ >> 0x5560c0bc70c0] >> ioctl(VIDIOC_G_INPUT): >> Inappropriate ioctl for device >> /dev/video1: Inappropriate ioctl >> for device >> ---------------- >> >> v4l2-ctl --all >> Driver Info (not using libv4l2): >> Driver name : uvcvideo >> Card type : USB Video: >> USB Video >> Bus info : >> usb-0000:00:14.0-5 >> Driver version: 5.14.21 >> Capabilities : 0x84A00001 >> Video Capture >> Metadata Capture >> Streaming >> Extended Pix Format >> Device Capabilities >> Device Caps : 0x04200001 >> Video Capture >> Streaming >> Extended Pix Format >> Priority: 2 >> Video input : 0 (Camera 1: ok) >> Format Video Capture: >> Width/Height : 1920/1080 >> Pixel Format : 'MJPG' >> Field : None >> Bytes per Line : 0 >> Size Image : 4147200 >> Colorspace : sRGB >> Transfer Function : Rec. 709 >> YCbCr/HSV Encoding: ITU-R 601 >> Quantization : Default (maps to >> Full Range) >> Flags : >> Crop Capability Video Capture: >> Bounds : Left 0, Top 0, Width >> 1920, Height 1080 >> Default : Left 0, Top 0, Width >> 1920, Height 1080 >> Pixel Aspect: 1/1 >> Selection: crop_default, Left 0, >> Top 0, Width 1920, Height 1080 >> Selection: crop_bounds, Left 0, Top >> 0, Width 1920, Height 1080 >> Streaming Parameters Video Capture: >> Capabilities : timeperframe >> Frames per second: 30.000 >> (30/1) >> Read buffers : 0 >> brightness >> 0x00980900 (int) : min=-128 >> max=127 step=1 default=-11 value=-11 >> contrast >> 0x00980901 (int) : min=0 max=255 >> step=1 default=148 value=148 >> saturation >> 0x00980902 (int) : min=0 max=255 >> step=1 default=180 value=180 >> hue >> 0x00980903 (int) : min=-128 >> max=127 step=1 default=0 value=0 >> >> ----------------- >> >> v4l2-ctl --list-formats-ext >> ioctl: VIDIOC_ENUM_FMT >> Index : 0 >> Type : Video Capture >> Pixel Format: 'MJPG' >> (compressed) >> Name : Motion-JPEG >> Size: Discrete >> 1920x1080 >> Interval: >> Discrete 0.017s (60.000 fps) >> Interval: >> Discrete 0.033s (30.000 fps) >> Interval: >> Discrete 0.040s (25.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 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) >> > > > well, it seems we know by now why this > device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
> > it really seems to report only 5-10 fps at > fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
> > https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
|ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov|
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
* video_size * Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. * pixel_format * Select the pixel format (only valid for raw video input). * input_format * Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax?
I hope yes!
ffmpeg \
-codec:a pcm_s16le
Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there.
good luck, while I suspect for this specific device it will not improve framerates much due to chip used.
but please share your actual results!
Then i have run through the same test cycle. I could actually have stopped already after running "v4l2-ctl --list-formats-ext" with regards to the fps. Yet I updated the encoding syntaxes and got the audio streams seemingly recorded. But for some some reason I could not hear any sound in my airphones. ffmpeg -hide_banner -f pulse -i default -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -level 3 -codec:a pcm_s16le -f matroska 1280x720_2_ffv1.mkv ffprobe -hide_banner 1280x720_2_ffv1.mkv Input #0, matroska,webm, from '1280x720_2_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:32.01, start: 0.000000, bitrate: 59320 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:30.200000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default) Metadata: ENCODER : Lavc58.134.100 pcm_s16le DURATION : 00:00:32.012000000 Is 4KVC00 from "V AV access" still the best option as replacement?
Thanks for useful help!
see https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, ALC892 Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC892 Analog Front output / input
for laughs you can try cingg's internal v4l2 capture
sorry, may be ask on ffmpeg support channel then?
p.s. fake 1080@60 usb dongles def. exist, made me sad
https://www.naut.ca/blog/2020/07/09/cheap-hdmi-capture-card-review/
p.p.s may be try to contact this person so you can confirm/deny exact chip (set) in this device, or at very minimum confirm it based on something else?
https://github.com/BertoldVdb/ms-tools
"Program, library and reference designs to develop for MacroSilicon MS2106/MS2109/MS2130 chips."
Interesting stuff. Mat in a previous thread referred to a couple of other links (article test) https://lists.cinelerra-gg.org/pipermail/cin/2021-October/003960.html
> > > >> >> Index : 1 >> Type : Video Capture >> Pixel Format: 'YUYV' >> Name : YUYV 4:2:2 >> Size: Discrete >> 1920x1080 >> Interval: Disc >>
чт, 9 февр. 2023 г., 03:14 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 23:16, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 02:38, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected] >:
> > > Den 08.02.2023 00:52, skrev Andrew Randrianasulu: > > > > ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < > [email protected]>: > >> >> >> Den 02.02.2023 01:46, skrev Terje J. Hanssen: >> >> ....... >> >> >> but I prepare myself to test and use one method left with regards >> to "Personal Video Archiving". >> >> Therefore I have ordered two selected, inexpensive devices (the >> urls here are just for English language): >> >> 1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB >> 3.2/3.1/3.0, 60 Hz and 1080p FHD.) >> >> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >> >> - Fluid video recordings without delays or distortions during >> live streaming >> - Linux not mentioned, but assumed this is a standard supported >> UVC. OBS and VLC is mentioned. >> >> >> Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x >> is received. It promises: >> "Fluid video recordings without delays or distortions during live >> streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. >> Transform high-quality video cameras into a high-resolution USB web camera". >> >> I have done a quick, first test using my Sony HDR-FX7E camera. This >> is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on tape >> 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's cassette >> deck is broken and needs repair service. >> >> But according to Steve Mullen's V1 and FX7 handbook (not mentioned >> in the manual): >> >> 1. When the camera is operating, the EIP (Enhanced Image Processor) >> generates uncompressed 1440x1080i with a 4:2:2 color space. Digital >> 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via >> component-out. Therefore, you can record 4:2:2 live HD video from the >> camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port >> that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, >> PCM, 16-bit, 48kHz audio When the camera is running. >> >> 2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 >> MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI >> chip downscales 1440 to 1280 while it up-scales 540 to 720. The >> result is 720p50 or 720p60, which is output via HDMI. >> >> That is, I have tested section 1 now, but see now that I didn't >> test 1440x1080 resolution. The only resolution I got to work at 25 fps was >> 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps >> and 5 fps respectively by the driver and caused jumpy playback. >> > > Did you tried to force specific format (uncompressed) before -i > parameter for ffmpeg? > > > Just "-framerate 25 -video_size 1920x1080" before -i as repeated in > the code as follows, where I tested to encode to uncompressed v210 instead > of ffv1, but with no change with regards to low 5 fps: > > ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i > /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv > [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time per > frame from 1/25 to 1/5 > > I also read a related issue and reply to this post at Superuser, > where 1920x1080 was not supported on the webcam. > > https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... > > Also look out for usb2 vs usb3 ports? Shouldn't capture device hang > on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from > lsusb below? > > > This may well work better. I have to admit that I have never studied > the difference between shared usb buses. My thought was to try to change > the connected usb devices, but tested first the only free usb3 port (blue) > on the add-on frontpanel of the workstation. The other two usb3 ports are > on the backpanel and are used for the Asus blu-ray burner and 8TB Seagate > expansion video disc. > > The other usb ports on both panels are usb2 ports, whereof two for > the wireless keyboard and mouse on the fronpanel. What I possibly already > have mentioned before, is that sometimes if I connect a usb(2) device or > memory to the usb3 port on the frontpanel, this cause hang on the keyboard > or mouse. But this didn't happend this time with the USB3 capture stick. > > > > >> Someone here that have suggestion to possibly modified syntax or >> can verify that the driver doesn't manage this? >> >> Another (setup) problem, there was no audio recorded or heard >> during playback!? >> >> In the following I list the test command syntax I've collectedf and >> tried with shortened output (yet long): >> To explain, I have also another USB 2.0 Webcam connected, beside >> the new HDMI-USB3 Videstick. >> >> Verify the devices, drivers and formats: >> --------------------------------------- >> dmesg | tail >> [22706.060759] perf: interrupt took too long (2521 > 2500), >> lowering kernel.perf_event_max_sample_rate to 79250 >> [32105.561575] perf: interrupt took too long (3158 > 3151), >> lowering kernel.perf_event_max_sample_rate to 63250 >> [40586.477420] usb 1-5: USB disconnect, device number 2 >> [40599.099612] usb 1-5: new high-speed USB device number 5 using >> xhci_hcd >> [40599.250960] usb 1-5: New USB device found, idVendor=534d, >> idProduct=2109, bcdDevice=21.00 >> [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, >> SerialNumber=0 >> [40599.250978] usb 1-5: Product: USB Video >> [40599.250984] usb 1-5: Manufacturer: MACROSILICON >> [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) >> [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: >> USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 >> ----------------------------- >> >> lsusb >> Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One >> Cardreader >> Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD >> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub >> Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver >> Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video >> Bus 001 Device 004: ID 0c45:6340 Microdia Camera >> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub >> >> >> udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' >> E: DEVNAME=/dev/video0 >> E: ID_V4L_PRODUCT=USB Video: USB Video >> E: DEVNAME=/dev/video1 >> E: ID_V4L_PRODUCT=USB Video: USB Video >> E: DEVNAME=/dev/video2 >> E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam >> E: DEVNAME=/dev/video3 >> E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam >> >> lsusb | egrep 'Video|Camera' >> Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video >> Bus 001 Device 004: ID 0c45:6340 Microdia Camera >> >> -------------------- >> >> ll /dev/video* >> crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 >> crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 >> crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 >> crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3 >> >> ----------------------- >> >> v4l2-ctl --list-devices >> USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): >> /dev/video2 >> /dev/video3 >> >> USB Video: USB Video (usb-0000:00:14.0-5): >> /dev/video0 >> /dev/video1 >> >> ------------------------- >> >> ffmpeg -f v4l2 -list_formats all -i /dev/video0 >> ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 >> [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg >> : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 >> 1280x720 1024x768 800x600 720x576 720x480 640x480 >> [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 >> : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 >> 1280x720 1024x768 800x600 720x576 720x480 640x480 >> /dev/video0: Immediate exit requested >> >> ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 >> [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): >> Inappropriate ioctl for device >> /dev/video1: Inappropriate ioctl for device >> ---------------- >> >> v4l2-ctl --all >> Driver Info (not using libv4l2): >> Driver name : uvcvideo >> Card type : USB Video: USB Video >> Bus info : usb-0000:00:14.0-5 >> Driver version: 5.14.21 >> Capabilities : 0x84A00001 >> Video Capture >> Metadata Capture >> Streaming >> Extended Pix Format >> Device Capabilities >> Device Caps : 0x04200001 >> Video Capture >> Streaming >> Extended Pix Format >> Priority: 2 >> Video input : 0 (Camera 1: ok) >> Format Video Capture: >> Width/Height : 1920/1080 >> Pixel Format : 'MJPG' >> Field : None >> Bytes per Line : 0 >> Size Image : 4147200 >> Colorspace : sRGB >> Transfer Function : Rec. 709 >> YCbCr/HSV Encoding: ITU-R 601 >> Quantization : Default (maps to Full Range) >> Flags : >> Crop Capability Video Capture: >> Bounds : Left 0, Top 0, Width 1920, Height 1080 >> Default : Left 0, Top 0, Width 1920, Height 1080 >> Pixel Aspect: 1/1 >> Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 >> Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 >> Streaming Parameters Video Capture: >> Capabilities : timeperframe >> Frames per second: 30.000 (30/1) >> Read buffers : 0 >> brightness 0x00980900 (int) : min=-128 >> max=127 step=1 default=-11 value=-11 >> contrast 0x00980901 (int) : min=0 max=255 >> step=1 default=148 value=148 >> saturation 0x00980902 (int) : min=0 max=255 >> step=1 default=180 value=180 >> hue 0x00980903 (int) : min=-128 >> max=127 step=1 default=0 value=0 >> >> ----------------- >> >> v4l2-ctl --list-formats-ext >> ioctl: VIDIOC_ENUM_FMT >> Index : 0 >> Type : Video Capture >> Pixel Format: 'MJPG' (compressed) >> Name : Motion-JPEG >> Size: Discrete 1920x1080 >> Interval: Discrete 0.017s (60.000 fps) >> Interval: Discrete 0.033s (30.000 fps) >> Interval: Discrete 0.040s (25.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 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) >> >
well, it seems we know by now why this device was ...unexpensive.
Yes, I have a "90-days open order" and will start to search for another, better UVC video capture device. The problem is the lack of definitive specifications, compared with my proprietary BMD devices.
it really seems to report only 5-10 fps at fullHD uncompresed, anything bigger is mjpeg ...
Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 Size: Discrete 1920x1080 Interval: Discrete 0.200s (5.000 fps)
This can absolutely not be what they promote as: "Fluid video recordings without delays or distortions during live streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD".
https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-...
I also tried that link's suggested syntax
ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov
but it didn't work for me, just quitted ffmpeg with
Unrecognized option 'timestamps'. Error splitting the argument list: Option not found
Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there also is a similar video4linux2 syntax example
Grab and record the input of a video4linux2 device, leave the frame rate and size as previously set: ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
- video_size - Set the video frame size. The argument must be a string in the form WIDTHxHEIGHT or a valid size abbreviation. - pixel_format - Select the pixel format (only valid for raw video input). - input_format - Set the preferred pixel format (for raw video) or a codec name. This option allows one to select the input format, when several are available.
But what should be set as input_format in this case?
YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default
https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax?
I hope yes!
ffmpeg \
-codec:a pcm_s16le
Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there.
good luck, while I suspect for this specific device it will not improve framerates much due to chip used.
but please share your actual results!
Then i have run through the same test cycle. I could actually have stopped already after running "v4l2-ctl --list-formats-ext" with regards to the fps. Yet I updated the encoding syntaxes and got the audio streams seemingly recorded. But for some some reason I could not hear any sound in my airphones.
check input levels in mixer?
ffmpeg -hide_banner -f pulse -i default -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -level 3 -codec:a pcm_s16le -f matroska 1280x720_2_ffv1.mkv
ffprobe -hide_banner 1280x720_2_ffv1.mkv Input #0, matroska,webm, from '1280x720_2_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:32.01, start: 0.000000, bitrate: 59320 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:30.200000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default) Metadata: ENCODER : Lavc58.134.100 pcm_s16le DURATION : 00:00:32.012000000
Is 4KVC00 from "V AV access" still the best option as replacement?
Well, at least they have english-speaking site, so you can ask few tech questions there? But you can try to chase some of those new ms2130 (!) devices .... some ppl on videohelp forum use avermedia's usb unit for attempted 576i capture, but device outputs pseudo-progressive, so for recovering interlaced signal you need some processing anyway ?! https://forum.videohelp.com/threads/406125-Panasonic-DMR-Avermedia-Extremeca... also, as timesink you can check ld-decode thread in same subforum, project definitely alive but requires real hardware mods to vcr and yet another capture card for capturing raw RF signal from tape head!
Thanks for useful help!
see
https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, A
Den 09.02.2023 01:34, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 03:14 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 23:16, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu: > > > ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen > <[email protected]>: > > > > Den 08.02.2023 02:38, skrev Andrew > Randrianasulu: >> >> >> ср, 8 февр. 2023 г., 04:08 Terje J. >> Hanssen <[email protected]>: >> >> >> >> Den 08.02.2023 00:52, skrev Andrew >> Randrianasulu: >>> >>> >>> ср, 8 февр. 2023 г., 01:35 Terje >>> J. Hanssen via Cin >>> <[email protected]>: >>> >>> >>> >>> Den 02.02.2023 01:46, skrev >>> Terje J. Hanssen: >>>> ....... >>> >>>> but I prepare myself to test >>>> and use one method left with >>>> regards to "Personal Video >>>> Archiving". >>>> >>>> Therefore I have ordered two >>>> selected, inexpensive devices >>>> (the urls here are just for >>>> English language): >>>> >>>> 1) Capture Card USB HDMI 4K >>>> to 1080P USB-C adapter >>>> (Speedy USB 3.2/3.1/3.0, 60 >>>> Hz and 1080p FHD.) >>>> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >>>> >>>> * Fluid video recordings >>>> without delays or >>>> distortions during live >>>> streaming >>>> * Linux not mentioned, but >>>> assumed this is a >>>> standard supported UVC. >>>> OBS and VLC is mentioned. >>>> >>> >>> Then the first item, Hama >>> Video Recording Stick, HDMI 4k >>> - USB3.x is received. It >>> promises: >>> "Fluid video recordings >>> without delays or distortions >>> during live streaming, thanks >>> to a picture frequency of 60 >>> Hz and 1080p with Full HD. >>> Transform high-quality video >>> cameras into a high-resolution >>> USB web camera". >>> >>> I have done a quick, first >>> test using my Sony HDR-FX7E >>> camera. This is a HDV 1080i >>> camcorder with MPEG-2 video >>> compression at 25 mbps on tape >>> 1440x1080, 50i25fps, 4:2:0 and >>> MP2 stereo audio. Currently >>> it's cassette deck is broken >>> and needs repair service. >>> >>> But according to Steve >>> Mullen's V1 and FX7 handbook >>> (not mentioned in the manual): >>> >>> 1. When the camera is >>> operating, the EIP >>> (Enhanced Image Processor) >>> generates uncompressed >>> 1440x1080i with a 4:2:2 >>> color space. Digital 4:2:2 >>> data are output via the >>> HDMI port while 4:2:2 >>> analog is output via >>> component-out. Therefore, >>> you can record 4:2:2 live >>> HD video from the camera >>> without MPEG-2 >>> compression. V1 and FX7 >>> provide an HDMI output >>> port that carries >>> uncompressed 4:2:2, 8-bit, >>> digital video plus >>> dual-channel, PCM, 16-bit, >>> 48kHz audio When the >>> camera is running. >>> >>> 2. If you are playing a >>> 1080i50 or 1080i60 HDV >>> tape. The 4:2:0 MPEG-2 is >>> decoded and chroma >>> up-scaled to a 4:2:2. The HDMI >>> chip downscales 1440 to >>> 1280 while it up-scales >>> 540 to 720. The result is >>> 720p50 or 720p60, which is >>> output via HDMI. >>> >>> That is, I have tested section >>> 1 now, but see now that I >>> didn't test 1440x1080 >>> resolution. The only >>> resolution I got to work at 25 >>> fps was 720x576 (SD), while HD >>> 1280x720 and FHD 1920x1080 >>> were set down to 10 fps and 5 >>> fps respectively by the driver >>> and caused jumpy playback. >>> >>> >>> Did you tried to force specific >>> format (uncompressed) before -i >>> parameter for ffmpeg? >> >> Just "-framerate 25 -video_size >> 1920x1080" before -i as repeated in >> the code as follows, where I tested >> to encode to uncompressed v210 >> instead of ffv1, but with no change >> with regards to low 5 fps: >> >> ffmpeg -hide_banner -f v4l2 >> -framerate 25 -video_size 1920x1080 >> -i /dev/video0 -codec:v v210 >> -codec:a pcm_s16le -f matroska >> 1920x1080_v210.mkv >> [video4linux2,v4l2 @ >> 0x55944900e0c0] The driver changed >> the time per frame from 1/25 to 1/5 >> >> I also read a related issue and >> reply to this post at Superuser, >> where 1920x1080 was not supported >> on the webcam. >> https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... >> >>> Also look out for usb2 vs usb3 >>> ports? Shouldn't capture device >>> hang on bus 002 (usb 3.0) root >>> hub, instead of bus 001 (usb 2.0 >>> root hub), from lsusb below? >> >> This may well work better. I have >> to admit that I have never studied >> the difference between shared usb >> buses. My thought was to try to >> change the connected usb devices, >> but tested first the only free usb3 >> port (blue) on the add-on >> frontpanel of the workstation. The >> other two usb3 ports are on the >> backpanel and are used for the Asus >> blu-ray burner and 8TB Seagate >> expansion video disc. >> >> The other usb ports on both panels >> are usb2 ports, whereof two for the >> wireless keyboard and mouse on the >> fronpanel. What I possibly already >> have mentioned before, is that >> sometimes if I connect a usb(2) >> device or memory to the usb3 port >> on the frontpanel, this cause hang >> on the keyboard or mouse. But this >> didn't happend this time with the >> USB3 capture stick. >> >>> >>> >>> >>> Someone here that have >>> suggestion to possibly >>> modified syntax or can verify >>> that the driver doesn't manage >>> this? >>> >>> Another (setup) problem, there >>> was no audio recorded or heard >>> during playback!? >>> >>> In the following I list the >>> test command syntax I've >>> collectedf and tried with >>> shortened output (yet long): >>> To explain, I have also >>> another USB 2.0 Webcam >>> connected, beside the new >>> HDMI-USB3 Videstick. >>> >>> Verify the devices, drivers >>> and formats: >>> --------------------------------------- >>> dmesg | tail >>> [22706.060759] perf: interrupt >>> took too long (2521 > 2500), >>> lowering >>> kernel.perf_event_max_sample_rate >>> to 79250 >>> [32105.561575] perf: interrupt >>> took too long (3158 > 3151), >>> lowering >>> kernel.perf_event_max_sample_rate >>> to 63250 >>> [40586.477420] usb 1-5: USB >>> disconnect, device number 2 >>> [40599.099612] usb 1-5: new >>> high-speed USB device number 5 >>> using xhci_hcd >>> [40599.250960] usb 1-5: New >>> USB device found, >>> idVendor=534d, idProduct=2109, >>> bcdDevice=21.00 >>> [40599.250972] usb 1-5: New >>> USB device strings: Mfr=1, >>> Product=2, SerialNumber=0 >>> [40599.250978] usb 1-5: >>> Product: USB Video >>> [40599.250984] usb 1-5: >>> Manufacturer: MACROSILICON >>> [40599.252310] usb 1-5: Found >>> UVC 1.00 device USB Video >>> (534d:2109) >>> [40599.256234] hid-generic >>> 0003:534D:2109.0006: >>> hiddev96,hidraw0: USB HID >>> v1.10 Device [MACROSILICON USB >>> Video] on >>> usb-0000:00:14.0-5/input4 >>> ----------------------------- >>> >>> lsusb >>> Bus 002 Device 003: ID >>> 05e3:0732 Genesys Logic, Inc. >>> All-in-One Cardreader >>> Bus 002 Device 002: ID >>> 0bc2:2038 Seagate RSS LLC >>> Expansion HDD >>> Bus 002 Device 001: ID >>> 1d6b:0003 Linux Foundation 3.0 >>> root hub >>> Bus 001 Device 003: ID >>> 046d:c534 Logitech, Inc. >>> Unifying Receiver >>> Bus 001 Device 005: ID >>> 534d:2109 MacroSilicon USB Video >>> Bus 001 Device 004: ID >>> 0c45:6340 Microdia Camera >>> Bus 001 Device 001: ID >>> 1d6b:0002 Linux Foundation 2.0 >>> root hub >>> >>> >>> udevadm info /dev/video* | >>> egrep 'DEVNAME|ID_V4L_PRODUCT' >>> E: DEVNAME=/dev/video0 >>> E: ID_V4L_PRODUCT=USB Video: >>> USB Video >>> E: DEVNAME=/dev/video1 >>> E: ID_V4L_PRODUCT=USB Video: >>> USB Video >>> E: DEVNAME=/dev/video2 >>> E: ID_V4L_PRODUCT=USB 2.0 >>> Camera: HD 720P Webcam >>> E: DEVNAME=/dev/video3 >>> E: ID_V4L_PRODUCT=USB 2.0 >>> Camera: HD 720P Webcam >>> >>> lsusb | egrep 'Video|Camera' >>> Bus 001 Device 005: ID >>> 534d:2109 MacroSilicon USB Video >>> Bus 001 Device 004: ID >>> 0c45:6340 Microdia Camera >>> >>> -------------------- >>> >>> ll /dev/video* >>> crw-rw----+ 1 root video 81, 0 >>> feb. 7 20:22 /dev/video0 >>> crw-rw----+ 1 root video 81, 1 >>> feb. 7 20:22 /dev/video1 >>> crw-rw----+ 1 root video 81, 2 >>> feb. 7 09:05 /dev/video2 >>> crw-rw----+ 1 root video 81, 3 >>> feb. 7 09:05 /dev/video3 >>> >>> ----------------------- >>> >>> v4l2-ctl --list-devices >>> USB 2.0 Camera: HD 720P Webcam >>> (usb-0000:00:14.0-11): >>> /dev/video2 >>> /dev/video3 >>> >>> USB Video: USB Video >>> (usb-0000:00:14.0-5): >>> /dev/video0 >>> /dev/video1 >>> >>> ------------------------- >>> >>> ffmpeg -f v4l2 -list_formats >>> all -i /dev/video0 >>> ffmpeg -hide_banner -f v4l2 >>> -list_formats all -i /dev/video0 >>> [video4linux2,v4l2 @ >>> 0x556cf63570c0] >>> Compressed: mjpeg : >>> Motion-JPEG : 1920x1080 >>> 1600x1200 1360x768 1280x1024 >>> 1280x960 1280x720 1024x768 >>> 800x600 720x576 720x480 640x480 >>> [video4linux2,v4l2 @ >>> 0x556cf63570c0] Raw >>> : yuyv422 : YUYV 4:2:2 : >>> 1920x1080 1600x1200 1360x768 >>> 1280x1024 1280x960 1280x720 >>> 1024x768 800x600 720x576 >>> 720x480 640x480 >>> /dev/video0: Immediate exit >>> requested >>> >>> ffmpeg -hide_banner -f v4l2 >>> -list_formats all -i /dev/video1 >>> [video4linux2,v4l2 @ >>> 0x5560c0bc70c0] >>> ioctl(VIDIOC_G_INPUT): >>> Inappropriate ioctl for device >>> /dev/video1: Inappropriate >>> ioctl for device >>> ---------------- >>> >>> v4l2-ctl --all >>> Driver Info (not using libv4l2): >>> Driver name : uvcvideo >>> Card type : USB >>> Video: USB Video >>> Bus info : >>> usb-0000:00:14.0-5 >>> Driver version: 5.14.21 >>> Capabilities : 0x84A00001 >>> Video Capture >>> Metadata Capture >>> Streaming >>> Extended Pix >>> Format >>> Device >>> Capabilities >>> Device Caps : 0x04200001 >>> Video Capture >>> Streaming >>> Extended Pix >>> Format >>> Priority: 2 >>> Video input : 0 (Camera 1: ok) >>> Format Video Capture: >>> Width/Height : 1920/1080 >>> Pixel Format : 'MJPG' >>> Field : None >>> Bytes per Line : 0 >>> Size Image : >>> 4147200 >>> Colorspace : sRGB >>> Transfer Function : Rec. 709 >>> YCbCr/HSV Encoding: ITU-R 601 >>> Quantization : Default (maps >>> to Full Range) >>> Flags : >>> Crop Capability Video Capture: >>> Bounds : Left 0, Top 0, >>> Width 1920, Height 1080 >>> Default : Left 0, Top 0, >>> Width 1920, Height 1080 >>> Pixel Aspect: 1/1 >>> Selection: crop_default, Left >>> 0, Top 0, Width 1920, Height 1080 >>> Selection: crop_bounds, Left >>> 0, Top 0, Width 1920, Height 1080 >>> Streaming Parameters Video >>> Capture: >>> Capabilities : timeperframe >>> Frames per second: >>> 30.000 (30/1) >>> Read buffers : 0 >>> >>> brightness 0x00980900 (int) >>> : min=-128 max=127 step=1 >>> default=-11 value=-11 >>> >>> contrast 0x00980901 (int) : >>> min=0 max=255 step=1 >>> default=148 value=148 >>> >>> saturation 0x00980902 (int) >>> : min=0 max=255 step=1 >>> default=180 value=180 >>> >>> hue 0x00980903 (int) : >>> min=-128 max=127 step=1 >>> default=0 value=0 >>> >>> ----------------- >>> >>> v4l2-ctl --list-formats-ext >>> ioctl: VIDIOC_ENUM_FMT >>> Index : 0 >>> Type : Video Capture >>> Pixel Format: 'MJPG' >>> (compressed) >>> Name : Motion-JPEG >>> Size: Discrete >>> 1920x1080 >>> >>> Interval: Discrete 0.017s >>> (60.000 fps) >>> >>> Interval: Discrete 0.033s >>> (30.000 fps) >>> >>> Interval: Discrete 0.040s >>> (25.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 >>> 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) >>> >> >> >> well, it seems we know by now why this >> device was ...unexpensive. > > Yes, I have a "90-days open order" and > will start to search for another, better > UVC video capture device. > The problem is the lack of definitive > specifications, compared with my > proprietary BMD devices. > >> >> it really seems to report only 5-10 fps >> at fullHD uncompresed, anything bigger >> is mjpeg ... > > Type : Video Capture > Pixel Format: 'YUYV' > Name : YUYV 4:2:2 > Size: Discrete 1920x1080 > Interval: > Discrete 0.200s (5.000 fps) > > This can absolutely not be what they > promote as: > "Fluid video recordings without delays > or distortions during live streaming, > thanks to a picture frequency of 60 Hz > and 1080p with Full HD". > >> >> https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... > > I also tried that link's suggested syntax > > |ffmpeg -y -t 15 -f video4linux2 > -video_size 1920x1080 -input_format nv12 > -timestamps abs -use_libv4l2 1 -i > /dev/video0 out.mov| > > but it didn't work for me, just quitted > ffmpeg with > > Unrecognized option 'timestamps'. > Error splitting the argument list: > Option not found > > Looking at ffmpeg man pages at > https://manpages.org/ffmpeg/1 there also > is a similar video4linux2 syntax example > > Grab and record the input of a > video4linux2 device, leave the frame > rate and size as previously set: > ffmpeg -f video4linux2 -input_format > mjpeg -i /dev/video0 out.mpeg > > * video_size > * Set the video frame size. The > argument must be a string in the > form WIDTHxHEIGHT or a valid size > abbreviation. > * pixel_format > * Select the pixel format (only valid > for raw video input). > * input_format > * Set the preferred pixel format (for > raw video) or a codec name. This > option allows one to select the > input format, when several are > available. > > But what should be set as input_format > in this case? > > > YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax?
I hope yes!
ffmpeg \
-codec:a pcm_s16le
Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there.
good luck, while I suspect for this specific device it will not improve framerates much due to chip used.
but please share your actual results!
Then i have run through the same test cycle. I could actually have stopped already after running "v4l2-ctl --list-formats-ext" with regards to the fps. Yet I updated the encoding syntaxes and got the audio streams seemingly recorded. But for some some reason I could not hear any sound in my airphones.
check input levels in mixer?
Tried the Alsa mixer. Audio works for other video files like DV with PCM, som also the Alsa mixer volum slideer. But not with the recorded Pulse default audio. cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-9, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 138 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17 cat /proc/asound/devices 2: [ 0- 0]: digital audio capture 3: [ 0] : control 4: [ 1- 0]: digital audio capture 5: [ 1] : control 6: [ 3- 3]: digital audio playback 7: [ 3- 7]: digital audio playback 8: [ 3- 8]: digital audio playback 9: [ 3- 9]: digital audio playback 10: [ 3-10]: digital audio playback 11: [ 3- 0]: hardware dependent 12: [ 3] : control 13: [ 2- 0]: digital audio playback 14: [ 2- 0]: digital audio capture 15: [ 2- 2]: digital audio capture 16: [ 2- 0]: hardware dependent 17: [ 2] : control 33: : timer arecord -l **** List of CAPTURE Hardware Devices **** card 0: MS2109 [MS2109], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Camera [USB 2.0 Camera], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 --------------- Trial_3_ with ALSA Audio input instead finally playbacks the audio ! As seen from mediainfo output below, the FFV1 1920x1080 video stream with 5 fps makes up 94%, the PCM audio 3% In comparision the FFV! 720x576 video stream where the Hama ms2109 capture manages 25 fps, the sizes are 95% and 3% ------------- ffmpeg -hide_banner -f alsa -i hw:CARD=MS2109,DEV=0 -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_3_v210.mkv ffprobe -hide_banner 1920x1080_3_ffv1.mkv Input #0, matroska,webm, from '1920x1080_3_ffv1.mkv': Metadata: ENCODER : Lavf59.27.100 Duration: 00:00:15.40, start: 0.000000, bitrate: 43592 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn Metadata: ENCODER : Lavc59.37.100 ffv1 DURATION : 00:00:15.400000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: ENCODER : Lavc59.37.100 pcm_s16le DURATION : 00:00:15.002000000 mediainfo 1920x1080_3_ffv1.mkv General Unique ID : 161510209095163219124024337758474561604 (0x7981BC1BFCE8B17818FB537C5AD16844) Complete name : 1920x1080_3_ffv1.mkv Format : Matroska Format version : Version 4 File size : 80.0 MiB Duration : 15 s 400 ms Overall bit rate mode : Variable Overall bit rate : 43.6 Mb/s Writing application : Lavf59.27.100 Writing library : Lavf59.27.100 ErrorDetectionType : Per level 1 Video ID : 1 Format : FFV1 Format version : Version 3.4 Codec ID : V_MS/VFW/FOURCC / FFV1 Duration : 15 s 400 ms Bit rate mode : Variable Bit rate : 41.2 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 5.000 FPS Color space : YUV Chroma subsampling : 4:2:2 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossless Bits/(Pixel*Frame) : 3.973 Stream size : 75.6 MiB (94%) Writing library : Lavc59.37.100 ffv1 Default : No Forced : No Color range : Limited coder_type : Golomb Rice MaxSlicesCount : 4 ErrorDetectionType : Per slice Audio ID : 2 Format : PCM Format settings : Little / Signed Codec ID : A_PCM/INT/LIT Duration : 15 s 2 ms Bit rate mode : Constant Bit rate : 1 536 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Bit depth : 16 bits Stream size : 2.75 MiB (3%) Writing library : Lavc59.37.100 pcm_s16le Default : No Forced : No mediainfo 1920x1080_3_ffv1.mkv | grep size File size : 80.0 MiB Stream size : 75.6 MiB (94%) Stream size : 2.75 MiB (3%)
ffmpeg -hide_banner -f pulse -i default -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -level 3 -codec:a pcm_s16le -f matroska 1280x720_2_ffv1.mkv
ffprobe -hide_banner 1280x720_2_ffv1.mkv Input #0, matroska,webm, from '1280x720_2_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:32.01, start: 0.000000, bitrate: 59320 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:30.200000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default) Metadata: ENCODER : Lavc58.134.100 pcm_s16le DURATION : 00:00:32.012000000
Is 4KVC00 from "V AV access" still the best option as replacement?
Well, at least they have english-speaking site, so you can ask few tech questions there?
But you can try to chase some of those new ms2130 (!) devices ....
some ppl on videohelp forum use avermedia's usb unit for attempted 576i capture, but device outputs pseudo-progressive, so for recovering interlaced signal you need some processing anyway ?!
https://forum.videohelp.com/threads/406125-Panasonic-DMR-Avermedia-Extremeca...
also, as timesink you can check ld-decode thread in same subforum, project definitely alive but requires real hardware mods to vcr and yet another capture card for capturing raw RF signal from tape head!
Thanks for useful help!
see https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, A
Den 11.02.2023 23:18, skrev Terje J. Hanssen:
Den 09.02.2023 01:34, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 03:14 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 23:16, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu: > > > ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen > <[email protected]>: > > > > Den 08.02.2023 14:21, skrev Andrew > Randrianasulu: >> >> >> ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen >> <[email protected]>: >> >> >> >> Den 08.02.2023 02:38, skrev Andrew >> Randrianasulu: >>> >>> >>> ср, 8 февр. 2023 г., 04:08 Terje J. >>> Hanssen <[email protected]>: >>> >>> >>> >>> Den 08.02.2023 00:52, skrev Andrew >>> Randrianasulu: >>>> >>>> >>>> ср, 8 февр. 2023 г., 01:35 Terje >>>> J. Hanssen via Cin >>>> <[email protected]>: >>>> >>>> >>>> >>>> Den 02.02.2023 01:46, skrev >>>> Terje J. Hanssen: >>>>> ....... >>>> >>>>> but I prepare myself to test >>>>> and use one method left with >>>>> regards to "Personal Video >>>>> Archiving". >>>>> >>>>> Therefore I have ordered two >>>>> selected, inexpensive >>>>> devices (the urls here are >>>>> just for English language): >>>>> >>>>> 1) Capture Card USB HDMI 4K >>>>> to 1080P USB-C adapter >>>>> (Speedy USB 3.2/3.1/3.0, 60 >>>>> Hz and 1080p FHD.) >>>>> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >>>>> >>>>> * Fluid video recordings >>>>> without delays or >>>>> distortions during live >>>>> streaming >>>>> * Linux not mentioned, but >>>>> assumed this is a >>>>> standard supported UVC. >>>>> OBS and VLC is mentioned. >>>>> >>>> >>>> Then the first item, Hama >>>> Video Recording Stick, HDMI >>>> 4k - USB3.x is received. It >>>> promises: >>>> "Fluid video recordings >>>> without delays or distortions >>>> during live streaming, thanks >>>> to a picture frequency of 60 >>>> Hz and 1080p with Full HD. >>>> Transform high-quality video >>>> cameras into a >>>> high-resolution USB web camera". >>>> >>>> I have done a quick, first >>>> test using my Sony HDR-FX7E >>>> camera. This is a HDV 1080i >>>> camcorder with MPEG-2 video >>>> compression at 25 mbps on >>>> tape 1440x1080, 50i25fps, >>>> 4:2:0 and MP2 stereo audio. >>>> Currently it's cassette deck >>>> is broken and needs repair >>>> service. >>>> >>>> But according to Steve >>>> Mullen's V1 and FX7 handbook >>>> (not mentioned in the manual): >>>> >>>> 1. When the camera is >>>> operating, the EIP >>>> (Enhanced Image >>>> Processor) generates >>>> uncompressed 1440x1080i >>>> with a 4:2:2 color space. >>>> Digital 4:2:2 data are >>>> output via the HDMI port >>>> while 4:2:2 analog is >>>> output via component-out. >>>> Therefore, you can record >>>> 4:2:2 live HD video from >>>> the camera without MPEG-2 >>>> compression. V1 and FX7 >>>> provide an HDMI output >>>> port that carries >>>> uncompressed 4:2:2, >>>> 8-bit, digital video plus >>>> dual-channel, PCM, >>>> 16-bit, 48kHz audio When >>>> the camera is running. >>>> >>>> 2. If you are playing a >>>> 1080i50 or 1080i60 HDV >>>> tape. The 4:2:0 MPEG-2 is >>>> decoded and chroma >>>> up-scaled to a 4:2:2. The >>>> HDMI >>>> chip downscales 1440 to >>>> 1280 while it up-scales >>>> 540 to 720. The result is >>>> 720p50 or 720p60, which >>>> is output via HDMI. >>>> >>>> That is, I have tested >>>> section 1 now, but see now >>>> that I didn't test 1440x1080 >>>> resolution. The only >>>> resolution I got to work at >>>> 25 fps was 720x576 (SD), >>>> while HD 1280x720 and FHD >>>> 1920x1080 were set down to 10 >>>> fps and 5 fps respectively by >>>> the driver and caused jumpy >>>> playback. >>>> >>>> >>>> Did you tried to force specific >>>> format (uncompressed) before -i >>>> parameter for ffmpeg? >>> >>> Just "-framerate 25 -video_size >>> 1920x1080" before -i as repeated >>> in the code as follows, where I >>> tested to encode to uncompressed >>> v210 instead of ffv1, but with no >>> change with regards to low 5 fps: >>> >>> ffmpeg -hide_banner -f v4l2 >>> -framerate 25 -video_size >>> 1920x1080 -i /dev/video0 -codec:v >>> v210 -codec:a pcm_s16le -f >>> matroska 1920x1080_v210.mkv >>> [video4linux2,v4l2 @ >>> 0x55944900e0c0] The driver changed >>> the time per frame from 1/25 to 1/5 >>> >>> I also read a related issue and >>> reply to this post at Superuser, >>> where 1920x1080 was not supported >>> on the webcam. >>> https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... >>> >>>> Also look out for usb2 vs usb3 >>>> ports? Shouldn't capture device >>>> hang on bus 002 (usb 3.0) root >>>> hub, instead of bus 001 (usb 2.0 >>>> root hub), from lsusb below? >>> >>> This may well work better. I have >>> to admit that I have never studied >>> the difference between shared usb >>> buses. My thought was to try to >>> change the connected usb devices, >>> but tested first the only free >>> usb3 port (blue) on the add-on >>> frontpanel of the workstation. The >>> other two usb3 ports are on the >>> backpanel and are used for the >>> Asus blu-ray burner and 8TB >>> Seagate expansion video disc. >>> >>> The other usb ports on both panels >>> are usb2 ports, whereof two for >>> the wireless keyboard and mouse on >>> the fronpanel. What I possibly >>> already have mentioned before, is >>> that sometimes if I connect a >>> usb(2) device or memory to the >>> usb3 port on the frontpanel, this >>> cause hang on the keyboard or >>> mouse. But this didn't happend >>> this time with the USB3 capture stick. >>> >>>> >>>> >>>> >>>> Someone here that have >>>> suggestion to possibly >>>> modified syntax or can verify >>>> that the driver doesn't >>>> manage this? >>>> >>>> Another (setup) problem, >>>> there was no audio recorded >>>> or heard during playback!? >>>> >>>> In the following I list the >>>> test command syntax I've >>>> collectedf and tried with >>>> shortened output (yet long): >>>> To explain, I have also >>>> another USB 2.0 Webcam >>>> connected, beside the new >>>> HDMI-USB3 Videstick. >>>> >>>> Verify the devices, drivers >>>> and formats: >>>> --------------------------------------- >>>> dmesg | tail >>>> [22706.060759] perf: >>>> interrupt took too long (2521 >>>> > 2500), lowering >>>> kernel.perf_event_max_sample_rate >>>> to 79250 >>>> [32105.561575] perf: >>>> interrupt took too long (3158 >>>> > 3151), lowering >>>> kernel.perf_event_max_sample_rate >>>> to 63250 >>>> [40586.477420] usb 1-5: USB >>>> disconnect, device number 2 >>>> [40599.099612] usb 1-5: new >>>> high-speed USB device number >>>> 5 using xhci_hcd >>>> [40599.250960] usb 1-5: New >>>> USB device found, >>>> idVendor=534d, >>>> idProduct=2109, bcdDevice=21.00 >>>> [40599.250972] usb 1-5: New >>>> USB device strings: Mfr=1, >>>> Product=2, SerialNumber=0 >>>> [40599.250978] usb 1-5: >>>> Product: USB Video >>>> [40599.250984] usb 1-5: >>>> Manufacturer: MACROSILICON >>>> [40599.252310] usb 1-5: Found >>>> UVC 1.00 device USB Video >>>> (534d:2109) >>>> [40599.256234] hid-generic >>>> 0003:534D:2109.0006: >>>> hiddev96,hidraw0: USB HID >>>> v1.10 Device [MACROSILICON >>>> USB Video] on >>>> usb-0000:00:14.0-5/input4 >>>> ----------------------------- >>>> >>>> lsusb >>>> Bus 002 Device 003: ID >>>> 05e3:0732 Genesys Logic, Inc. >>>> All-in-One Cardreader >>>> Bus 002 Device 002: ID >>>> 0bc2:2038 Seagate RSS LLC >>>> Expansion HDD >>>> Bus 002 Device 001: ID >>>> 1d6b:0003 Linux Foundation >>>> 3.0 root hub >>>> Bus 001 Device 003: ID >>>> 046d:c534 Logitech, Inc. >>>> Unifying Receiver >>>> Bus 001 Device 005: ID >>>> 534d:2109 MacroSilicon USB Video >>>> Bus 001 Device 004: ID >>>> 0c45:6340 Microdia Camera >>>> Bus 001 Device 001: ID >>>> 1d6b:0002 Linux Foundation >>>> 2.0 root hub >>>> >>>> >>>> udevadm info /dev/video* | >>>> egrep 'DEVNAME|ID_V4L_PRODUCT' >>>> E: DEVNAME=/dev/video0 >>>> E: ID_V4L_PRODUCT=USB Video: >>>> USB Video >>>> E: DEVNAME=/dev/video1 >>>> E: ID_V4L_PRODUCT=USB Video: >>>> USB Video >>>> E: DEVNAME=/dev/video2 >>>> E: ID_V4L_PRODUCT=USB 2.0 >>>> Camera: HD 720P Webcam >>>> E: DEVNAME=/dev/video3 >>>> E: ID_V4L_PRODUCT=USB 2.0 >>>> Camera: HD 720P Webcam >>>> >>>> lsusb | egrep 'Video|Camera' >>>> Bus 001 Device 005: ID >>>> 534d:2109 MacroSilicon USB Video >>>> Bus 001 Device 004: ID >>>> 0c45:6340 Microdia Camera >>>> >>>> -------------------- >>>> >>>> ll /dev/video* >>>> crw-rw----+ 1 root video 81, >>>> 0 feb. 7 20:22 /dev/video0 >>>> crw-rw----+ 1 root video 81, >>>> 1 feb. 7 20:22 /dev/video1 >>>> crw-rw----+ 1 root video 81, >>>> 2 feb. 7 09:05 /dev/video2 >>>> crw-rw----+ 1 root video 81, >>>> 3 feb. 7 09:05 /dev/video3 >>>> >>>> ----------------------- >>>> >>>> v4l2-ctl --list-devices >>>> USB 2.0 Camera: HD 720P >>>> Webcam (usb-0000:00:14.0-11): >>>> /dev/video2 >>>> /dev/video3 >>>> >>>> USB Video: USB Video >>>> (usb-0000:00:14.0-5): >>>> /dev/video0 >>>> /dev/video1 >>>> >>>> ------------------------- >>>> >>>> ffmpeg -f v4l2 -list_formats >>>> all -i /dev/video0 >>>> ffmpeg -hide_banner -f v4l2 >>>> -list_formats all -i /dev/video0 >>>> [video4linux2,v4l2 @ >>>> 0x556cf63570c0] >>>> Compressed: mjpeg : >>>> Motion-JPEG : 1920x1080 >>>> 1600x1200 1360x768 1280x1024 >>>> 1280x960 1280x720 1024x768 >>>> 800x600 720x576 720x480 640x480 >>>> [video4linux2,v4l2 @ >>>> 0x556cf63570c0] Raw >>>> : yuyv422 : YUYV 4:2:2 : >>>> 1920x1080 1600x1200 1360x768 >>>> 1280x1024 1280x960 1280x720 >>>> 1024x768 800x600 720x576 >>>> 720x480 640x480 >>>> /dev/video0: Immediate exit >>>> requested >>>> >>>> ffmpeg -hide_banner -f v4l2 >>>> -list_formats all -i /dev/video1 >>>> [video4linux2,v4l2 @ >>>> 0x5560c0bc70c0] >>>> ioctl(VIDIOC_G_INPUT): >>>> Inappropriate ioctl for device >>>> /dev/video1: Inappropriate >>>> ioctl for device >>>> ---------------- >>>> >>>> v4l2-ctl --all >>>> Driver Info (not using libv4l2): >>>> Driver name : uvcvideo >>>> Card type : USB >>>> Video: USB Video >>>> Bus info : >>>> usb-0000:00:14.0-5 >>>> Driver version: 5.14.21 >>>> Capabilities : 0x84A00001 >>>> Video Capture >>>> Metadata Capture >>>> Streaming >>>> Extended Pix >>>> Format >>>> Device >>>> Capabilities >>>> Device Caps : >>>> 0x04200001 >>>> Video Capture >>>> Streaming >>>> Extended Pix >>>> Format >>>> Priority: 2 >>>> Video input : 0 (Camera 1: ok) >>>> Format Video Capture: >>>> Width/Height : 1920/1080 >>>> Pixel Format : >>>> 'MJPG' >>>> Field : None >>>> Bytes per Line : 0 >>>> Size Image : >>>> 4147200 >>>> Colorspace : sRGB >>>> Transfer Function : Rec. 709 >>>> YCbCr/HSV Encoding: ITU-R 601 >>>> Quantization : Default (maps >>>> to Full Range) >>>> Flags : >>>> Crop Capability Video Capture: >>>> Bounds : Left 0, Top 0, >>>> Width 1920, Height 1080 >>>> Default : Left 0, Top 0, >>>> Width 1920, Height 1080 >>>> Pixel Aspect: 1/1 >>>> Selection: crop_default, Left >>>> 0, Top 0, Width 1920, Height 1080 >>>> Selection: crop_bounds, Left >>>> 0, Top 0, Width 1920, Height 1080 >>>> Streaming Parameters Video >>>> Capture: >>>> Capabilities : timeperframe >>>> Frames per second: >>>> 30.000 (30/1) >>>> Read buffers : 0 >>>> >>>> brightness 0x00980900 >>>> (int) : min=-128 max=127 >>>> step=1 default=-11 value=-11 >>>> >>>> contrast 0x00980901 (int) >>>> : min=0 max=255 step=1 >>>> default=148 value=148 >>>> >>>> saturation 0x00980902 >>>> (int) : min=0 max=255 >>>> step=1 default=180 value=180 >>>> >>>> hue 0x00980903 (int) : >>>> min=-128 max=127 step=1 >>>> default=0 value=0 >>>> >>>> ----------------- >>>> >>>> v4l2-ctl --list-formats-ext >>>> ioctl: VIDIOC_ENUM_FMT >>>> Index : 0 >>>> Type : Video Capture >>>> Pixel Format: 'MJPG' >>>> (compressed) >>>> Name : Motion-JPEG >>>> Size: >>>> Discrete 1920x1080 >>>> >>>> Interval: Discrete 0.017s >>>> (60.000 fps) >>>> >>>> Interval: Discrete 0.033s >>>> (30.000 fps) >>>> >>>> Interval: Discrete 0.040s >>>> (25.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 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) >>>> >>> >>> >>> well, it seems we know by now why this >>> device was ...unexpensive. >> >> Yes, I have a "90-days open order" and >> will start to search for another, >> better UVC video capture device. >> The problem is the lack of definitive >> specifications, compared with my >> proprietary BMD devices. >> >>> >>> it really seems to report only 5-10 >>> fps at fullHD uncompresed, anything >>> bigger is mjpeg ... >> >> Type : Video Capture >> Pixel Format: 'YUYV' >> Name : YUYV 4:2:2 >> Size: Discrete 1920x1080 >> Interval: >> Discrete 0.200s (5.000 fps) >> >> This can absolutely not be what they >> promote as: >> "Fluid video recordings without delays >> or distortions during live streaming, >> thanks to a picture frequency of 60 Hz >> and 1080p with Full HD". >> >>> >>> https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... >> >> I also tried that link's suggested syntax >> >> |ffmpeg -y -t 15 -f video4linux2 >> -video_size 1920x1080 -input_format >> nv12 -timestamps abs -use_libv4l2 1 -i >> /dev/video0 out.mov| >> >> but it didn't work for me, just quitted >> ffmpeg with >> >> Unrecognized option 'timestamps'. >> Error splitting the argument list: >> Option not found >> >> Looking at ffmpeg man pages at >> https://manpages.org/ffmpeg/1 there >> also is a similar video4linux2 syntax >> example >> >> Grab and record the input of a >> video4linux2 device, leave the >> frame rate and size as previously set: >> ffmpeg -f video4linux2 >> -input_format mjpeg -i /dev/video0 >> out.mpeg >> >> * video_size >> * Set the video frame size. The >> argument must be a string in the >> form WIDTHxHEIGHT or a valid size >> abbreviation. >> * pixel_format >> * Select the pixel format (only valid >> for raw video input). >> * input_format >> * Set the preferred pixel format (for >> raw video) or a codec name. This >> option allows one to select the >> input format, when several are >> available. >> >> But what should be set as input_format >> in this case? >> >> >> YUYV ? (lowercase) > > ffmpeg -hide_banner -f video4linux2 > -input_format yuyv -i /dev/video0 out.mkv > [video4linux2,v4l2 @ 0x55b25017e0c0] No such > input format: yuyv. > /dev/video0: Invalid argument > > > :(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
try -f pulse -i default, (or sysdefault) because your system already set it up as first rec. device?
for -f alsa try -i hw:CARD=MS2109,DEV=0
default audio should be 2 ch/48khz pcm
And the latter fit with my used encoding syntax?
I hope yes!
ffmpeg \
-codec:a pcm_s16le
Now I will disconnect the Blu-ray burner from its USB3 port on the backpanel and reconnect and retest Video capture there.
good luck, while I suspect for this specific device it will not improve framerates much due to chip used.
but please share your actual results!
Then i have run through the same test cycle. I could actually have stopped already after running "v4l2-ctl --list-formats-ext" with regards to the fps. Yet I updated the encoding syntaxes and got the audio streams seemingly recorded. But for some some reason I could not hear any sound in my airphones.
check input levels in mixer?
Tried the Alsa mixer. Audio works for other video files like DV with PCM, som also the Alsa mixer volum slideer. But not with the recorded Pulse default audio.
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-9, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 138 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
cat /proc/asound/devices 2: [ 0- 0]: digital audio capture 3: [ 0] : control 4: [ 1- 0]: digital audio capture 5: [ 1] : control 6: [ 3- 3]: digital audio playback 7: [ 3- 7]: digital audio playback 8: [ 3- 8]: digital audio playback 9: [ 3- 9]: digital audio playback 10: [ 3-10]: digital audio playback 11: [ 3- 0]: hardware dependent 12: [ 3] : control 13: [ 2- 0]: digital audio playback 14: [ 2- 0]: digital audio capture 15: [ 2- 2]: digital audio capture 16: [ 2- 0]: hardware dependent 17: [ 2] : control 33: : timer
arecord -l **** List of CAPTURE Hardware Devices **** card 0: MS2109 [MS2109], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Camera [USB 2.0 Camera], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 ---------------
Trial_3_ with ALSA Audio input instead finally playbacks the audio !
As seen from mediainfo output below, the FFV1 1920x1080 video stream with 5 fps makes up 94%, the PCM audio 3% In comparision the FFV! 720x576 video stream where the Hama ms2109 capture manages 25 fps, the sizes are 95% and 3% -------------
I attached incorrectly encoding syntax for v210. The correct syntax with FFV1 in this case is ffmpeg -hide_banner -f alsa -i hw:CARD=MS2109,DEV=0 -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v ffv1 -level 3 -codec:a pcm_s16le -f matroska 1920x1080_3_ffv1.mkv
ffmpeg -hide_banner -f alsa -i hw:CARD=MS2109,DEV=0 -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_3_v210.mkv
ffprobe -hide_banner 1920x1080_3_ffv1.mkv
Input #0, matroska,webm, from '1920x1080_3_ffv1.mkv': Metadata: ENCODER : Lavf59.27.100 Duration: 00:00:15.40, start: 0.000000, bitrate: 43592 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn Metadata: ENCODER : Lavc59.37.100 ffv1 DURATION : 00:00:15.400000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s Metadata: ENCODER : Lavc59.37.100 pcm_s16le DURATION : 00:00:15.002000000
mediainfo 1920x1080_3_ffv1.mkv
General Unique ID : 161510209095163219124024337758474561604 (0x7981BC1BFCE8B17818FB537C5AD16844) Complete name : 1920x1080_3_ffv1.mkv Format : Matroska Format version : Version 4 File size : 80.0 MiB Duration : 15 s 400 ms Overall bit rate mode : Variable Overall bit rate : 43.6 Mb/s Writing application : Lavf59.27.100 Writing library : Lavf59.27.100 ErrorDetectionType : Per level 1
Video ID : 1 Format : FFV1 Format version : Version 3.4 Codec ID : V_MS/VFW/FOURCC / FFV1 Duration : 15 s 400 ms Bit rate mode : Variable Bit rate : 41.2 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 5.000 FPS Color space : YUV Chroma subsampling : 4:2:2 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossless Bits/(Pixel*Frame) : 3.973 Stream size : 75.6 MiB (94%) Writing library : Lavc59.37.100 ffv1 Default : No Forced : No Color range : Limited coder_type : Golomb Rice MaxSlicesCount : 4 ErrorDetectionType : Per slice
Audio ID : 2 Format : PCM Format settings : Little / Signed Codec ID : A_PCM/INT/LIT Duration : 15 s 2 ms Bit rate mode : Constant Bit rate : 1 536 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Bit depth : 16 bits Stream size : 2.75 MiB (3%) Writing library : Lavc59.37.100 pcm_s16le Default : No Forced : No
mediainfo 1920x1080_3_ffv1.mkv | grep size
File size : 80.0 MiB Stream size : 75.6 MiB (94%) Stream size : 2.75 MiB (3%)
ffmpeg -hide_banner -f pulse -i default -f v4l2 -framerate 25 -video_size 1280x720 -i /dev/video0 -codec:v ffv1 -level 3 -codec:a pcm_s16le -f matroska 1280x720_2_ffv1.mkv
ffprobe -hide_banner 1280x720_2_ffv1.mkv Input #0, matroska,webm, from '1280x720_2_ffv1.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:32.01, start: 0.000000, bitrate: 59320 kb/s Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv422p(tv, progressive), 1280x720, 10 fps, 10 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 ffv1 DURATION : 00:00:30.200000000 Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s (default) Metadata: ENCODER : Lavc58.134.100 pcm_s16le DURATION : 00:00:32.012000000
Is 4KVC00 from "V AV access" still the best option as replacement?
Well, at least they have english-speaking site, so you can ask few tech questions there?
But you can try to chase some of those new ms2130 (!) devices ....
some ppl on videohelp forum use avermedia's usb unit for attempted 576i capture, but device outputs pseudo-progressive, so for recovering interlaced signal you need some processing anyway ?!
https://forum.videohelp.com/threads/406125-Panasonic-DMR-Avermedia-Extremeca...
also, as timesink you can check ld-decode thread in same subforum, project definitely alive but requires real hardware mods to vcr and yet another capture card for capturing raw RF signal from tape head!
Thanks for useful help!
see https://patchwork.kernel.org/project/alsa-devel/patch/20200702071433.237843-...
Also, ms2109 confirmed .. :(
cat /proc/asound/cards 0 [MS2109 ]: USB-Audio - MS2109 MacroSilicon MS2109 at usb-0000:00:14.0-5, high speed 1 [Camera ]: USB-Audio - USB 2.0 Camera Sonix Technology Co., Ltd. USB 2.0 Camera at usb-0000:00:14.0-11, high speed 2 [PCH ]: HDA-Intel - HDA Intel PCH HDA Intel PCH at 0xdf420000 irq 139 3 [NVidia ]: HDA-Intel - HDA NVidia HDA NVidia at 0xdf080000 irq 17
arecord -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device speexrate Rate Converter Plugin Using Speex Resampler pulse PulseAudio Sound Server upmix Plugin for channel upmix (4,6,8) default Default ALSA Output (currently PulseAudio Sound Server) sysdefault:CARD=MS2109 MS2109, USB Audio Default Audio Device front:CARD=MS2109,DEV=0 MS2109, USB Audio Front output / input sysdefault:CARD=Camera USB 2.0 Camera, USB Audio Default Audio Device front:CARD=Camera,DEV=0 USB 2.0 Camera, USB Audio Front output / input sysdefault:CARD=PCH HDA Intel PCH, A
I see. Thanks for being pedantic. I think we need another thread :) because this one overflow mobile gmail client again. вс, 12 февр. 2023 г., 15:17 Terje J. Hanssen <[email protected]>:
Den 11.02.2023 23:18, skrev Terje J. Hanssen:
Den 09.02.2023 01:34, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 03:14 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 23:16, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 01:13 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 22:47, skrev Andrew Randrianasulu:
чт, 9 февр. 2023 г., 00:38 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 19:15, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 20:53 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 16:45, skrev Terje J. Hanssen:
Den 08.02.2023 15:34, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 17:16 Terje J. Hanssen <[email protected]>:
Den 08.02.2023 14:21, skrev Andrew Randrianasulu:
ср, 8 февр. 2023 г., 14:47 Terje J. Hanssen <[email protected] >:
> > > Den 08.02.2023 02:38, skrev Andrew Randrianasulu: > > > > ср, 8 февр. 2023 г., 04:08 Terje J. Hanssen <[email protected] > >: > >> >> >> Den 08.02.2023 00:52, skrev Andrew Randrianasulu: >> >> >> >> ср, 8 февр. 2023 г., 01:35 Terje J. Hanssen via Cin < >> [email protected]>: >> >>> >>> >>> Den 02.02.2023 01:46, skrev Terje J. Hanssen: >>> >>> ....... >>> >>> >>> but I prepare myself to test and use one method left with regards >>> to "Personal Video Archiving". >>> >>> Therefore I have ordered two selected, inexpensive devices (the >>> urls here are just for English language): >>> >>> 1) Capture Card USB HDMI 4K to 1080P USB-C adapter (Speedy USB >>> 3.2/3.1/3.0, 60 Hz and 1080p FHD.) >>> >>> https://www.turascandinavia.com/en/products/computer/microphone-webcam/webca... >>> >>> - Fluid video recordings without delays or distortions during >>> live streaming >>> - Linux not mentioned, but assumed this is a standard >>> supported UVC. OBS and VLC is mentioned. >>> >>> >>> Then the first item, Hama Video Recording Stick, HDMI 4k - USB3.x >>> is received. It promises: >>> "Fluid video recordings without delays or distortions during live >>> streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD. >>> Transform high-quality video cameras into a high-resolution USB web camera". >>> >>> I have done a quick, first test using my Sony HDR-FX7E camera. >>> This is a HDV 1080i camcorder with MPEG-2 video compression at 25 mbps on >>> tape 1440x1080, 50i25fps, 4:2:0 and MP2 stereo audio. Currently it's >>> cassette deck is broken and needs repair service. >>> >>> But according to Steve Mullen's V1 and FX7 handbook (not mentioned >>> in the manual): >>> >>> 1. When the camera is operating, the EIP (Enhanced Image >>> Processor) generates uncompressed 1440x1080i with a 4:2:2 color space. Digital >>> 4:2:2 data are output via the HDMI port while 4:2:2 analog is output via >>> component-out. Therefore, you can record 4:2:2 live HD video from the >>> camera without MPEG-2 compression. V1 and FX7 provide an HDMI output port >>> that carries uncompressed 4:2:2, 8-bit, digital video plus dual-channel, >>> PCM, 16-bit, 48kHz audio When the camera is running. >>> >>> 2. If you are playing a 1080i50 or 1080i60 HDV tape. The 4:2:0 >>> MPEG-2 is decoded and chroma up-scaled to a 4:2:2. The HDMI >>> chip downscales 1440 to 1280 while it up-scales 540 to 720. The >>> result is 720p50 or 720p60, which is output via HDMI. >>> >>> That is, I have tested section 1 now, but see now that I didn't >>> test 1440x1080 resolution. The only resolution I got to work at 25 fps was >>> 720x576 (SD), while HD 1280x720 and FHD 1920x1080 were set down to 10 fps >>> and 5 fps respectively by the driver and caused jumpy playback. >>> >> >> Did you tried to force specific format (uncompressed) before -i >> parameter for ffmpeg? >> >> >> Just "-framerate 25 -video_size 1920x1080" before -i as repeated in >> the code as follows, where I tested to encode to uncompressed v210 instead >> of ffv1, but with no change with regards to low 5 fps: >> >> ffmpeg -hide_banner -f v4l2 -framerate 25 -video_size 1920x1080 -i >> /dev/video0 -codec:v v210 -codec:a pcm_s16le -f matroska 1920x1080_v210.mkv >> [video4linux2,v4l2 @ 0x55944900e0c0] The driver changed the time >> per frame from 1/25 to 1/5 >> >> I also read a related issue and reply to this post at Superuser, >> where 1920x1080 was not supported on the webcam. >> >> https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... >> >> Also look out for usb2 vs usb3 ports? Shouldn't capture device hang >> on bus 002 (usb 3.0) root hub, instead of bus 001 (usb 2.0 root hub), from >> lsusb below? >> >> >> This may well work better. I have to admit that I have never >> studied the difference between shared usb buses. My thought was to try to >> change the connected usb devices, but tested first the only free usb3 port >> (blue) on the add-on frontpanel of the workstation. The other two usb3 >> ports are on the backpanel and are used for the Asus blu-ray burner and 8TB >> Seagate expansion video disc. >> >> The other usb ports on both panels are usb2 ports, whereof two for >> the wireless keyboard and mouse on the fronpanel. What I possibly already >> have mentioned before, is that sometimes if I connect a usb(2) device or >> memory to the usb3 port on the frontpanel, this cause hang on the keyboard >> or mouse. But this didn't happend this time with the USB3 capture stick. >> >> >> >> >>> Someone here that have suggestion to possibly modified syntax or >>> can verify that the driver doesn't manage this? >>> >>> Another (setup) problem, there was no audio recorded or heard >>> during playback!? >>> >>> In the following I list the test command syntax I've collectedf >>> and tried with shortened output (yet long): >>> To explain, I have also another USB 2.0 Webcam connected, beside >>> the new HDMI-USB3 Videstick. >>> >>> Verify the devices, drivers and formats: >>> --------------------------------------- >>> dmesg | tail >>> [22706.060759] perf: interrupt took too long (2521 > 2500), >>> lowering kernel.perf_event_max_sample_rate to 79250 >>> [32105.561575] perf: interrupt took too long (3158 > 3151), >>> lowering kernel.perf_event_max_sample_rate to 63250 >>> [40586.477420] usb 1-5: USB disconnect, device number 2 >>> [40599.099612] usb 1-5: new high-speed USB device number 5 using >>> xhci_hcd >>> [40599.250960] usb 1-5: New USB device found, idVendor=534d, >>> idProduct=2109, bcdDevice=21.00 >>> [40599.250972] usb 1-5: New USB device strings: Mfr=1, Product=2, >>> SerialNumber=0 >>> [40599.250978] usb 1-5: Product: USB Video >>> [40599.250984] usb 1-5: Manufacturer: MACROSILICON >>> [40599.252310] usb 1-5: Found UVC 1.00 device USB Video (534d:2109) >>> [40599.256234] hid-generic 0003:534D:2109.0006: hiddev96,hidraw0: >>> USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-5/input4 >>> ----------------------------- >>> >>> lsusb >>> Bus 002 Device 003: ID 05e3:0732 Genesys Logic, Inc. All-in-One >>> Cardreader >>> Bus 002 Device 002: ID 0bc2:2038 Seagate RSS LLC Expansion HDD >>> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub >>> Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver >>> Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video >>> Bus 001 Device 004: ID 0c45:6340 Microdia Camera >>> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub >>> >>> >>> udevadm info /dev/video* | egrep 'DEVNAME|ID_V4L_PRODUCT' >>> E: DEVNAME=/dev/video0 >>> E: ID_V4L_PRODUCT=USB Video: USB Video >>> E: DEVNAME=/dev/video1 >>> E: ID_V4L_PRODUCT=USB Video: USB Video >>> E: DEVNAME=/dev/video2 >>> E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam >>> E: DEVNAME=/dev/video3 >>> E: ID_V4L_PRODUCT=USB 2.0 Camera: HD 720P Webcam >>> >>> lsusb | egrep 'Video|Camera' >>> Bus 001 Device 005: ID 534d:2109 MacroSilicon USB Video >>> Bus 001 Device 004: ID 0c45:6340 Microdia Camera >>> >>> -------------------- >>> >>> ll /dev/video* >>> crw-rw----+ 1 root video 81, 0 feb. 7 20:22 /dev/video0 >>> crw-rw----+ 1 root video 81, 1 feb. 7 20:22 /dev/video1 >>> crw-rw----+ 1 root video 81, 2 feb. 7 09:05 /dev/video2 >>> crw-rw----+ 1 root video 81, 3 feb. 7 09:05 /dev/video3 >>> >>> ----------------------- >>> >>> v4l2-ctl --list-devices >>> USB 2.0 Camera: HD 720P Webcam (usb-0000:00:14.0-11): >>> /dev/video2 >>> /dev/video3 >>> >>> USB Video: USB Video (usb-0000:00:14.0-5): >>> /dev/video0 >>> /dev/video1 >>> >>> ------------------------- >>> >>> ffmpeg -f v4l2 -list_formats all -i /dev/video0 >>> ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video0 >>> [video4linux2,v4l2 @ 0x556cf63570c0] Compressed: mjpeg >>> : Motion-JPEG : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 >>> 1280x720 1024x768 800x600 720x576 720x480 640x480 >>> [video4linux2,v4l2 @ 0x556cf63570c0] Raw : yuyv422 >>> : YUYV 4:2:2 : 1920x1080 1600x1200 1360x768 1280x1024 1280x960 >>> 1280x720 1024x768 800x600 720x576 720x480 640x480 >>> /dev/video0: Immediate exit requested >>> >>> ffmpeg -hide_banner -f v4l2 -list_formats all -i /dev/video1 >>> [video4linux2,v4l2 @ 0x5560c0bc70c0] ioctl(VIDIOC_G_INPUT): >>> Inappropriate ioctl for device >>> /dev/video1: Inappropriate ioctl for device >>> ---------------- >>> >>> v4l2-ctl --all >>> Driver Info (not using libv4l2): >>> Driver name : uvcvideo >>> Card type : USB Video: USB Video >>> Bus info : usb-0000:00:14.0-5 >>> Driver version: 5.14.21 >>> Capabilities : 0x84A00001 >>> Video Capture >>> Metadata Capture >>> Streaming >>> Extended Pix Format >>> Device Capabilities >>> Device Caps : 0x04200001 >>> Video Capture >>> Streaming >>> Extended Pix Format >>> Priority: 2 >>> Video input : 0 (Camera 1: ok) >>> Format Video Capture: >>> Width/Height : 1920/1080 >>> Pixel Format : 'MJPG' >>> Field : None >>> Bytes per Line : 0 >>> Size Image : 4147200 >>> Colorspace : sRGB >>> Transfer Function : Rec. 709 >>> YCbCr/HSV Encoding: ITU-R 601 >>> Quantization : Default (maps to Full Range) >>> Flags : >>> Crop Capability Video Capture: >>> Bounds : Left 0, Top 0, Width 1920, Height 1080 >>> Default : Left 0, Top 0, Width 1920, Height 1080 >>> Pixel Aspect: 1/1 >>> Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080 >>> Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080 >>> Streaming Parameters Video Capture: >>> Capabilities : timeperframe >>> Frames per second: 30.000 (30/1) >>> Read buffers : 0 >>> brightness 0x00980900 (int) : min=-128 >>> max=127 step=1 default=-11 value=-11 >>> contrast 0x00980901 (int) : min=0 >>> max=255 step=1 default=148 value=148 >>> saturation 0x00980902 (int) : min=0 >>> max=255 step=1 default=180 value=180 >>> hue 0x00980903 (int) : min=-128 >>> max=127 step=1 default=0 value=0 >>> >>> ----------------- >>> >>> v4l2-ctl --list-formats-ext >>> ioctl: VIDIOC_ENUM_FMT >>> Index : 0 >>> Type : Video Capture >>> Pixel Format: 'MJPG' (compressed) >>> Name : Motion-JPEG >>> Size: Discrete 1920x1080 >>> Interval: Discrete 0.017s (60.000 fps) >>> Interval: Discrete 0.033s (30.000 fps) >>> Interval: Discrete 0.040s (25.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 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) >>> >> > > well, it seems we know by now why this device was ...unexpensive. > > > Yes, I have a "90-days open order" and will start to search for > another, better UVC video capture device. > The problem is the lack of definitive specifications, compared with > my proprietary BMD devices. > > > it really seems to report only 5-10 fps at fullHD uncompresed, > anything bigger is mjpeg ... > > > Type : Video Capture > Pixel Format: 'YUYV' > Name : YUYV 4:2:2 > Size: Discrete 1920x1080 > Interval: Discrete 0.200s (5.000 fps) > > This can absolutely not be what they promote as: > "Fluid video recordings without delays or distortions during live > streaming, thanks to a picture frequency of 60 Hz and 1080p with Full HD". > > > > https://superuser.com/questions/1449252/ffmpeg-captures-from-uvc-dev-video0-... > > > I also tried that link's suggested syntax > > ffmpeg -y -t 15 -f video4linux2 -video_size 1920x1080 -input_format nv12 -timestamps abs -use_libv4l2 1 -i /dev/video0 out.mov > > but it didn't work for me, just quitted ffmpeg with > > Unrecognized option 'timestamps'. > Error splitting the argument list: Option not found > > Looking at ffmpeg man pages at https://manpages.org/ffmpeg/1 there > also is a similar video4linux2 syntax example > > Grab and record the input of a video4linux2 device, leave the frame > rate and size as previously set: > ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg > > > - video_size > - Set the video frame size. The argument must be a string in > the form WIDTHxHEIGHT or a valid size abbreviation. > - pixel_format > - Select the pixel format (only valid for raw video input). > - input_format > - Set the preferred pixel format (for raw video) or a codec > name. This option allows one to select the input format, when several are > available. > > But what should be set as input_format in this case? > > YUYV ? (lowercase)
ffmpeg -hide_banner -f video4linux2 -input_format yuyv -i /dev/video0 out.mkv [video4linux2,v4l2 @ 0x55b25017e0c0] No such input format: yuyv. /dev/video0: Invalid argument
:(
Yes, 'yuyv422' at least not returned any errors, but just verified 5 fps from the encoded file
ffmpeg -hide_banner -f video4linux2 -input_format yuyv422 -i /dev/video0 out.mkv
ffprobe -hide_banner out.mkv Input #0, matroska,webm, from 'out.mkv': Metadata: ENCODER : Lavf58.76.100 Duration: 00:00:12.40, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: vp9 (Profile 1), yuv422p(tv, progressive), 1920x1080, 5 fps, 5 tbr, 1k tbn, 1k tbc (default) Metadata: ENCODER : Lavc58.134.100 libvpx-vp9 DURATION : 00:00:12.400000000
Any idea why the audio:0kB from '-codec:a pcm_s16le' disappeared in the encoded files?
inxi -GA Graphics: Device-1: NVIDIA GK208B [GeForce GT 730] driver: nouveau v: kernel Device-2: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-3: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Display: server: SUSE LINUX 1.20.3 driver: loaded: nouveau unloaded: fbdev,modesetting,vesa resolution: 2560x1440~60Hz OpenGL: renderer: llvmpipe (LLVM 11.0.1 256 bits) v: 4.5 Mesa 21.2.4 Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio driver: snd_hda_intel Device-2: NVIDIA GK208 HDMI/DP Audio driver: snd_hda_intel Device-3: Microdia Camera type: USB driver: snd-usb-audio,uvcvideo Device-4: MacroSilicon USB Video type: USB driver: hid-generic,snd-usb-audio,usbhid,uvcvideo Sound Server-1: ALSA v: k5.14.21-150400.24.41-default running: yes Sound Server-2: PulseAudio v: 15.0 running: yes Sound Server-3: PipeWire v: 0.3.49 running: yes
I think for audio you need few more alsa switches:
https://askubuntu.com/questions/1451630/hdmi-capture-card-macrosilicon-ms210...
something like this but find/use your own alsa device :)
What I feel unused to is the need to set ffmpeg code both Audio and Video input format and input device respectively. A couple of syntax examples for audio found:
ffmpeg \
-f alsa -ac 2 -i hw:CARD=HDMI,DEV=0 https://trac.ffmpeg.org/wiki/Capture/V4L2_ALSA
-f pulse -ac 2 -i default
https://dev.to/ethand91/how-to-record-webcam-video-and-audio-using-ffmpeg-41...
Suggestions here what to use from the listing below?
participants (2)
-
Andrew Randrianasulu -
Terje J. Hanssen