atomiclama
Posts: 4
Joined: Mon Jun 02, 2014 1:10 pm

video jumps on pan!

Mon Jun 02, 2014 1:20 pm

Hi all
just started using the camera module on my pi attached to my quadcopter but have this strange jumping of the video when I pan

https://www.youtube.com/watch?feature=p ... gvdMg_AtQc
Any ideas what it could be?

The video is being stored onto a USB stick formatted FAT32.

So bandwidth problem with USB stick?
FAT32 not able to handle the data?
PSU problems ? Don't think it is this as the same happened when the Quad was not running.

I'll be trying a few things but just wanted to know what the gurus thought.

Cheers all
Last edited by atomiclama on Mon Jun 02, 2014 9:23 pm, edited 1 time in total.

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

Re: video jumps on pan!

Mon Jun 02, 2014 7:27 pm

Bad link - 404 error on following it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: video jumps on pan!

Mon Jun 02, 2014 7:37 pm

Does your video footage wobble or warp when panning??

Richard S.

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

Re: video jumps on pan!

Mon Jun 02, 2014 7:46 pm

Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

atomiclama
Posts: 4
Joined: Mon Jun 02, 2014 1:10 pm

Re: video jumps on pan!

Mon Jun 02, 2014 9:26 pm

Just updated the URL for the youtube video. New to youtube stuff so be kind :D

Don't think it is rolling shutter artifacts. Better look at video rather than me try and badly explain it. It's in the last 10 sec of the pan.

Oh and it's not the jelllo wobble I have a problem with I know the many reasons that it is there.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: video jumps on pan!

Mon Jun 02, 2014 9:49 pm

Are you sharing power with Pi and quadcopter or running from separate power packs??

Richard S.

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

Re: video jumps on pan!

Mon Jun 02, 2014 10:24 pm

Can you try it at 720p or reduce the bitrate? I wonder if there is a bandwidth problem when saving to the SD card as it looks like its dropping frames.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
jbeale
Posts: 3494
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: video jumps on pan!

Mon Jun 02, 2014 11:15 pm

The dark bands across the image, for example at 0:25 just before the dropped frames, are also not typical (at least for me). I'm wondering if you have a lot of RF interference, either direct to the sensor or conducted via the power supply.

ethanol100
Posts: 585
Joined: Wed Oct 02, 2013 12:28 pm

Re: video jumps on pan!

Tue Jun 03, 2014 6:37 am

I would guess the io bandwidth is to low, if we pan alot is changing in the picture and we will tend to get the full specified bitrate.

For the dark bands in the video the answer could simply be shadow of the propeller? While rotating the sun shines trough two propellers with different rotation orientations and while panning one direction has different speed. Together with the the rolling shutter effect could give these two types of dark bands.

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

Re: video jumps on pan!

Tue Jun 03, 2014 6:55 am

I *think* the bands are the digital equivalent of lens flare. You get some odd effects if the pixel site becomes completely saturated over large areas IIRC, and the banding only occurs when the camera points towards the sun.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

PiGraham
Posts: 3608
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: video jumps on pan!

Tue Jun 03, 2014 7:32 am

A fast pan can change image data a lot and push up the bit rate requirement. Do you get the same effect on the ground with a fast pan? How about a slow pan? You could try recording at lower resolution to see if the problem goes away. If it does then maybe you can investigate bit rates and storage bandwith. Maybe use a faster SD card or USB stick. Maybe a specified bit rate would drop some detail without the jumping when there is a lot changing in the scene.

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

Re: video jumps on pan!

Tue Jun 03, 2014 7:38 am

There appear to be a lot of dropped frames there to get such jumps in the video.

We're missing some information to make an accurate assessment.
Firstly what resolution was being recorded? YouTube shows a max of 720P and a 10MB clip. That translates to about 3.2Mb/s which seems reasonable. Working on that basis, then the USB stick would have to be VERY slow to cause glitches like the ones you see, as the encoder has a 2MB FIFO on the output side, so that would have to be totally full to stall the pipe. And if it were, then I wouldn't expect it to recover for as long as it does.
The codec does have the option to skip frames entirely if encoding them would totally blow the bitrate control. Again, I wouldn't expect quite so many frames to be dropped in this manner.

I'd say try it with a faster storage device, but it'd also be worth adding some extra logging to raspivd (I'm assuming that is what you're using to record) to dump out the frame timestamps and sizes. The icing on the cake would be to add in full container handling, but my time is probably too limited for that at the moment.

I'm ignoring the banding. Others have made comments which all seem valid. I would have guessed noise on the power supply to the sensor, but I don't know for sure. I've seen it once or twice on my sensor, but not as badly as this so other factors may be in play.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: video jumps on pan!

Tue Jun 03, 2014 11:24 am

YouTube shows a max of 720P and a 10MB clip. That translates to about 3.2Mb/s which seems reasonable.
Youtube always transcodes uploads. You can't really infer what the original bitrate was.

atomiclama
Posts: 4
Joined: Mon Jun 02, 2014 1:10 pm

Re: video jumps on pan!

Tue Jun 03, 2014 8:42 pm

Thanks for the replies all.

I'll be trying a few things and replying to some of the comments in more detail when I get some free time. Ha.

Cheers

atomiclama
Posts: 4
Joined: Mon Jun 02, 2014 1:10 pm

Re: video jumps on pan!

Wed Jun 04, 2014 10:24 am

@rehawk The power is from the regulators on the motor speedcontrollers so could be noisey, this 5V is shared with the flight controller and the radio reciever. The thing is I get the same problem when the motors are not running so don't think it is this that is causeing my jump.

@jbeale The dark bands are shadows from the propellers as mentioned by others, only get it when pointing into the sunlight.

@6by9 I using basic default raspvid config
  • raspivid -o /media/test.h264 -t 600000&
I'm going down the bandwidth problem to start with.

So I originally used a USB stick for storage as I read somewhere that they was faster than the SD interface. But it turns out the one I have is quite slow in comparison.
  • SD card

    sudo dd if=/dev/zero of=/media/dump.bin bs=10M count=100
    100+0 records in
    100+0 records out
    1048576000 bytes (1.0 GB) copied, 94.4936 s, 11.1 MB/s

    USB stick
    sudo mount /dev/sda1 /media/
    sudo dd if=/dev/zero of=/media/dump.bin bs=10M count=100
    100+0 records in
    100+0 records out
    1048576000 bytes (1.0 GB) copied, 239.032 s, 4.4 MB/s
Will get some video saving direct to the SD Card and see how that goes


What sort of bandwidth do I need for full resolution?

Cheers all

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

Re: video jumps on pan!

Wed Jun 04, 2014 10:44 am

Do some tests at different bitrates to see how the quality changes. You can get pretty low before it all goes really pear shaped. For 1080p30, 25Mbits/s is pretty good quality, but it should still be pretty good at 15Mbits/s.

Or drop to 720p30, since that isn't a huge quality drop, and 10Mbits/s should be fine.

But just try out different numbers, it's quick and easy to do on the desktop.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Camera board”