CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Posts
    10

    Programming language for video streaming?

    Hi there,

    I got a question. I am about to work on a project where a video stream from a webcam has to be handled. It has to be stored and 'analyzed' (image processing). Actually I don´t know that much yet about the project, but I was wondering if there was an easy way to decide about the programming language.
    Generally the first thought would go to Java (also since the rest of the project is Java code). But on second though I was wondering if C++ would be the better approach, performance-wise.

    Does anybody have experience in this area? Also are there tutorials on video streaming and image processing.

    Grateful for any help or ideas. Thanks.

    Oceansoul
    Last edited by Oceansoul; March 18th, 2008 at 06:29 AM.

  2. #2
    Join Date
    Mar 2008
    Location
    Mexico
    Posts
    5

    Lightbulb Re: Programming languag for viedo streaming?

    Hello

    I am doing the same thing, using VC++ 2005, I don't know much yet, but I saw that lots of people are using DirectShow for that, I recommend to take a look at the documentations on MSDN2, also thee is lots of tutorials online (use Google).

    If you decide to go VC++ please let me know, we could work together on this! this way it would be easier for both of us

    Ligeti
    Last edited by ligeti; March 18th, 2008 at 01:04 PM. Reason: Bad English

  3. #3
    Join Date
    Mar 2008
    Posts
    10

    Re: Programming languag for viedo streaming?

    Hi Ligeti,

    actually using DirectX is a NoGo for us, since we need platform-independance. Apart from that my superior decided to give Java a try and look at the performance. If that won´t work out we might still switch to C++. A paper I found on that topic seems to hint that C++ is (was? can´t say when exactly the paper was written.) is a factor 10 faster in streaming capabilities than Java.
    Anyway, now I got te re-learn Java. Used it last 7 years ago .

    If you find any interesting news or opinions on this matter, I´d still be very interested in it. This is all very new for me. Java, networking and image processing. I used to do C++, grafics and visualization. So I feel like a total newbie .

    Oceansoul

  4. #4
    Join Date
    Mar 2008
    Location
    Mexico
    Posts
    5

    Red face Re: Programming language for video streaming?

    Hello again

    Well I am going to try and support you even if you go Java (which to tell you the truth, I don't care much about Java), but I do HAVE to work with in school

    Anyway, I have a Logitech QuickCam Chat that I need to interface, I found out that you can download the QuickCam SDK and use it to program using win32, MFC or VB, so I downloaded it and installed i, but later I found out that it is out of date and not supported anymore so that goes out, the examples didn't work with my WebCam!

    Now I will switch to VFW (Video for Windows) I know that you want to make your program run on multi platforms, my guess is you are mainly going Windows and Linux, but that's possible to do even with C++ (if you don't use VC++), I have a book (a good one) for Java, I will look it up and see if they say anything about Video Streaming, and by the way I have a friend who did connect his WebCam to his web page using Java (JSP) I guess that it will be the same for Java, am trying to contact him for the code.

    I will keep in touch on this thread, if you need help in anything please let me know.

    Good luck.

    Ligeti
    Last edited by ligeti; March 19th, 2008 at 11:59 AM. Reason: Bad English

  5. #5
    Join Date
    Mar 2008
    Posts
    2

    Re: Programming language for video streaming?

    I just finished a project managing video streams using JavaScript. Would something like this work? Demo's at
    http://www.marinequestservice.com/vF...1_ee/index.php
    Last edited by miterbox; March 25th, 2008 at 04:18 PM.

  6. #6
    Join Date
    Mar 2008
    Posts
    10

    Re: Programming language for video streaming?

    Well, here I am again.

    Thanks for the support, by the way. It´s really appreciated.

    Status is, that I have set up a client-server-protocol. The server actually accesses the camera and receives (and displays) images as fast as he can store them. And a client can connect and ask for the latest picture.

    The image (on the server) is received via http. I am not sure if this is the best way to do it (I really have no idea about networking).

    This is how I get one picture.

    Code:
    if( m_oCamURL != null ){
     
                URLConnection con = m_oCamURL.openConnection();
                int size = con.getContentLength();
                byte[] buffer = new byte[size];
                InputStream in = con.getInputStream();
                int offset = 0;
                while (offset < size) {
                    offset += in.read(buffer, offset, size-offset);
                }
                in.close();
    
                m_oCamImg = Toolkit.getDefaultToolkit().createImage(buffer);
    }
    My code is still rather untidy. I simply wanted to see something work .

    One thing that troubles me is that streaming could become really slow, since I might have images with a resolution of 2560x1920.

    This is not an actual question. I am always glad for ideas, though . Just wanted to say thanks and give an update.

    @miterbox: That looks quite nice. I would say that is what I am trying to do. Only I have to add image processing possibilities as soon as it the streaming works.

    Cheers

    Oceansoul

  7. #7
    Join Date
    Mar 2008
    Location
    Mexico
    Posts
    5

    Re: Programming language for video streaming?

    Hello again
    I am really glad you did come back on this, I did some coding lately with VFW using VC++, the resolution I am working with is 640x480 (Webcam) with a rate of 66 ms x frame, which is working nicely on a local machine, BUT... now I have to find out about how to encode and compress the stream in order to send it v*a networks (UDP/IP), here, my guess is that (and I am almost sure about what am saying) we are both in the same boat

    You said: "The image (on the server) is received via http. I am not sure if this is the best way to do it (I really have no idea about networking)." well ... my only advice here, is to see if Java supports QOS (that can make things goes a bit faster through servers). I dont see why http is a bad idea, in fact I would do the same except that I am building a client-server application for a robot where the client controls the robot (manual mode), which mean that I can't rely on http much here IMHO.

    well.... good luck, am really happy for you, I would like to see your final project, are you going to broadcast anything later once you'r finished?

    Ligeti
    Last edited by ligeti; April 6th, 2008 at 11:09 AM. Reason: Bad English again ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured