Quantcast

Kernel version for new Caspa and streaming compression project

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Kernel version for new Caspa and streaming compression project

John Chatman
Hi All,

I'm new to Gumstix and Linux and I would appreciate a little advice.

I have a FireSTORM, Tobi and Caspa. I want to create a system where I can stream compressed video from the camera to either the SD card or over the network. I'd quite like to open up the IVA element of the DM3730 for programming but that's not the first step.

From what I've read it looks like I can either go with a 2.6.34 kernel (with supported Caspa driver) or patch 2.6.39 (current latest gumstix factory build) which people seem to have different levels of success with. Which way to go...

This leads on to how to achieve streaming compression: OpenCV? ffmpeg? something else exploiting the DSP?

Any guidance for a newbie?

Has anyone gone through this already who would be prepared to have a chat / consult about it (I'm based in the UK)?

Thanks in advance!

John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

acsmith
Hi John,

I have a similar setup (FireSTORM with caspa).  I was able to build a 2.6.34 console image that used the DSP to compress video captured from the caspa and stream it over the network.  I did it a while ago but I remember it wasn't too difficult using the extremely helpful instructions at jumpnow.

Lately however, I needed to use a newer kernel (2.6.39) because the old one didn't support the Robovero (cdc_acm module has a problem with it).  Therefore, I needed to rebuild everything.  Getting the DSP to work wasn't too bad, it was just a matter of changing PREFERED_VERSION_ti-linuxutils Kernel Patching.  I didn't play around with the instructions for patching the kernel for the caspa because for my application that extremely short ribbon cable just won't cut it.  There's been some discussion on here about using a longer cable but with varying success.  I've decided to go with USB cameras.  They're supported right out of the box.  They seem to use more CPU time to do the same thing as the caspa but their versatility far outweighs the negatives.

My suggestion would be to get yourself up and running with OpenEmbedded Gumstix - OpenEmbedded, checkout the Jumpnow website I posted above (but by now you've probably been there).  Follow Scott's instructions there and build yourself a 2.6.34 kernel.  If you can stick with 2.6.34 that would probably be the easiest thing to do because his instructions are pretty extensive and should get you up and rolling.

Hope this helps, good luck.

Andrew
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

John Chatman
Hi Andrew,

Thanks very much for the detailed reply and the links, this is really helpful. I had come across Scott's instructions but wasn't sure if this was the best way to go.

Interesting observation about the USB cameras.

This all helps - thanks. Good luck with your project too.

John

On Mon, Jun 25, 2012 at 8:08 PM, acsmith <[hidden email]> wrote:
Hi John,

I have a similar setup (FireSTORM with caspa).  I was able to build a 2.6.34
console image that used the DSP to compress video captured from the caspa
and stream it over the network.  I did it a while ago but I remember it
wasn't too difficult using the extremely helpful instructions at
http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=81:gumstix-dsp-gstreamer&catid=35:gumstix&Itemid=67
jumpnow .

Lately however, I needed to use a newer kernel (2.6.39) because the old one
didn't support the Robovero (cdc_acm module has a problem with it).
Therefore, I needed to rebuild everything.  Getting the DSP to work wasn't
too bad, it was just a matter of changing PREFERED_VERSION_ti-linuxutils
http://gumstix.8.n6.nabble.com/Using-TI-DSP-link-with-3-0-0-kernel-td4626788.html
Kernel Patching .  I didn't play around with the instructions for patching
the kernel for the caspa because for my application that extremely short
ribbon cable just won't cut it.  There's been some discussion on here about
using a longer cable but with varying success.  I've decided to go with USB
cameras.  They're supported right out of the box.  They seem to use more CPU
time to do the same thing as the caspa but their versatility far outweighs
the negatives.

My suggestion would be to get yourself up and running with OpenEmbedded
http://gumstix.org/software-development/open-embedded/61-using-the-open-embedded-build-system.html
Gumstix - OpenEmbedded , checkout the Jumpnow website I posted above (but by
now you've probably been there).  Follow Scott's instructions there and
build yourself a 2.6.34 kernel.  If you can stick with 2.6.34 that would
probably be the easiest thing to do because his instructions are pretty
extensive and should get you up and rolling.

Hope this helps, good luck.

Andrew

--
View this message in context: http://gumstix.8.n6.nabble.com/Kernel-version-for-new-Caspa-and-streaming-compression-project-tp4964710p4964712.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Scott Ellis
This post was updated on .
Following up on what Andrew said, you might be interested in this post where I
was fooling around with three USB webcams streaming from a single Gumstx.

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=83:gumstix-multicam&catid=35:gumstix&Itemid=67

If nothing else it's a proof of concept.

The video was 640x480 color at 30fps from each camera with negligible load on
 the Gumstix, no DSP involved.


It was MJPEG video which many USB cameras support.

Network bandwidth wise, MJPEG is not a problem on most networks if the number
of cameras is reasonable. I've had 16 cameras going and the network was not the
problem. CPU load on the viewing machines was the bottleneck.

MJPEG is a bit of a storage problem, but that can be addressed by doing some
video compression on a bigger machine on the LAN. My partner at Pansenti has
done a post on this topic, but I can't find it right now.

MJPEG does have an advantage in stream processing in that every picture is
self-contained and you don't have to sync up.

Here's an example of some inline filtering of MJPEG

http://pansenti.wordpress.com/2012/02/09/syntro-pipeline-stream-filter-demonstration/


The driver on the Gumstix side for that first post is a simple custom V4L app,
part of our Syntro suite of apps. It doesn't work with every USB camera yet, but
that's just because we haven't taken the time.

The two missing features are

1. Handle MJPEG with restart markers embedded. Some of the newer webcams
do this. We transmit these images just fine. Qt (or rather the libjpeg library that Qt
uses) spews errors when uncompressing these images. So our standard SyntroView
app looks like it has errors we display the images on the other end. The images are
really fine. It's just an annoying warning message.

2. Some web cameras only provide YUV images. For these we are back to the same
problem as the Caspa. We could use the DSP or the ARM core with somthing like
libjpeg. We've just opted to choose the 'right' cameras to use with the Gumstix.

For many USB web cams it works just fine.

There are some more Syntro demos here.

http://pansenti.wordpress.com

Gumstix boards are one of my standard test platforms for Syntro, so most of
our apps run on it.

Syntro is GPL/LGPL and cross-platform. The kernel version is unimportant with
Syntro which is convenient, but it does require Qt.

If you want more details or need some help setting up Syntro on a Gumstix on
let me know. The offer applies to anyone.

We are looking for some Gumstix users.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

John Chatman
Hi Scott,

It's very good to have your input, thank you. I've looked at the links you provided - it's interesting what you are up to.

We are going to need streaming compression on the gumstix from the Caspa which I think means we'll need to dig into the DSP to achieve a decent frame rate but that seems quite a big step up from where we are currently. I'm holding out for that first link from Andrew to your site!

Thanks again and thanks for the offer of help.

John

On Tue, Jun 26, 2012 at 11:13 AM, jumpnowdev <[hidden email]> wrote:
Following up on what Andrew said, you might be interested in this post where
I
was fooling around with three USB webcams streaming from a single Gumstx.

http://www.jumpnowtek.com/index.php?option=com_content&view=article&id=83:gumstix-multicam&catid=35:gumstix&Itemid=67

If nothing else it's a proof of concept.

The video was 640x480 color at 30fps with negligible load on the Gumstix, no
DSP involved.


It was MJPEG video which many USB cameras support.

Network bandwidth wise, MJPEG is not a problem on most networks if the
number
of cameras is reasonable. I've had 16 cameras going and the network was not
the
problem. CPU load on the viewing machines was the bottleneck.

MJPEG is a bit of a storage problem, but that can be addressed by doing the
compression on a bigger machine on the LAN. My partner at Syntro has done a
post on this topic, but I can't find it right now.

MJPEG does have an advantage in stream processing in that every picture is
self-contained and you don't have to sync up.

Here's an example of some inline filtering of MJPEG

http://pansenti.wordpress.com/2012/02/09/syntro-pipeline-stream-filter-demonstration/


The driver on the Gumstix side for that first post is a simple custom V4L
app,
part of our Syntro suite of apps. It doesn't work with all USB cameras yet,
but
that's just because we haven't taken the time. The two missing features are

1. Handle MJPEG with restart markers embedded. Some of the newer webcams do
this.
We transmit these images just fine. Qt spews errors in our standard
SyntroViewer
app when we uncompress them for display on the other end. The images are
fine.
It's just an annoying warning message.

2. Some web cameras only provide YUV images. For these we are back to the
same
problem as the Caspa. We could use the DSP or the ARM core with somthing
like
libjpeg. We've just opted to choose the 'right' cameras to use with the
Gumstix.


There are some more Syntro demos here.

http://pansenti.wordpress.com

Gumstix boards are one of my standard test platforms for Syntro, so most of
our
apps run on it.

Syntro is GPL/LGPL and cross-platform. The kernel version is unimportant
with
Syntro which is convenient, but it does require Qt.

If you want more details or need some help setting up Syntro on a Gumstix on
let me know. Applies to anyone.

We are looking for some Gumstix users.



--
View this message in context: http://gumstix.8.n6.nabble.com/Kernel-version-for-new-Caspa-and-streaming-compression-project-tp4964710p4964724.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Gutembert
In reply to this post by Scott Ellis
Thank you jumpnowdev,

I am very much interested; I am using Gumstix Overo Water COM, No Camera since I am aiming to compress still raw images.
I have the dsp-console-image kernel 2.6.34 running and I am trying to figure out how to exploit the DSP in order to accomplish still image compression.

Could you please help in this matter (Using the Gumstix Overo Water COM's DSP for still image Compression)?

Thank you in advance,
Gutembert.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

bhamadicharef
This seems very interesting !

You can consider me as a Syntro user/tester ! :-)

Brahim

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Scott Ellis
In reply to this post by Gutembert
I haven't used the DSP for compressing stills. You want jpeg I assume.

In the projects where I wanted to do this I used OpenCV.

Performance was good enough since I wasn't saving images very often.

I'm sure there is someone else on the list that knows how to do what you want.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Scott Ellis
In reply to this post by bhamadicharef
Hi Brahim,

I'll contact you off list about setting up Syntro on Gumstix boards. I haven't written that documentation.

You can get started with Syntro on a regular workstation since it's pretty much the same.

There are no binaries for Syntro yet, just source code.

Instructions for different O/S's are here - http://www.pansenti.com/wordpress/?page_id=58

You need the libraries, SyntroLib and SyntroGUI, and you need SyntroControl.

For apps, try SyntroCamera and SyntroView in the  SyntroDemo repository.

We haven't posted the SyntroV4LCamera app that I was using for that Gumstix camera demo. I just need to clean it up a bit and I will make it public.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Chris Whittenburg
In reply to this post by Scott Ellis
On Wed, Jun 27, 2012 at 6:39 AM, jumpnowdev <[hidden email]> wrote:
> I haven't used the DSP for compressing stills. You want jpeg I assume.
>
> In the projects where I wanted to do this I used OpenCV.
>
> Performance was good enough since I wasn't saving images very often.
>
> I'm sure there is someone else on the list that knows how to do what you
> want.

The codecs provided by TI for the DSP do include a jpeg encoder (ie
TIImgenc1), but I believe it may have resolution limits, just like the
video codecs they provide.

The only way I have used it is via the TI gstreamer plugin, but you
could write a dmai application, and there may be examples of this in
the dvsdk.  If you do go the gst-ti direction, check out this thread
for a fix for a problem which occurred after the first frame:

http://gforge.ti.com/gf/project/gstreamer_ti/forum/?action=ForumBrowse&_forum_action=MessageReply&message_id=7965

There are also neon optimized jpeg encoding libraries, which should
give quite good performance without the DSP, and won't have any
limitations on image size.

I ended up just using gstreamer's jpegenc plugin since it worked
easily and has relatively good performance.

-chris

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Gutembert
In reply to this post by Scott Ellis
Thank you once again,

Referring to your OpenCV, how did you accomplish this? Any tips?

Thank you,
Gutembert.

On Wed, Jun 27, 2012 at 1:39 PM, jumpnowdev [via Gumstix] <[hidden email]> wrote:
I haven't used the DSP for compressing stills. You want jpeg I assume.

In the projects where I wanted to do this I used OpenCV.

Performance was good enough since I wasn't saving images very often.

I'm sure there is someone else on the list that knows how to do what you want.



If you reply to this email, your message will be added to the discussion below:
http://gumstix.8.n6.nabble.com/Kernel-version-for-new-Caspa-and-streaming-compression-project-tp4964710p4964742.html
To unsubscribe from Kernel version for new Caspa and streaming compression project, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Gutembert
In reply to this post by Chris Whittenburg
Yes Chris,

I think you did something similar to what I am attempting to do!

You said:
"I ended up just using gstreamer's jpegenc plugin since it worked
easily and has relatively good performance. "

The " jpegenc plugin" how did you get this done?

I will really appreciate your input.

Thank you in advance,
Gutembert.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

bhamadicharef
Hi Gutembert

You need ...

- media-ctl to setup / configure your caspa
http://git.ideasonboard.org/media-ctl.git

- yavta to capture the video
http://git.ideasonboard.org/yavta.git 

- a JPEG encoding routine to compress
e.g. http://svn.emphy.de/nanojpeg/trunk/nanojpeg/nanojpeg.c 

- routine for streaming data over ethernet (thread)
http://nashruddin.com/Streaming_OpenCV_Videos_Over_the_Network 

Regards

Brahim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Kernel version for new Caspa and streaming compression project

Scott Ellis
In reply to this post by Gutembert
Here's a small application that takes snaps from a Caspa and saves
the images as JPEG using OpenCV.

https://github.com/scottellis/gumsnap

Disregard some of the image control settings. They only work in
conjunction with some of my own patches to the Caspa driver.

The OpenCV code for taking a YUV image and saving to JPEG is in
there.

Two OpenCV built-in functions do all the work.

cvCvtColor(yuv, dst, CV_YCrCb2BGR) to go from YUV to BGR
and
cvSaveImage() with a filename ending in .jpg to save a JPEG.


(This refers to the older 2.6.34 version of the Caspa driver)

Because this driver chooses to reinitialize all the camera registers
every time a client opens the device, you need to let it roll a few
frames before the control settings take effect. Camera drivers
really should not do this. Once the driver is in memory and has
been initialized once, it should not change settings like gain and
exposure on its own just because a new process wants to use it.

Anyway, that's why that code in gumsnap throws away the first 9
images. Image 10 is just something that works. Saving the third
or fourth image would probably work just as well.

This program only ran once every 5 minutes or so.
Performance was not an issue.

Loading...