dhid
Posts: 13
Joined: Wed Feb 06, 2013 3:23 pm
Location: UK

Video is mirror image

Wed May 15, 2013 4:27 pm

I've just connected up my newly arrived camera module and it is displaying video, both in the preview window and in recorded file, as mirror image. This applies to video and still images.

The display is otherwise normal.

Any ideas?

mikerr
Posts: 2802
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Video is mirror image

Wed May 15, 2013 4:32 pm

There's a Horizontal Flip option "-hf"

Code: Select all

raspistill  -hf -o image.jpg
Android app - Raspi Card Imager - download and image SD cards - No PC required !

dhid
Posts: 13
Joined: Wed Feb 06, 2013 3:23 pm
Location: UK

Re: Video is mirror image

Wed May 15, 2013 4:47 pm

Thanks - yes I've just discovered and tried that option and it does fix it but if you don't use it the video always reverts to mirror image. I've tried powering off/on again but no joy.

Do they all do this?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5380
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Video is mirror image

Wed May 15, 2013 5:31 pm

dhid wrote:Thanks - yes I've just discovered and tried that option and it does fix it but if you don't use it the video always reverts to mirror image. I've tried powering off/on again but no joy.

Do they all do this?
Yes. It's quite normal to flip the viewfinder on a front mounted camera (try it with the front camera of an iPhone) which is used for web chat type uses.
A rear mounted camera wouldn't normally be flipped.

Whether you think of this as being a front mounted camera or rear mounted camera is up to you.

dhid
Posts: 13
Joined: Wed Feb 06, 2013 3:23 pm
Location: UK

Re: Video is mirror image

Wed May 15, 2013 7:17 pm

Yes. It's quite normal to flip the viewfinder on a front mounted camera (try it with the front camera of an iPhone) which is used for web chat type uses.
A rear mounted camera wouldn't normally be flipped.
Yes I understand the viewfinder point, but if I take a picture/video with my iPhone using either the front or rear camera it still records it to file the correct way round.

So is the Pi camera software supposed to record to file the correct way without using the -fh option?
I would have imagined the default would be to record not mirrored.
It's not a problem, I'm just curious.

EDIT typo: I meant -hf option of course.

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

Re: Video is mirror image

Wed May 15, 2013 7:35 pm

dhid wrote:
Yes. It's quite normal to flip the viewfinder on a front mounted camera (try it with the front camera of an iPhone) which is used for web chat type uses.
A rear mounted camera wouldn't normally be flipped.
Yes I understand the viewfinder point, but if I take a picture/video with my iPhone using either the front or rear camera it still records it to file the correct way round.

So is the Pi camera software supposed to record to file the correct way without using the -fh option?
I would have imagined the default would be to record not mirrored.
It's not a problem, I'm just curious.

EDIT typo: I meant -hf option of course.
On a SS (e.g. S2ve) phone the picture can be flipped when saving (it's an option), but by default its as if you are looking in a mirror which is technically flipped...

But I see you point about the default - I wonder if we ought to swap it. I'll have a chat with Dom in the morning.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5380
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Video is mirror image

Wed May 15, 2013 8:07 pm

jamesh wrote:But I see you point about the default - I wonder if we ought to swap it. I'll have a chat with Dom in the morning.
Yes, I'd say flip the default.
May also want to allow separate flip of viewfinder compared to encoding for web chat type apps.

dhid
Posts: 13
Joined: Wed Feb 06, 2013 3:23 pm
Location: UK

Re: Video is mirror image

Wed May 15, 2013 8:11 pm

Thanks for your help guys.

By the way, I meant to say, I think you've done a good job with the camera, I'm impressed with the quality.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Video is mirror image

Thu May 16, 2013 2:01 pm

Is it just me or is this behaviour bizarre ?

When I take a picture with a digital camera it should be the right way round as default. Whatever the camera does itself internally and this viewfinder front/back bit is irrelevent. The default should be to be correct. Get it changed now before it becomes a stupid standard.

I spent 5 minutes trying to fathom why my kitchen looked odd on the picture it took......

On a more positive note, the quality is excellent.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

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

Re: Video is mirror image

Thu May 16, 2013 2:08 pm

pluggy wrote:Is it just me or is this behaviour bizarre ?

When I take a picture with a digital camera it should be the right way round as default. Whatever the camera does itself internally and this viewfinder front/back bit is irrelevent. The default should be to be correct. Get it changed now before it becomes a stupid standard.

I spent 5 minutes trying to fathom why my kitchen looked odd on the picture it took......

On a more positive note, the quality is excellent.
"Get it changed now before it becomes a stupid standard"

I think you forgot "Please"


When you put a camera in a phone, it can either be on the front, on the back, the sensor itself can be mounted upside down (what ever that is), or even sideways. Even different models of the same phone can have the sensor mounted in different orientations. Then the customer may want it to be mirrored or not. And at least one customer we have wants the capture to be the other way round to the preview. It's not going to become a standard...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Video is mirror image

Thu May 16, 2013 2:11 pm

Can I throw in a vote for having the image flipped (or rather 'correct') by default please. The current behaviour is just weird.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Video is mirror image

Thu May 16, 2013 2:26 pm

jamesh wrote: "Get it changed now before it becomes a stupid standard"

I think you forgot "Please"


When you put a camera in a phone, it can either be on the front, on the back, the sensor itself can be mounted upside down (what ever that is), or even sideways. Even different models of the same phone can have the sensor mounted in different orientations. Then the customer may want it to be mirrored or not. And at least one customer we have wants the capture to be the other way round to the preview. It's not going to become a standard...
I'm sorry.

Please get it changed now before it becomes a stupid standard.

Its a raw camera module, its not in a phone. It should take pictures correctly when you point it at something. The "customer" can put -hf in the command line if he wants a mirror image. The rest of us want it the right way round. :)
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
piglet
Posts: 911
Joined: Sat Aug 27, 2011 1:16 pm

Re: Video is mirror image

Thu May 16, 2013 2:30 pm

+1 (but as a "pretty please with bells on" as and when you have time to get round to it :)).

User avatar
RaTTuS
Posts: 10519
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Video is mirror image

Thu May 16, 2013 2:33 pm

+100
flip it horizonally - as the writing is the wrong way round... ;-p

/me trying to turn it into an IP camera
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: Video is mirror image

Thu May 16, 2013 2:43 pm

+1 ( And I haven't even started playing with it yet :-))

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Video is mirror image

Thu May 16, 2013 2:44 pm

Image
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

MarkDaniels
Posts: 59
Joined: Sun Oct 28, 2012 2:01 pm

Re: Video is mirror image

Thu May 16, 2013 2:56 pm

jamesh wrote:
But I see you point about the default - I wonder if we ought to swap it. I'll have a chat with Dom in the morning.
James, I, too, would definitely like to see the default setting swapped so that the camera is rear facing (i.e. output not mirrored). Perhaps you could arrange for a toggle in the software that we can set so that we can choose which is the default setting for the command line.

Thanks. Great little camera, BTW. Nice job overall.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Video is mirror image

Thu May 16, 2013 3:09 pm

Maybe I should try it on a Pi that still has X on it.....

I have a script that strips X and a lot of the GUI stuff of a Raspdian Image for my headless Pis It makes a lot more room for stuff on the card, whilst keeping the best supported OS.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

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

Re: Video is mirror image

Thu May 16, 2013 3:56 pm

MarkDaniels wrote:
jamesh wrote:
But I see you point about the default - I wonder if we ought to swap it. I'll have a chat with Dom in the morning.
James, I, too, would definitely like to see the default setting swapped so that the camera is rear facing (i.e. output not mirrored). Perhaps you could arrange for a toggle in the software that we can set so that we can choose which is the default setting for the command line.

Thanks. Great little camera, BTW. Nice job overall.
Well, you have the software source to do it in the app - quick job, but I think I'll try and sort it out in the firmware.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Video is mirror image

Thu May 16, 2013 4:42 pm

James, if you do the fix in firmware does that mean the preview will work? Currently, adding -hf to the command produces an image the right way round but the preview doesn't display, just a brief flash as the image is taken at the end of the preview period.

mikerr
Posts: 2802
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Video is mirror image

Thu May 16, 2013 5:18 pm

The -e option will show the preview after compression - maybe that's also after flipping - not tried it though.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

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

Re: Video is mirror image

Thu May 16, 2013 6:29 pm

Allan wrote:James, if you do the fix in firmware does that mean the preview will work? Currently, adding -hf to the command produces an image the right way round but the preview doesn't display, just a brief flash as the image is taken at the end of the preview period.
Yes, I've noticed that but simply haven't had time to investigate it. Works fine in video mode, but not in capture which is a bit bizarre. I hope to have time to look at it tomorrow - I'm not allowed to take the source code home (except on my laptop, and I left it at work...).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

Allan
Posts: 15
Joined: Thu Dec 22, 2011 12:16 pm

Re: Video is mirror image

Thu May 16, 2013 6:52 pm

Thanks James. I'm in no rush, there are plenty of other things to fiddle with.

Return to “Camera board”