lkt
Posts: 5
Joined: Sun May 06, 2018 5:42 pm

Raspistill vs Raspivid quality issue

Sat May 19, 2018 2:51 pm

Hi,

I've been playing around with the camera but I'm having trouble getting a good quality from raspivid.

For comparison, here is a 720p image taken with raspistill -w 1280 -h 720 -o 1280.jpg
The colours are off but I think the quality is fairly good.
https://image.ibb.co/cJ0PJ8/1280.jpg
Image

Here is a 5 second 720p video taken with raspivid -w 1280 -h 720 -t 5000 -o 1280.h264
The colours are correct but the quality is terrible.
Uploaded in several places:
https://www.dropbox.com/s/9x64vy1luu2xdnl/1280.mp4?dl=0
https://streamable.com/68u9q
https://gfycat.com/CharmingGraciousDorado

Any idea why the quality is so bad in the video? The field of view is also completely different.

Thanks

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20278
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspistill vs Raspivid quality issue

Sat May 19, 2018 4:33 pm

Compression artifacts? You could try increasing the bit rate.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5557
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Raspistill vs Raspivid quality issue

Sat May 19, 2018 4:52 pm

You don't say which version of the camera module you are using. Fortunately the JPEG has retained the EXIF information so I can deduce that it is the V1 Omnivision OV5647, probably a clone seeing as that module hasn't been sold by RPT since 2015.

You don't say exactly what aspect of the image quality you're viewing as terrible, so it's hard to give specifics.

All stills captures will use the full resolution of the sensor (5MPix in this case) and downsize it to make the output image. The sensor can only manage 15fps at full resolution therefore a video mode wanting 30fps has to use a technique calling binning on the sensor to downsize the image. This is a coarser resize than for stills, therefore it will be slightly lower quality.

Secondly your JPEG is 686kB for a single frame. If you maintained that for video you'd be looking at 164Mbit/s. Those sorts of rates are not sustainable, so video is typically at 150-20Mbit/s (raspivid defaults to 18Mbit/s IIRC). Now H264 also uses temporal compression techniques to encode the differences between frames, but that still can't perform miracles. MPEG2 used to be nicknamed Motion Pictures Except Grass (it should be Motion Pictures Experts Group as they wrote the specification), because the high frequency detail of waving grass or running water would always make the codec stumble and become a blocky mess.

With regard the fIeld of view difference it's hard to compare the two images. There is a known issue that the 16:9 binned mode on OV5647 isn't quite centred vertically. Add "-md 4" to your raspivid command line and it'll force the 4:3 binned mode and crop the output to 16:9 and should give the same FOV as raspistill. We are deliberately not fixing it as it would mean that anyone who already has a camera set up and then upgraded their system would find their field of view change, and that is viewed as a worse issue than new users of an obsolete camera module finding they have to deal with the quirk.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

lkt
Posts: 5
Joined: Sun May 06, 2018 5:42 pm

Re: Raspistill vs Raspivid quality issue

Sun May 20, 2018 5:30 pm

Thanks for the detailed response! I've played with the mode settings, mode 2 seems to get the best quality and 15fps is enough for my needs.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 12 guests