How do I select a v...
 
Notifications
Clear all

How do I select a video format grabbed from a camera?

4 Posts
3 Users
0 Likes
3,904 Views
0
Topic starter

Hello, everyone!

My webcam, Logitech C920, can provide video streams as YUV, MJPEG and H264. (That's what qv4l4 says)

However, I guess due to some throughput problems, it can only supply decent framerate with either H264 or MJPEG. With YUV, I'm only getting 5 fps.

How do I make Cinelerra grab the video stream using H264 or MJPEG?

(Additionally, is there a way to make Cinelerra autodetect good image settings? qv4l2 somehow manages to adjust Hue, Saturation, Brightness, and the others, but in Cinelerra I have to set them manually)

 

4 Answers
0

@lockywolf

There are probably better answers than what I can supply, but here goes anyway.

How do I make Cinelerra grab the video stream using H264 or MJPEG?

I am not exactly sure what you are asking but Cinelerra reads the video stream using ffmpeg; it looks at the file and loads it using the format it was written in.  You can use tje command line ffmpeg to convert from one format to another prior to loading in Cinelerra.  After loaded, you can switch from YUV to RGB via the Settings-> Format pulldown.

Alternatively instead of using ffmpeg first to load your file, you can switch to using ffmpeg last, in which case it will try to read the video stream in one of the available native formats instead.  You change this mode in the upper right hand corner of the main timeline window by clicking on the "FF" icon.

is there a way to make Cinelerra autodetect good image settings?

Cinelerra does not automatically adjust any of the video stream settings such as hue, brightness, etc. because that is not what users really want.  Although we have come a long way with Artificial Intelligence, the computer has not been able to read our minds yet.  Frequently, we use the plugin, histeq, to automatically make default adjustments.

This post was modified 4 years ago by PhyllisSmith
0
Topic starter

I am not exactly sure what you are asking but Cinelerra reads the video stream using ffmpeg;

In ffmpeg terms what I am asking is how to set the -image_format option of the ffmpeg command line.

The way it is selected in the qv4l2 is a dropdown menu, whereas from the command line it looks like the following:

ffplay -f video4linux2 -input_format mjpeg -framerate 30 /dev/video0
ffplay version 4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 9.3.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-4.3.1/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --enable-avresample --arch=x86_64 --disable-encoder=aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libbluray --enable-libcaca --enable-libcdio --enable-libopus --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libwavpack
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, video4linux2,v4l2, from '/dev/video0':B sq= 0B f=0/0
Duration: N/A, start: 54665.163965, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 320x240 [SAR 96:96 DAR 4:3], 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[swscaler @ 0x7fed3c03fe00] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times
54669.73 M-V: 0.000 fd= 0 aq= 0KB vq= 503KB sq= 0B f=0/0

Whereas if I specify no -input_format, the default format of yuyv422 is used:

 

lockywolf@delllaptop:~/OfficialRepos$ ffplay -f video4linux2 -framerate 30 /dev/video0
ffplay version 4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 9.3.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-4.3.1/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --enable-avresample --arch=x86_64 --disable-encoder=aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libbluray --enable-libcaca --enable-libcdio --enable-libopus --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libwavpack
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, video4linux2,v4l2, from '/dev/video0':B sq= 0B f=0/0
Duration: N/A, start: 54774.820785, bitrate: 36864 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
54776.68 M-V: 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0

 

0

Hi,
I don't have much experience, but as a first step you go to Settings --> preferences --> Recording tab and set video drivers (video4 Linux2, for example), audio drivers and file format.
Then you set the recording from: File --> Record (or the shortcut "r").
Capturing from a webcam is explained in more detail in the Manual, section 12; 12.1:
https://cinelerra-gg.org/download/CinelerraGG_Manual.pdf
In any case you cannot change the signal of the webcam first or during the recording. We can only do it afterwards inside CinGG.

0

@lockywolf

A little more information after GG did some testing with a Logitech Pro Cam Notebook (which is at least 10 years old).  This camera can do 720x480 and when he tested with an independent program, called gtv, it only did 5 fps.  When he set the format down, it could still only do 7-9 fps.  When he ran using the same ffplay parameters that you noted, it reported 15 fps.

Anyway, he is looking at Cinelerra right now because he found some issues related to the fact that originally it worked with "qt" but qt was eliminated due to maintenance problems.  As Andrea references, there is an option in the Settings->Preferences, Recording tab menu to change the "Record Driver" to Video4Linux2 JPEG.  But not sure about that because of the previously mentioned other issues.  More later if discover more relevant information.

Share: