Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[RESOLVED !] need for help for getting high quality video from my camera, on files kdenlive can process

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
AoiHana
Posts: 34
Joined: 2016-02-13 08:22

[RESOLVED !] need for help for getting high quality video from my camera, on files kdenlive can process

#1 Post by AoiHana »

guvcview

Hi.
The issue is not with debian per se, but I don't know where to ask so...
I have a camera (logitech, luckily, linux should fare well) and my computer isn't top notch. I wished to use guvcview to record at highest resolution (1280x720) at 30 fps. the quality is enough for me.
But I must avoid lagging, and I can avoid it (while maintaining sufficient quality) only with the raw video format, and HEVC (h265).
all others (vp8 and vp9) have terrible, unusable lagging.

BUT: kdenlive can't work with the raw format (actually only mpv can read it decently...) and videos produced with the HEVC format simply don't read at all. Actually: almost all formats produced by guvcview are unreadable or unworkable.
This is ridiculous, what's wrong ? Changing camera output from MJPG to about anything else also make for unreadable formats, but I need my 30 fps.

guvcview format: 2.0.6, debian testing, kdenlive last version.

Of course, guvcview last version doesn't compile because debian's incompatible version of qt (or gtk, I don't remember). GREAT!

So, please help me get that damn camera to produce maximum quality videos that kdenlive can process.
Or davinci resolve, which, once installed, only create black rectangle when run.
I can run webcamoid (latest version) but I have that lagging issue, it takes more resource and I don't see such a "raw format" option...

Thanks for your help.
Last edited by AoiHana on 2021-09-27 11:54, edited 1 time in total.

User avatar
cds60601
df -h | participant
df -h | participant
Posts: 698
Joined: 2017-11-25 05:58
Location: Florida
Has thanked: 129 times
Been thanked: 59 times

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#2 Post by cds60601 »

Have you looked at this? Not saying its the answer, and it is a bit dated but I thought it might give you some insight.
https://superuser.com/questions/407573/ ... -webcamera

I'm curious - have you looked at ffmpeg or simplescreenrecorder?
Have a look here too: https://stackoverflow.com/questions/472 ... -framerate

Just trying to give you a few more options :)
Supercalifragilisticexpialidocious

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#3 Post by CwF »

AoiHana wrote: 2021-09-22 21:57 guvcview

I can run webcamoid (latest version) but I have that lagging issue, it takes more resource and I don't see such a "raw format" option...
I'm not familiar with these programs and wonder if the webcam has a raw front end enumerated in /dev/ and if so I believe mpv could direct view, and stream to file. If so, low level you could maybe pipe to ffmpeg to compress, and if so use h264. h265 is very heavy on the compute side to maintain real time while h264 is a tenth the processing. Of course you loose the camera controls if you use a direct stream, everything would be post process.

For broadcast h264 my main box can do 130+ fps HD, h265 chokes that to 45fps.

AoiHana
Posts: 34
Joined: 2016-02-13 08:22

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#4 Post by AoiHana »

Interesting, thanks !
It seems to work but... almost completely white, are you sure there is nothing lost in reducing the luminosity afterwards instead of from a GUI ?
Image
And the focus fonction is lost: it seemed to me that it's a mechanical control of the camera, it can't be got back by a software. This is the most worrying.

So I use:
ffmpeg -f v4l2 -framerate 60 -video_size 1280x720 -input_format mjpeg -i /dev/video1 -preset faster -pix_fmt yuv420p out.mkv
Kdenlive accepts the result but then I have no earthly clue how to get the frames to look more or less like it should.

As for mpv I use: mpv /dev/video2 --profile=low-latency --untimed --no-correct-pts --fps=30 --opengl-glfinish=yes --opengl-swapinterval=0 --vo=xv --framedrop=no --sp
eed=1.01 > essai.mkv
which seems to show not lagging at all, very good. But given that the aforementioned issues still hold I can't verify the resolution very much the essai.mkv is unreadable:
root@debian /h/m/Bureau# mpv essai.mkv
Failed to recognize file format.
Exiting... (Errors when loading file)

Here's the camera's capabilities:

Code: Select all

root@debian /h/m/Bureau# v4l2-ctl -d /dev/video2 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture
	[0]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 1280x800
			Interval: Discrete 0.100s (10.000 fps)
	[1]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.133s (7.500 fps)
Ideally I would keep the latest format and force 30 fps, but it's up to you. MJPG is fine I guess.

Assuming we can correct all those things, and apply corrections, I could then stream it to the screen for my friend to see himself. With your help I think we'll manage it.
Thanks.

AoiHana
Posts: 34
Joined: 2016-02-13 08:22

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#5 Post by AoiHana »

The finest options I could settle on are:

Code: Select all

root@debian /h/m/Images# nice --20 ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -input_format mjpeg -i /dev/video2 -crf 0 -preset ultrafast here.mkv
I read presets don't change quality, only crf does, and I want lossless.
No lagging. excellent.
one issue luminosity would flicker in one attempt, but doesn't seem to with the ultrafast + nice --20 settings. that time it did it with ffmpeg, and not with guvcview. Very annoying, but it doesn't seem to both me again.
mpv always lags and the quality seems lower, despite these options: nice --20 mpv /dev/video2 --profile=low-latency --untimed --no-correct-pts --fps=30 --opengl-glfinish=yes --opengl-swapinterval=0 --framedrop=no --spe
ed=1.01 > mpv.mkv
I got it: guvcview change the hardware settings, which stays like this for other programs until changed again ! Excellent !
if you have suggestions to improve quality one way or another... maybe something smarter than crf = 0 ?? another lossless format ? I read that lossless h264 is something you never do... A better way to go lossless ?

now my problem seems is entirely resolved.
THANK YOU LOTS !

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#6 Post by CwF »

AoiHana wrote: 2021-09-24 01:37 I got it: guvcview change the hardware settings, which stays like this for other programs until changed again ! Excellent !
very good!
You have the hardware! It seems the challenge is is good hands.

AoiHana
Posts: 34
Joined: 2016-02-13 08:22

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#7 Post by AoiHana »

Yep, now it's in utvideo format, I got my humongus file size that I like !
Whether or not kdenlive will tolerate a 2 Go file is another issue.

Last issue: how do I redirect ffpmpeg result to standard output AND a file as usual ? In real time ? It does not feature the normal > < redirection syntax.
Also I use the hflip virtual filter, please take that into the equation.

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#8 Post by peter_irich »

For two output from ffmpeg "-filter_complex" option required, but it is not simply, I never used it. See "man ffmpeg".

Peter.
Last edited by peter_irich on 2021-09-24 19:52, edited 1 time in total.

AoiHana
Posts: 34
Joined: 2016-02-13 08:22

Re: need for help for getting high quality video from my camera, on files kdenlive can process

#9 Post by AoiHana »

I'll create a new thread for the monitoring issue.
THANKS YOU LOT.

Post Reply