Display a video stream (successives images)

Hello!
Thanks for looking after my post.
I try to display a video stream (successives images) in Java component.
With a simple swing component, it's not possible to display 25 fps for a 640x480 resolution.
With SWT, we arrive to display about 15 fps for a resolution 640x480 but the use of the CPU is very important.
Do you know an efficient system to display video stream?
Thanks.

Firstly if you're loading images with Toolkit you'll nbeed to use MediaTracker (see the Javadoc for full and clear instructions).
Secondly, be aware of how long it takes to load image data, allocate the memory for it, and decode it. This is where you're going to suffer and it's the fundamental flaw in the plan of simulating video by flipping single frames: it's highly unlikely you'll manage it quickly enough. As above, 50ms is quite optimistic.
You could do your loading up-front and buffer a load of images - there are a few strategies you could use for this. But bear in mind that (a) this is going to be very memory hungry, and (b) if your image load time is greater than your frame display time you're always going to be fighting a losing battle. But it should work for very small animations.
Run yourself some tests: write yourself a simple test class which just loads an image in its main() method using a MediaTracker. It'll tell you how long loading the image takes. Of course, if you're doing it in an applet then you've got all sorts of other factors to consider and the load times will be high.

Similar Messages

  • IIS7 configuration, blocked broadcast video stream from third party host

    I have a client that recently replaced a windows server 2003 with windows server 2008 R2 as their webserver.  This was a big change to IIS7.  An application that I developed for them has stopped working and I believe this is related to the IIS7
    configuration.  The application uses SilverLight technology to display a broadcast video along with some powerpoint slides.
    Here is the URL going to the server from a link on an html page. 
    http://iiscast.wlf.org/vod/broadcast/sctr01/0/start.html?media=http://iiscast.wlf.org/vod/broadcast/unit2.asx
    The iiscast.wlf.org is the public name for the IIS server.  When we click on the link it does properly display the start.html content but fails to connect to the video stream.  The video stream is hosted by a third party and the contents of the
    unit2.asx file has the url for that video stream.  When a put the
    http://iiscast.wlf.org/vod/broadcast/unit2.asx portion in IE it does properly display the video stream on mediaplayer.   All this worked prior to moving to the new server.   When I use F12 in IE to debug this, I see a brief message appear
    in the debugger that it is opening unit2.asx.  After that the debugging is very limited except I know I’m getting an exception in the silverlight and the video doesn’t display.   Other similar Silverlight apps on the same server that display
    archived video are working.
    Here is the content of unit2.asx
    <asx version = "3.0">
      <Title>Unit2 Bdct</Title>
      <entry>
        <ref href = "http://easylink.playstream.com/winlive/wlforg2.wvx"/>
      </entry>
    </asx>
    Playstream is a video stream hosting company.  When someone links to them, it pulls the video stream from my clients media server broadcast point. 
    wlforg2.wvx contains the link back to the media server broadcast point at my client.
    We have a lot of connections going on but keeping in mind that  http://iiscast.wlf.org/vod/broadcast/unit2.asx will display the video and
    http://iiscast.wlf.org/vod/broadcast/sctr01/0/start.html?media=http://iiscast.wlf.org/vod/broadcast/unit2.asx
    Is not displaying the video although all this worked on the old server.
    My guess is that something in the IIS7 is blocking this process.
    FYI the old server completely died so I can’t look into its configuration which was done in 2004 by someone else.

    This was entered in the iis.net forum as suggested.  The problem has been resolved.  The hosting service determined they had an edge server that was faulting.  Their edge servers were automatically assigned by geography which meant
    that depending on how/where we accessed the system for troubleshooting we used a different edge server.  Hence some tests always failed and others always passed.  FYI the hosting service had this problem for over a month and did not detect it
    themselves.  Fortunately we connected with a dedicated service technician late on a Saturday night and he figured it out.  

  • Video streaming mixing

    Hello!
    I want have a live broadcast (like web TV) using Flash Media
    Server. I taking video right from digital camera. My question is
    how i can put over this video stream some image (channel logo) or
    another video stream (for example breaking news line on the
    bottom)? What i need for this?
    Thanks

    If you plan to game or do video editing stay away from HP, none of their video cards are up to the task and they will all run too hot.
     http://www.ebay.com/itm/New-Toshiba-Qosmio-X775-17-3-i7-2670QM-3-1GHz-1-5GB-GTX-560M-Blu-Ray-Quad-Co...
     NVIDIA GT 560 graphics card can handle most anything that's out there (for now). Notice how thick it is for improved air flow, if I remember correctly it has to cooling fans to get the job done.
     Check out these others and you can also go to the Toshiba web site.
     http://www.ebay.com/sch/i.html?_from=R40&_trksid=p5197.m570.l1311&_nkw=toshiba+qosmio+laptop&_sacat=...
     http://www.pro-star.com/index.cfm?mainpage=productdetail&model=P170HM
     http://www.pro-star.com/
     The GT 560 will even handle Battle Field 3.
     http://www.geforce.com/GamesandApps/games/battlefield-3/GPUAnalyzer
     http://www.amazon.com/gp/feature.html/ref=amb_link_357290142_2?ie=UTF8&docId=1000721101&pf_rd_m=ATVP...

  • How can I display three images in video rate succession (60 Hz)?

    For a structured illumination microscope application, I have developed a VI that creates three images and displays them in rapid succession (as fast as the loop will go) on a second monitor.
    From the naked eye it's pretty apparent that the loop is not displaying the images at video rate.  Is there a way (perhaps with some sort of buffer) to get them to display faster?  Is WinShow simply not going to be fast enough, and if not, what's an alternative method of displaying the images?  If it helps, the images need only be displayed once each (the loop was just for testing).
    Also, what is a way to measure the frame rate output of the images?
    (sorry for the sloppy code, new to LabView)
    Thanks,
    -T
    Attachments:
    illuminationpattern.vi ‏31 KB

    Hello,
    Why don't  you try drawing one window, call IMAQ WindShow once outside of the loop, then redraw that window each iteration within the loop.  Hopefully this stops the flutter of the window.  You can build a 3 element array of the 3 IMAQ images then use an index array to alternate through which image you want to be redrawn into the single window.  The constant calling of IMAQ WindShow seems messy.
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • Hi all, I have 15 images in a file. Every images are continues of previous image. i want to stream all images into my application( Like video). Any ideas?????

    Hi all,
    I am trying to show an real time video. From my ip camera the sequence of images are stored in particular folder. Now i want to stream all images like video in my application. Have any ideas??????

    Search the forums since this is only about the umpteenth time this question has been asked. We are not a buyer's guide here.

  • WVC80N Video Stream not displaying on iOS6 browsers

    I updated an iPhone and iPad to iOS6 yesterday.  Now my Linksys WVC80N video streams will not display on both Safari and Chrome browsers.   On Safari if I go to the Camera "Home" page then use the browser Back button to the View Video page then I can get a still from the camera.  Any ideas on how to fix this issue?

    maz67 wrote:
    My cameras are at a 2nd home so I can't update firmware until I get there again. I just checked remotely and it he camera I checked is version 1.0.00 build 2008. Has anyone out there tried updating firmware to see if this is a fix for this problem? 
    I just checked the release note of this firmware 1.0.01. Perhaps, you can try another browser for isolation before updating the router. That might be a browser problem (maybe not supported yet).
    Product:          WVC80N v1
    Classification:   Firmware Release History
    Firmware Date:    Oct 30, 2009
    Last Firmware Version: 1.0.01 build 00
    Firmware 1.0.01 (build 00)
    - Fixed the issue that network drives does not listed in alphabetic order.
    - Fixed the issue that wireless security key is masked while typing in.
    - Correct TZO web URL to http://www.tzo.com.
    - Fixed the issue that WPS LED does not function when LED is set to disabled

  • Display a large sequence of images like a video.

    I want to display a large sequence of images (.jpg) like a video, something like a Component that displays an image and a TimerTask that changes that image every 50 milseconds and repaints:
    class SlideShow extends Component
         private Timer timer;
         private TimerTask imageFliper;
         private Image currentImage;
         private Image nextImage;
         private int arraysize;
         private int arrayoffset;
         private int currentposi;
         String fileMask;
         public SlideShow(int offset, int size, String filemask)
              super.setSize(640,480);
              currentposi = arrayoffset = offset;
              arraysize = size;
              fileMask = filemask;
              timer= new Timer();
              nextImage = Toolkit.getDefaultToolkit().getImage(fileMask.replaceFirst("#",leftZero(currentposi,4)));
              imageFliper = new TimerTask()
                   public void run()
                        currentImage = nextImage;
                        repaint();
                        if(++currentposi > arrayoffset + arraysize)
                             currentposi = arrayoffset;
                        nextImage = Toolkit.getDefaultToolkit().getImage(fileMask.replaceFirst("#",leftZero(currentposi,4)));
              timer.schedule(imageFliper, 0, 50);
         public void paint(Graphics g)
              g.drawImage(currentImage,0,0,super.getWidth(),super.getHeight(),this);
         public void update(Graphics g)
              paint(g);
         static public String leftZero(int target,int leftcount)
              StringBuffer sb = new StringBuffer();
              int i = (int)Math.pow(10,leftcount-1);
              while(i!=1)
                   if(target<i)
                        sb.append("0");
                        i=i/10;
                   else
                        break;
              sb.append(Integer.toString(target));
              return sb.toString();
         public static void main(String[] args) 
              Frame f = new Frame("slide show");
              SlideShow s = new SlideShow(1,1000,"intro\\intro#.jpg");
              f.add(s);
              f.addWindowListener(new WindowAdapter()
                             public void windowClosing(WindowEvent e){System.exit(0);}
              f.pack();
              f.setSize(640,480);
              f.setVisible(true);
    }but just using the Image class seems to be unefective.
    Does anyone kwon a library that does this fast and efective?
    or should i just convert the images to a media file and use a media library?
    Message was edited by:
    nmfmr

    Firstly if you're loading images with Toolkit you'll nbeed to use MediaTracker (see the Javadoc for full and clear instructions).
    Secondly, be aware of how long it takes to load image data, allocate the memory for it, and decode it. This is where you're going to suffer and it's the fundamental flaw in the plan of simulating video by flipping single frames: it's highly unlikely you'll manage it quickly enough. As above, 50ms is quite optimistic.
    You could do your loading up-front and buffer a load of images - there are a few strategies you could use for this. But bear in mind that (a) this is going to be very memory hungry, and (b) if your image load time is greater than your frame display time you're always going to be fighting a losing battle. But it should work for very small animations.
    Run yourself some tests: write yourself a simple test class which just loads an image in its main() method using a MediaTracker. It'll tell you how long loading the image takes. Of course, if you're doing it in an applet then you've got all sorts of other factors to consider and the load times will be high.

  • Multiple video streams displayed on separate monitors

    I'm working on a project that will have 6 screens showing 6 different pieces running simultaneously. We'll be cutting all 6 pieces in FCP, but i was wondering if there is anyway to view multiple video streams on 6 different displays running at the same time in FCP? Obviously some sort of display hub or router needs to be had, or perhaps some other hardware/software.
    Anyone have any great ideas?

    My old video professor from school did a lot of video installations. He often had trouble keeping multiple DVD players in sync with one another, they would drift over time. If you are thinking about the DVD player route, make sure you're using the exact same model for each player, and make sure to run tests over a long period of time.
    Of course, using an external genlock would probably prevent that, too.

  • Live stream - How To Detect connection success AND video stream receiving?

    Hi,
    I'd like to know how to catch the Event when the NetConnection has successfully connected,
    And after being connected, but nostream is published to the server yet.
    I'd to catch the Event in OSMF Player, when a real video stream has started to be pusblished to server, and of course is received in the player.
    Because i dont find the Event making a difference between connection and stream receiving.
    Thanks.
    Seb

    you should watch for a NetStream.Connect.Closed NetStatusEvent being sent to the NetConnection object, where the event.info.stream object is the NetStream in question.

  • OLCS3 Field Monitors display black video in single display

    I am using OL CS3 on WinXPSP2 with Canon HV20 camcorder on FireWire to my Lenovo T60 laptop, and had some success in getting clips recorded yesterday. However, no luck today. The Field Monitors do not show the live video feed, but remain black.
    I rebooted my laptop, plugged in FireWire port (in an Adaptec PCMCIA card), started OL, and turned on HV20 camcorder. In OL, the Canon HV20 is listed in the Devices list, and selecting it causes Field Monitor to display text label "canon hv20 camcorder". The Field Monitor(s) still show black video...while the camcorder display shows the live image.
    My laptop has only the integrated LCD panel display in use (as at boot time), the video adapter is ATI Radeon Mobility X1400 which does support dual displays. I used ATI Catalyst sw to check the video settings, which indicate there is only one display in use, it is not running clone mode or extended desktop, and the video overlay is set to show in Standard Dual Mode (which indicates video would show on both Main display and Secondary displays in original source video aspect if two displays were in use).
    I read the Adobe knowledge base kb402180 "Field monitor does not display video when used on a computer with dual monitors (OnLocation CS3)" but it does not seem to solve my problem.
    I can use Premier Pro CS3 to capture video I recorded to tape on the HV20 using the same hw setup. So it seems the FireWire link is okay, the camera can push a video stream on it, and so I remain suspicious of the video overlay settings. Only other thing is maybe the camera is not pushing live video stream to the FireWire cable? I'll check on that.
    Anyone have any help?
    Thanks,
    Patrick

    Brooce,
    Thanks for the tip on the bug form...that is great.
    As it turns out, I ran a parallel request into the Adobe support forum, and Erik H got me the answer to this problem yesterday....I found that deleting the appProps.xml file in C:\Documents and Settings\(your user folder)\Local Settings\Application
    Data\Adobe\OnLocation CS3 solved my problem.
    MY GUESS
    I use my laptop with dual external displays most of the time, but while trying to record with On Location I only use the integrated LCD panel while in the studio. I am guessing that OL gets confused if I happen to run it in both of these hardware configurations....the appProps.xml could get written with dual displays in my office and then OL might expect them even though the current hw config is a single panel while in the studio.
    -Patrick

  • SpryTabbedPanel: Flash player in tabs do not play video streams

    Note: I am a complete noob (no experience with Javascript and rudimentary experience with htlm/css). Please be patient (I hope that this is the correct forum for this) and know that I am appreciative of any help or solution that anyone can provide.
    Using Dreamweaver CS4 on Mac OS 10.5.8
    We recently switched all of our streaming servers from Windows Media (good riddance) to Flash Media Server 3.5 (now getting awesome H.264 quality in comparison).
    I was asked to re-design this webpage with the aim of re-organizing the content so that it is more accessible:
    http://www.librarymedia.net/VideoGallery.html
    We used Adobe's test page for our first page:
    http://www.librarymedia.net/flash/videoplayer.html?source=rtmp://63.116.232.4/live/livestr eam&type=live&idx=10
    This was meant as a temporary page to get us started, and as you can see, it needs work but at least it works.
    I've been working the the final version of this page. My boss wants a tabbed web page with links to our video streams (tab for each category of streams).
    This is what I have so far:
    http://www.librarymedia.net/Flash2/videoplayer2.html?source=rtmp://63.116.232.4/live/lives tream&type=live&idx=10
    I realize that I had several options before building this. One, I could have made a separate page for each tab and linked them with a tab menu. In hindsight, this might have been a better option since I could have just copied the working page that we already have for each tab. Or I could have done what I have tried to do: to use Dreamweaver's SpryTabbedPanel to make the tabs and insert a Flash player with links into each tab.
    The problem:
    1. The streams do not play. The player says "initializing" and then "please enter a stream name and play". Please note that I used SpryURLutils to get each link to open in the appropriate tab.
    2. After reading about the benefits of external vs. inline javascript, I took all of the inline javascript that was contained in Adobe's sample page and placed it in an external file. I tried placing the javascript back into the source code (inline), but this did not fix the problem. I guess there is a Javascript problem or I need extra Javascript code to get this to work.  The javascript code is below. Use view source in your web browser to see source code. Please let me know if I need to provide more information.
    Thanks.
    // (C) Copyright 2008 Adobe Systems Incorporated. All Rights Reserved.
    // NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. 
    // If you have received this file from a source other than Adobe, then your use, modification, or distribution of it requires the prior
    // written permission of Adobe.
    // THIS CODE AND INFORMATION IS PROVIDED "AS-IS" WITHOUT WARRANTY OF
    // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
    // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
    // PARTICULAR PURPOSE.
    // THIS CODE IS NOT SUPPORTED BY Adobe Systems Incorporated.
    // Version check based upon the values defined in globals
                                                var hasRequestedVersion = DetectFlashVer(10, 0, 0);
                                                if(!hasRequestedVersion)
                                                    var div = document.getElementById("flashcontent");
                                                    div.innerHTML = '<a href="http://www.adobe.com/go/getflashplayer/" style="color:black"><img src="images/ERROR_getFlashPlayer.gif" width="641" height="377" /></a>';
                                                else{
                                                        AC_FL_RunContent(
                                                            "src", "swfs/videoPlayer",
                                                            "width", "640",
                                                            "height", "377",
                                                            "id", "videoPlayer",
                                                            "quality", "high",
                                                            "bgcolor", "#000000",
                                                            "name", "videoPlayer",
                                                            "allowfullscreen","true",
                                                            "type", "application/x-shockwave-flash",
                                                            "pluginspage", "http://www.adobe.com/go/getflashplayer",
                                                            "flashvars", flashVars
                                          // -->  
    // Javascript in original page
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function changeImages() {
        if (document.images && (preloadFlag == true)) {
            for (var i=0; i<changeImages.arguments.length; i+=2) {
                document [changeImages.arguments[i]].src = changeImages.arguments[i+1];
    var preloadFlag = false;
    function preloadImages() {
        if (document.images) {
            navi_01_over = newImage("images/button_dynamic_up.gif");
            navi_02_over = newImage("images/button_samples_up.gif");
            navi_03_over = newImage("images/button_interactive.gif");
            preloadFlag = true;
    function changetab(obj, obj2, obj3, left1, left2, left3, nav1, nav2, nav3){
        document.getElementById(obj).style.display = 'block';
        document.getElementById(obj2).style.display = 'none';
        document.getElementById(obj3).style.display = 'none';
        document.getElementById(left1).style.display = 'block';
        document.getElementById(left2).style.display = 'none';
        document.getElementById(left3).style.display = 'none';
        document.getElementById(nav1).src = "images/" + nav1 + "_up.gif";
        document.getElementById(nav2).src = "images/" + nav2 + "_down.gif";
        document.getElementById(nav3).src = "images/" + nav3 + "_down.gif";
    function tabout(obj, nav){
        if (document.getElementById(obj).style.display == 'block'){
            document.getElementById(nav).src = "images/" + nav + "_up.gif";
        else{
            document.getElementById(nav).src = "images/" + nav + "_down.gif";
    function tabover(obj){
        document.getElementById(obj).src = "images/" + obj + "_up.gif";
    // Functionality
        <script language="javascript">
            var queryParameters = new Array();
            var flashVars = "";
            var tag = "";
            var url = "";
            window.onload = function ()
                for(var i=1 ; i<=10;i++)
                    var ids = String("sel"+i.toString());
                    document.getElementById( ids ).style.visibility = "hidden";
                    document.getElementById( ids ).className = "style76";
                // mark the entry for that index
                if(queryParameters['idx'] != "")
                    document.getElementById("td" + queryParameters['idx'] ).className = "style75";
                    document.getElementById("sel" + queryParameters['idx'] ).style.visibility = "visible";
            function initialise()
                function getUrlParam( name )
                      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
                      var regexS = "[\\?&]"+name+"=([^&#]*)";
                      var regex = new RegExp( regexS );
                      var results = regex.exec( window.location.href );
                      if( results == null )
                            return "";
                      else
                            return unescape( results[1] );
                queryParameters['source'] = getUrlParam('source');
                queryParameters['type'] = getUrlParam('type');
                queryParameters['idx'] = getUrlParam('idx');
                   flashVars += "&videoWidth=";
                flashVars += 0;
                flashVars += "&videoHeight=";
                flashVars += 0;
                flashVars += "&dsControl=";
                flashVars += unescape("manual");
                flashVars += "&dsSensitivity=";
                flashVars += 100;
                flashVars += "&serverURL=";
                flashVars += queryParameters['source'];
                flashVars += "&DS_Status=";
                flashVars += "true";
                flashVars += "&streamType=";
                flashVars += queryParameters['type'];
                flashVars += "&autoStart=";
                flashVars += unescape("true");
                tag = "&lt;object width='640' height='377' id='videoPlayer' name='videoPlayer' type='application/x-shockwave-flash' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' &gt;&lt;param name='movie' value='swfs/videoPlayer.swf' /&gt; &lt;param name='quality' value='high' /&gt; &lt;param name='bgcolor' value='#000000' /&gt; &lt;param name='allowfullscreen' value='true' /&gt; &lt;param name='flashvars' value= '"+                   
                flashVars+"'/&gt;&lt;embed src='swfs/videoPlayer.swf' width='640' height='377' id='videoPlayer' quality='high' bgcolor='#000000' name='videoPlayer' allowfullscreen='true' pluginspage='http://www.adobe.com/go/getflashplayer'   flashvars='"+ flashVars +"' type='application/x-shockwave-flash'&gt; &lt;/embed&gt;&lt;/object&gt;";
            function playStream()
                var url = "source=" + document.getElementById('inputURL').value;
                var type;
                if(document.getElementById('vodCheckbox').checked==true)
                    type="vod";
                else
                    type="live";
                url += ("&type=" + type);
                document.getElementById('playBtn').href="videoplayer.html?" + url;
            function checkbox(type)
                if(type=="vod")
                    if(document.getElementById('liveCheckbox').checked==true)
                        document.getElementById('liveCheckbox').checked=false;
                if(type=="live")
                    if(document.getElementById('vodCheckbox').checked==true)
                        document.getElementById('vodCheckbox').checked=false;
            initialise();

    Should I have posted this in the Spry forum instead? My apologies if this is the wrong forum.
    >There is a sample application of the code included with the zip file  which shows how to implement it.
    The sample doesn't really tell me what I need to do to the code to make it work (I do not know javascript), and unfortunately, I have not found any helpful instructions/documentation online. You've given me the answer, I just don't know enough to implement it. This is what I've done:
    1. Placed the FAVideo.js file in my site folder and linked it to the page: <script src="FAVideo.js" type="text/javascript"></script>
    2. I added the following code (taken from the SimpleDemo.html example inside the FAVideo folder). My comments in bold. Page at
    http://www.librarymedia.net/Flash2/videoplayer2.html?source=rtmp://63.116.232.6/vod/mp4:Ol ympics2010_640x480.mov
             <! To the <body> section:-->
    <body onLoad="">
        <div id="divOne"></div>
    <!-Do I have to place the entire page within the "divOne" div (or just the section containing the tabs) in order for the javascript to work?-->
             <!-In the <head> section: -->
       <script type="text/javascript">
            playerOne = new FAVideo("divOne", "TabbedPanels1", "demo_video.flv",0,0,{ autoLoad:true, autoPlay:true });
        </script>
    <!- I noticed that the body code added a div id called "divOne", so I added the "TabbedPanels1" div id to the above code thinking that this would apply the javascript code to all of the tabs. Dreamweaver adds <div id="TabbedPanels1" class="TabbedPanels"> to the page when you insert the tabbed menu, so I'm thinking the javascript has to point to either one of those for it to work. The "demo_video.flv",0,0 code is probably unneccesary, right? As you can see, I'm completely clueless. -->
        <script>
            playerOne.addEventListener("playheadUpdate",this,myHandler);
            playerOne.removeEventListener("playheadUpdate",this,myHandler);
            function myHandler() {
                //alert("eh");
        </script>
    </body>
    Once again, thanks for your help.

  • Video streaming stalls in full screen mode

    I'm not sure to be in the right category, but my Laptop runs in Tiger and I happen to use video streaming from different websides like ESPN Live and other websides with their own players. I use even some that require a program dowload to be able to see their content. By all those sources the video runs pretty smooth in a normal size. As soon as I put it to full screen it stalls in a certain rhythm no matter if the whole program is buffered or not.
    I achieved better results with one of the providers using WMP that via flip4mac streams into Quicktime. Just don't know if and how I could incorporate those other webside players into Quicktime. And if this would be the solution.
    I freed up some of my HD to achieve better performance. Have 18 GB free out of 100.. is this too little ?
    Do I need a better video card ?
    MacBook Pro (Intel) 100 GB 2.16 GHz 1.677 GB RAM
    Thanks
    bafomet

    Ba,
    It may be of interest to know that streaming video codecs are designed for computers of a specific age (CPU and GPU speeds).
    DVD quality streams MPEG-2 compression at about 10 Mbits/sec, and the older MPEG-1 compression, designed for NTSC television, streams at about 2 Mbits/sec. At 10 Mbits/sec, the processor must work faster to decompress & display the image. The latest compressions are based on MPEG-4. Even a G3 iBook could display MPEG-4 full screen; so I don't think you need a faster GPU.
    Microsoft codecs & containers, the last time I checked, were ancient: based upon MPEG-2. So, check your speed:
    DSL Reports speed tests
    http://www.dslreports.com/stest
    If you use Wi-Fi, IEEE 802.11n is fastest.
    Increase the cache size for your codec, if you can. It needs to be contiguous, so I dare to recommend iDefrag 2 (US$30) to clean your remaining disk space and obtain about 20 GB of contiguous space. Video display uses many operating system files, which are likely not fragmented; but you can also de-fragment the Windows codec if it lies in over 100 fragments. (The Spotlight database usually has over 1000 fragments; but pauses in it don't affect one's pleasure in using it.)
    My low-resolution DVD is interpolated by my graphics card, and look beautiful at maximal resolution. Streaming graphics apparently isn't programmed to interpolate low resolution: it demands high resolution and high bandwidth.
    If you can't increase the cache in WMP, you can lower the resolution of your monitor. That may be why this System Preference was designed to sit on the desktop's top bar.
    Bruce

  • Stream-in images from client to server,without running the transmit code

    Hello all,
    Im using JMF for my current project.Right now,I am trying to only recieve images from the client without the client transmitting it.That is I dont want the transmit code to run on the client.
    I should just be able to stream in the images from client to server, without running the transmit code on client.
    Can this be done?
    Thanks in advance

    suppigs wrote:
    Can I know more about this?Sure.
    <Side A>
    You'd just need to write an application that doesn't have a GUI (so, a console-based application) that listens on some pre-determined port for a message to start broadcasting. Maybe you'd send it the IP/PORT number to start broadcasting on. Once it receives that message, it'd start broadcasting the web cam to the IP/PORT number until it received a message to stop. Once it stops, it'll just go back to waiting for the next "start" signal.
    <Side B>
    On the other side, you'd write an application that sends the start messages, receives/displays the videos, and then sends the stop signal. This will have a GUI, and be your "control program" so to speak.
    Then, once of have both of those programs working...if you're using Linux, you're done. If you're using Windows, you'd need to modify the <Side A> program so that it can run as a Windows service.
    There are a lot of ways to do this, you can google it or look at the following link:
    [http://twit88.com/blog/2007/09/19/open-source-software-to-start-up-java-as-windows-serviceunix-daemon/]

  • Simple HTML example on how to display a live stream?

    Hi all
    Is there anyone who has a HTML example (or can give an URL with a page) that has the Adobe Flash player displaying a live stream (and not a file)?
    There is one in the installation under "Flash Media Server Start Screen" but it was too complex for me to understand. I just need a simple example on how to display a live flash stream in Adobes own web player.
    Thank you very much :-)

    Hi,
    Here is the html code.
    <html>
    <head>
    <title>Flash Media Player</title>
    </head>
    <object width="550" height="400">
    <param name="movie" value="player.swf">
    <embed src="somefilename.swf" width="550" height="400">
    </embed>
    </object>
    </body>
    </html>
    And here is the action script code of player.swf.
    import flash.net.NetConnection;
    import flash.events.NetStatusEvent;
    import flash.net.NetStream;
    import flash.media.Video;
    import flash.events.MouseEvent;
    import flash.media.Camera;
    startBtn.addEventListener(MouseEvent.CLICK,mouseHandler);
    var nc:NetConnection;
    var ns:NetStream;
    var vid:Video;
    var cam:Camera=Camera.getCamera();
    function mouseHandler(evt:MouseEvent){
        nc=new NetConnection();
        nc.addEventListener(NetStatusEvent.NET_STATUS,statusHandler);
        nc.connect("rtmp://localhost/sample");
    function statusHandler(evt:NetStatusEvent){
        trace(evt.info.code);
        if(evt.info.code=="NetConnection.Connect.Success"){
            ns=new NetStream(nc);
            ns.addEventListener(NetStatusEvent.NET_STATUS,streamHandler);
            ns.play("LiveStream");
            vid=new Video();
            vid.attachNetStream(ns);
            vid.height=400;
            vid.width=600;
            addChild(vid);
    function streamHandler(evt:NetStatusEvent){
        trace(evt.info.code);
    Please do the following before using the actionscript code:
    Add a button called start in fla and keep its instance name startBtn.
    create an application called sample in FMS and publish a live stream called "LiveStream".

  • Using sockets to relay video stream

    Hi there,
    I've been working with java for 4 years now, and I never had troubles making the applications I wanted with it...since my last project :(
    I hope you, gurus from the java community forum, can help me sort this out, but let me explain it to you:
    I'd like to stream video content (let's say from a webcam) to several spectators. But my upload bandwidth (ADSL line) is limited to 512kbps, which is far from enough to send a video streaming (with a bitrate of ~400kbps) to 10 or more viewers.
    That's why I decided to rent a distant server (with a bandwidth of 5Mbps download/upload), and make a java application run on it, which would be able to broadcast the stream to all the viewers.
    So my computer (connected to adsl) captures the video from the webcam, sends it via socket to the rented server, which broadcasts the video to all the spectators. If no video is sent to the rented server, then it should broadcast local files to the spectators.
    Here is a schema of the project so you understand easily (my english is not as good as I'd like it to be, so you may not understand with words only):
    http://www.bf-stream.com/schema1.gif
    My application runs quite well with 5 spectators, but as soon as more viewers come to see the video, it starts hanging, and all the viewers suffer lags and buffering, which is not exactly what I expected...
    Of course, I checked the administration interface on the rented server to see if this was due to a cpu/ram/bandwitdh problem. With no success: with 10 viewers connected, the app uses less than 1% of the cpu power, something like 200kb of RAM, and a bandwidth of 3-4Mbps (which is still under the actual bandwidth capacity of the server).
    That's why I came to the conclusion that my java app was not as good as I thought, and decided to show it to you, so you can help me make it better.
    So here is a schema showing the classes and their interactions:
    http://www.bf-stream.com/schema2.gif
    And here are the sources of the classes:
    StreamRelay.java:
    package com.RR4;
    import java.net.Socket;
    import java.util.Vector;
    import java.util.Observable;
    import java.util.Observer;
    * StreamRelay:
    *  Main class controlling every aspects of the stream
    *  (live content, or files read from hard disk)
    public class StreamRelay extends Observable implements Observer  {
         static public String VERSION = "0.5";
         static public int BUFFER_SIZE = 16;
         private StreamServer streamServer;
         private LiveServer liveServer;
         LocalFile localFile;
         Vector clients;
         boolean streamFromSocket;
         public StreamRelay(int livePort, int relayPort) {
              streamFromSocket = false;
              // clients: vector containing every StreamClient connected
              clients = new Vector();
              // localFile: class reading local files when no live is sent to the relay
              localFile = new LocalFile(this);
              new Thread(localFile).start();
              // streamServer: server listening for new StreamClient
              streamServer = new StreamServer(this, relayPort);
              new Thread(streamServer).start();
              // liveServer: server listening for new sources for live content
              liveServer = new LiveServer(this, livePort);
              new Thread(liveServer).start();
         * addClient: adds new StreamClient to 'clients' vector (a StreamClient is a 'spectator')
         public void addClient(Socket clientSocket) {
             StreamClient client = new StreamClient(this, clientSocket);
         * removeClient: removes a StreamClient from 'clients' vector
         public void removeClient(int index) {
              clients.remove(index);
         * update: updates every StreamClient (which are all Observers of StreamRelay)
         public void update(Observable observable, Object obj) {
              if ((observable.getClass().toString().indexOf("LocalFile")!=-1&&!streamFromSocket)||(observable.getClass().toString().indexOf("LiveStream")!=-1)) {
                   this.notifyObservers( (byte[]) obj);
                   this.setChanged();
         public static void main(String[] args) {
              new StreamRelay(8000, 8080);
    LocalFile.java:
    package com.RR4;
    import java.util.Observable;
    import java.io.*;
    * LocalFile: class reading local file when no live content is sent to the relay
    public class LocalFile extends Observable implements Runnable {
         // filenames is an array containing a list of files to be read when no live content is sent
         private String[] filenames = {
              "file1",
              "file2"
         private InputStream stream;
         boolean streamOpened;
         private StreamRelay parent;
         int fileIndex;
         // Constructor: initialises LocalFile
         //  sets fileIndex to 0, and sets main StreamRelay as Observer
         public LocalFile(StreamRelay parent) {
              this.parent = parent;
              fileIndex = 0;
              this.addObserver(parent);
              initStream();
          * initStream: initialises stream to read the next file in 'filenames' array
         public void initStream() {
              try {
                   stream = new BufferedInputStream(new FileInputStream(filenames[fileIndex]), StreamRelay.BUFFER_SIZE);
                   streamOpened = true;
                   fileIndex++;
                   if (fileIndex==filenames.length)
                        fileIndex = 0;
              } catch (Exception exp) {
                   exp.printStackTrace();
                   streamOpened = false;
          * run: main loop of the class.
          *     the file is actually read: a buffer of BUFFER_SIZE is filled and sent to
          *     the observer (StreamRelay)
         public void run() {
              byte[] buffer = new byte[StreamRelay.BUFFER_SIZE];
              byte[] bufferToSend;
              boolean quit = false;
              int actualBufferSize = 0;
              while (!quit) {
                   try {
                        this.setChanged();
                        // Bytes are read until the buffer is actually filled with BUFFER_SIZE bytes
                        // Only then is it sent to the observer...
                        while (streamOpened && ((actualBufferSize = stream.read(buffer, 0, StreamRelay.BUFFER_SIZE)) > 0)) {
                             if (parent.clients.size()>0 && (!parent.streamFromSocket)) {
                                  if (actualBufferSize<StreamRelay.BUFFER_SIZE) {
                                       bufferToSend = new byte[actualBufferSize];
                                       System.arraycopy(buffer, 0, bufferToSend, 0, actualBufferSize);
                                       this.notifyObservers(bufferToSend);
                                  } else
                                       this.notifyObservers(buffer);
                                  this.setChanged();
                             } else {
                                  try { Thread.sleep(100); } catch (Exception exp) {}
                   } catch (Exception exp) {
                        exp.printStackTrace();
                   try { stream.close(); } catch (Exception exp) {}
                   initStream();
    StreamServer.java:
    package com.RR4;
    import java.net.ServerSocket;
    public class StreamServer extends Thread {
         private ServerSocket serverSocket;
         private boolean socketOpened;
         private StreamRelay parent;
         * StreamServer: server listening for new StreamClient
         public StreamServer(StreamRelay parent, int relayPort) {
              this.parent = parent;
              try {
                   serverSocket = new ServerSocket(relayPort);
                   socketOpened = true;
              } catch (Exception exp) {
                   exp.printStackTrace();
                   socketOpened = false;
         public void run() {
              try {
                   while (socketOpened) {
                        parent.addClient(serverSocket.accept());
              } catch (Exception exp) {
                   exp.printStackTrace();
    StreamClient.java:
    package com.RR4;
    import java.net.Socket;
    import java.util.Observer;
    import java.util.Observable;
    import java.io.*;
    * StreamClient: class representing spectators connected to view the video content
    *     whether it is live content, or local files
    public class StreamClient implements Observer {
         private Socket socket;
         private OutputStream outStream;
         private boolean connected = true;
         private StreamRelay parent;
         public StreamClient(StreamRelay parent, Socket socket) {
              this.parent = parent;
              this.socket = socket;
              try {
                   // initialises OutputStream from socket
                   outStream = socket.getOutputStream();
              } catch (Exception exp) {
                   try { outStream.close(); } catch (Exception e) {}
                   try { socket.close(); } catch (Exception e) {}
                   exp.printStackTrace();
                   connected = false;
              if (connected) {
                   // if initializing of OutputStream didn't fail
                   // add this class to StreamBroadcast 'clients' vector
                   // and add this class to StreamRelay observers
                   parent.clients.add(this);
                   parent.addObserver(this);
          * update: actually send read bytes to the client
         public void update(Observable observable, Object obj) {
             try {
                   outStream.write( (byte[]) obj);
                   outStream.flush();
              } catch (Exception exp) {
                   // if read bytes couldn't be sent
                   // remove this client from clients list and observers of StreamRelay
                   // and try to close OutputStream and Socket
                   connected = false;
                   try { parent.deleteObserver(this); } catch (Exception e) {}
                   try { parent.clients.remove(this); } catch (Exception e) {}
                   try { outStream.close(); } catch (Exception e) {}
                   try { socket.close(); } catch (Exception e) {}
    LiveServer.java:
    package com.RR4;
    import java.net.ServerSocket;
    * LiveServer:
    *     SocketServer listening to new 'Live streams'
    public class LiveServer extends Thread {
         private ServerSocket liveSocket;
         private boolean liveServerOpened;
         private StreamRelay parent;
         public LiveServer(StreamRelay parent, int livePort) {
              this.parent = parent;
              try {
                   liveSocket = new ServerSocket(livePort);
                   liveServerOpened = true;
              } catch (Exception exp) {
                   exp.printStackTrace();
                   liveServerOpened = false;
         public void run() {
              LiveStream liveStream;
              try {
                   while (liveServerOpened) {
                        liveStream = new LiveStream(parent, liveSocket.accept());
                        new Thread(liveStream).start();
              } catch (Exception exp) {
                   exp.printStackTrace();
    LiveStream.java:
    package com.RR4;
    import java.util.Observable;
    import java.io.*;
    import java.net.Socket;
    *     LiveStream:
    *          Socket receiving live content from another distant computer
    *          to display it instead of the local files.
    public class LiveStream extends Observable implements Runnable {
         private InputStream stream;
         boolean streamOpened;
         private StreamRelay parent;
         public LiveStream(StreamRelay parent, Socket socket) {
              this.parent = parent;
              this.addObserver(parent);
              try {
                   stream = new BufferedInputStream(socket.getInputStream(), StreamRelay.BUFFER_SIZE);
                   streamOpened = true;
              } catch (Exception exp) {
                   exp.printStackTrace();
                   streamOpened = false;
         public void run() {
              byte[] buffer = new byte[StreamRelay.BUFFER_SIZE];
              byte[] bufferToSend;
              int actualBufferSize = 0;
              try {
                   this.setChanged();
                   // Bytes are read until the buffer is actually filled with BUFFER_SIZE bytes
                   // Only then is it sent to the observer...
                   while (streamOpened && ((actualBufferSize = stream.read(buffer, 0, StreamRelay.BUFFER_SIZE)) > 0)) {
                        if (!parent.streamFromSocket)
                             parent.streamFromSocket = true;
                        if (parent.clients.size() > 0) {
                             if (actualBufferSize<StreamRelay.BUFFER_SIZE) {
                                  bufferToSend = new byte[actualBufferSize];
                                  System.arraycopy(buffer, 0, bufferToSend, 0, actualBufferSize);
                                  this.notifyObservers(bufferToSend);
                             } else
                                  this.notifyObservers(buffer);
                             this.setChanged();
                        } else
                             try { Thread.sleep(100); } catch (Exception exp) {}
              } catch (Exception exp) {
                   exp.printStackTrace();
              } finally {
                   try { stream.close(); } catch (Exception exp) {}
                   this.deleteObserver(parent);
                   parent.streamFromSocket = false;
    }For your information, I uses NSV/VP6 vbr as video codec (but this should have no incidence on it, since the app only takes the video stream from a socket and broadcasts it to other sockets, without analysing it or modifying it). And the java app is hosted on a Celeron 2.6 GHz, 128MB RAM.
    I really hope you'll be able to help me with this project, as it is really important to me...
    I've been trying several Stream types available with the JDK but I hadn't any success... I've also been playing with the BUFFER_SIZE parameter, unsuccessfully too...
    Anyway, thanks in advance for reading me so far... and I hope, for helping me... I know the java community is strong, and I hope I won't have to make it with C or C++ :(

    Hi again :)
    I've been focusing on the local part of the stream (no live video, just playing local files and sending them to clients) using NIO.
    NIOStreamRelay.java:
    package com.RR4;
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.channels.spi.*;
    import java.net.*;
    import java.util.*;
    public class NIOStreamRelay {
         static int BUFFER_SIZE = 1024;
         LocalFile localFile;
         Vector clients;
         public NIOStreamRelay() throws IOException {
              localFile = new LocalFile(this);
              new Thread(localFile).start();
              clients = new Vector();
              acceptConnections();
         public void acceptConnections() throws IOException {          
              // Selector for incoming requests
              Selector acceptSelector = SelectorProvider.provider().openSelector();
              // Create a new server socket and set to non blocking mode
              ServerSocketChannel ssc = ServerSocketChannel.open();
              ssc.configureBlocking(false);
              // Bind the server socket to the local host and port
              InetAddress lh = InetAddress.getLocalHost();
              InetSocketAddress isa = new InetSocketAddress(lh, 8080);
              ssc.socket().bind(isa);
              // Register accepts on the server socket with the selector. This
              // step tells the selector that the socket wants to be put on the
              // ready list when accept operations occur, so allowing multiplexed
              // non-blocking I/O to take place.
              SelectionKey acceptKey = ssc.register(acceptSelector, SelectionKey.OP_ACCEPT);
              int keysAdded = 0;
              // Here's where everything happens. The select method will
              // return when any operations registered above have occurred, the
              // thread has been interrupted, etc.
              while ((keysAdded = acceptSelector.select()) > 0) {
                  // Someone is ready for I/O, get the ready keys
                  Set readyKeys = acceptSelector.selectedKeys();
                  Iterator i = readyKeys.iterator();
                  // Walk through the ready keys collection and process date requests.
                  while (i.hasNext()) {
                        SelectionKey sk = (SelectionKey)i.next();
                        i.remove();
                        // The key indexes into the selector so you
                        // can retrieve the socket that's ready for I/O
                        ServerSocketChannel nextReady = (ServerSocketChannel)sk.channel();
                        // Accept the date request and send back the date string
                        Socket s = nextReady.accept().socket();
                        OutputStream socketStream = s.getOutputStream();
                        StreamClient newClient = new StreamClient(socketStream, this);
                        localFile.addObserver(newClient);
                        clients.add(newClient);
         public static void main(String[] args) {
              try {
                   NIOStreamRelay streamRelay = new NIOStreamRelay();
              } catch (Exception e) {
                   e.printStackTrace();
    LocalFile.java:
    package com.RR4;
    import java.util.Observable;
    import java.io.*;
    * LocalFile: class reading local file when no live content is sent to the relay
    public class LocalFile extends Observable implements Runnable {
         // filenames is an array containing a list of files to be read when no live content is sent
         private String[] filenames = {
              "test.nsv",
              "test2.nsv"
         private InputStream stream;
         boolean streamOpened;
         int fileIndex;
         NIOStreamRelay parent;
         // Constructor: initialises LocalFile
         //  sets fileIndex to 0, and sets main StreamRelay as Observer
         public LocalFile(NIOStreamRelay parent) {
              this.parent = parent;
              fileIndex = 0;
              initStream();
          * initStream: initialises stream to read the next file in 'filenames' array
         public void initStream() {
              try {
                   stream = new BufferedInputStream(new FileInputStream(filenames[fileIndex]), NIOStreamRelay.BUFFER_SIZE);
                   streamOpened = true;
                   fileIndex++;
                   if (fileIndex==filenames.length)
                        fileIndex = 0;
              } catch (Exception exp) {
                   exp.printStackTrace();
                   streamOpened = false;
          * run: main loop of the class.
          *     the file is actually read: a buffer of BUFFER_SIZE is filled and sent to
          *     the observer (StreamRelay)
         public void run() {
              byte[] buffer = new byte[NIOStreamRelay.BUFFER_SIZE];
              byte[] bufferToSend;
              boolean quit = false;
              int actualBufferSize = 0;
              while (!quit) {
                   try {
                        this.setChanged();
                        // Bytes are read until the buffer is actually filled with BUFFER_SIZE bytes
                        // Only then is it sent to the observer...
                        while (streamOpened && ((actualBufferSize = stream.read(buffer, 0, NIOStreamRelay.BUFFER_SIZE)) > 0)) {
                             if (parent.clients.size() > 0) {
                                  if (actualBufferSize<NIOStreamRelay.BUFFER_SIZE) {
                                       bufferToSend = new byte[actualBufferSize];
                                       System.arraycopy(buffer, 0, bufferToSend, 0, actualBufferSize);
                                       this.notifyObservers(bufferToSend);
                                  } else
                                       this.notifyObservers(buffer);
                                  this.setChanged();
                             } else {
                                  try { Thread.sleep(100); } catch (Exception exp) {}
                   } catch (Exception exp) {
                        exp.printStackTrace();
                   try { stream.close(); } catch (Exception exp) {}
                   initStream();
    StreamClient.java:
    package com.RR4;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class StreamClient implements Observer {
         OutputStream out;
         NIOStreamRelay parent;
         public StreamClient(OutputStream out, NIOStreamRelay parent) {
              this.out = out;
              this.parent = parent;
         public void update(Observable observable, Object obj) {
             try {
                   out.write( (byte[]) obj);
                   out.flush();
              } catch (Exception exp) {
                   // if read bytes couldn't be sent
                   // remove this client from clients list and observers of StreamRelay
                   // and try to close OutputStream and Socket
                   try { parent.localFile.deleteObserver(this); } catch (Exception e) {}
                   try { parent.clients.remove(this); } catch (Exception e) {}
                   try { out.close(); } catch (Exception e) {}
    }Does it look better to you?
    I know I'm still using single threading, but as the IO should be non-blocking, I guess it should be better.
    Furthermore, I tried it locally, and was able to launch 30+ clients without buffering problems (huh, ok, my cpu here is only a 1.6GHz, so the display was a bit lagguy, but it didn't seem to buffer at all)

Maybe you are looking for

  • Shop order deleted by accident

    Hi Somehow the SAP ME allowed a Shop Order that had active and/or finished SFCs in it to be deleted. Is there any possibility to recover the shop order and related information? Br, Jennsen

  • Tecra M5-106: Display with 1024 * 768 resolution is not clear

    I buy Toshiba Tecra M5-106, it is 14.1" screen. When i set the screen resolution to 1024 * 768, every thing comes not clear... also the fonts is not good. Could be the sharpness or other? Any one see this before, or have solution for this? Solving th

  • How can I stop all of my old emails from downloading to my new iphone?

    When I upgraded to iphone 4S a few years ago, hundreds and hundreds of old emails suddenly downloaded to my iphone, and I couldn't stop it. I can't remember how I resolved the problem then -- but it is happening again with my new iphone 6. My badge i

  • Product relationships data to find partner & warranty category

    HI experts, i have a product created in commpr01 as type material , for this product in relationships warranty category & vendors are assigned Can any one let me know if there is a FM or table to find for a product a warranty or vendor is assgined wh

  • Free 1-year warranty, when purchased from reseller?

    Sorry that I wasn't sure of a better place to put this question: Does my new MacBook Pro include a free 1-year warranty, even if I bought it from a reseller (Best Buy)?