Play video from input stream

urgent
i need to play an mpg file from a jar file but the Manager.createPlayer now only Url object
is there any other way to play video from InputStream?

You may want to take a look at this:
http://www.extollit.com/isdsjmf.php
I developed a similar implementation of this for a client and it works fine. It's based on using a sequential InputStream as a DataSource for the media player. As you may already know, the Java Media Framework does not seem to support URLDataSource and/or sequential InputStreams.
This code allows you to play media from nothing more than an InputStream without downloading it all into memory or to a local file. It uses a ringbuffer as a compromise along with some other enhancements.

Similar Messages

  • Play video from byte stream? (load video from local container / archive).

    I'd like to bundle video and other media items in a container / archive file and play it from an AIR app...  Essentially I'd like to make my own distribution format that supports video plus attached files, etc.
    So, coming from the Java world I thought I might be able to construct a stream and read the bytes from the correct part of my container file.  But I'm not sure if I can actually do that with the Flash APIs.  I see that the Video component works with NetConnection objects, but it's not clear to me if I can do anything with these.
    Can anyone tell me if what I want to do is possible?
    thanks,
    Pat

    You could probably use an SSLSocket to read the video file from an encrypted stream, save it as a file on the client machine, and then read the video from the file to the MediaPlayer if that's what you mean.

  • Playing video from a streaming server

    Hi I've been using the insert flash video feature in dreamweaver CS3, using progressive download video and it works just fine. But lately I've hired a flash media server to host my videos and whent I try to use the streaming video  option it gives me this error message when I type the address of the video:
    The URL cannot contain spaces or special characters.
    Change the path or file name and try again
    The address of my video is: rtmp://p8bezucu.rtmphost.com/testevideo/portfolio.flv
    appreciate any help

    I have never used a streaming server, but looking at the instructions for inserting an FLV, it seems as though the name of the file doesn't go in the Server URI field. See the relevant help file: http://livedocs.adobe.com/en_US/Dreamweaver/9.0/WSc78c5058ca073340dcda9110b1f693f21-7c9e.h tml.
    It says that Server URI specifies the server name, application name, and instance name in the form rtmp://www.example.com/app_name/instance_name. The name of the FLV goes in the Stream Name field.

  • I am not able to play videos from YoyTube, or videow posted on my blog. That does not happens with explorer, where videos are playing normal

    I am not able to play videos from YouTube, or videow posted on my blog, when I use Fire Fox. That did not happened before the 3.6.14 and allthouhg you informed us that with the 3.6.15 the problem will dissapear, it does not happen. Take into consideration that, with explorer, everything is running fine. I am a long time user o firefox and I donnot want to change. Please give me advise how to solve thiw problem. Tanhks in advance

    Hi, My computer shuts down when I try to do any thing with graphics, ie, watching streamed video or looking at my photo's. this is a recent problem, anyone got any idea's

  • Playing video from a capture device - Out of memory for video buffers?

    Hello guys, I'm having problems playing video from a video capture device when not using JMStudio. When I use JMStudio, the video plays real time with no problems, but when I use code taken from a java book which is a simple Media Player, I get the following error:
    "Error is Error: Out of memory for video buffers."
    My capture device is working and I don't know why i get this error when trying to watch the video feed from a program other than JMStudio. I also tried different code that has worked in the past with the same exact capture device and I still get the same error. Please help, I have no clue at this point. The code for the simple media player is below, it's taken out of the book "Java: How to Program (4th edition)":
    Thanks in advance, I am very greatful
    Miguel
    device info: vfw:Microsoft WDM Image Capture (Win32):0
    When I type the locator, I am typing vfw://0, I also tried just vfw://
    and I get the same error.
    // Fig. 22.1: SimplePlayer.java
    // Opens and plays a media file from
    // local computer, public URL, or an RTP session
    // Java core packages
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    // Java extension packages
    import javax.swing.*;
    import javax.media.*;
    public class SimplePlayer extends JFrame {
         // Java media player
         private Player player;
    // visual content component
    private Component visualMedia;
    // controls component for media
    private Component mediaControl;
    // main container
    private Container container;
    // media file and media locations
    private File mediaFile;
    private URL fileURL;
    // constructor for SimplePlayer
    public SimplePlayer()
    super( "Simple Java Media Player" );
    container = getContentPane();
    // panel containing buttons
    JPanel buttonPanel = new JPanel();
    container.add( buttonPanel, BorderLayout.NORTH );
    // opening file from directory button
    JButton openFile = new JButton( "Open File" );
    buttonPanel.add( openFile );
    // register an ActionListener for openFile events
    openFile.addActionListener(
    // anonymous inner class to handle openFile events
    new ActionListener() {
    // open and create player for file
    public void actionPerformed( ActionEvent event )
    mediaFile = getFile();
    if ( mediaFile != null ) {
    // obtain URL from file
    try {
    fileURL = mediaFile.toURL();
    // file path unresolvable
    catch ( MalformedURLException badURL ) {
    badURL.printStackTrace();
    showErrorMessage( "Bad URL" );
    makePlayer( fileURL.toString() );
    } // end actionPerformed
    } // end ActionListener
    ); // end call to method addActionListener
    // URL opening button
    JButton openURL = new JButton( "Open Locator" );
    buttonPanel.add( openURL );
    // register an ActionListener for openURL events
    openURL.addActionListener(
    // anonymous inner class to handle openURL events
    new ActionListener() {
    // open and create player for media locator
    public void actionPerformed( ActionEvent event )
    String addressName = getMediaLocation();
    if ( addressName != null )
    makePlayer( addressName );
    } // end ActionListener
    ); // end call to method addActionListener
    // turn on lightweight rendering on players to enable
    // better compatibility with lightweight GUI components
    Manager.setHint( Manager.LIGHTWEIGHT_RENDERER,
    Boolean.TRUE );
    } // end SimplePlayer constructor
    // utility method for pop-up error messages
    public void showErrorMessage( String error )
    JOptionPane.showMessageDialog( this, error, "Error",
    JOptionPane.ERROR_MESSAGE );
    // get file from computer
    public File getFile()
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setFileSelectionMode(
    JFileChooser.FILES_ONLY );
    int result = fileChooser.showOpenDialog( this );
    if ( result == JFileChooser.CANCEL_OPTION )
    return null;
    else
    return fileChooser.getSelectedFile();
    // get media location from user input
    public String getMediaLocation()
    String input = JOptionPane.showInputDialog(
    this, "Enter URL" );
    // if user presses OK with no input
    if ( input != null && input.length() == 0 )
    return null;
    return input;
    // create player using media's location
    public void makePlayer( String mediaLocation )
    // reset player and window if previous player exists
    if ( player != null )
    removePlayerComponents();
    // location of media source
    MediaLocator mediaLocator =
    new MediaLocator( mediaLocation );
    if ( mediaLocator == null ) {
    showErrorMessage( "Error opening file" );
    return;
    // create a player from MediaLocator
    try {
    player = Manager.createPlayer( mediaLocator );
    // register ControllerListener to handle Player events
    player.addControllerListener(
    new PlayerEventHandler() );
    // call realize to enable rendering of player's media
    player.realize();
    // no player exists or format is unsupported
    catch ( NoPlayerException noPlayerException ) {
    noPlayerException.printStackTrace();
    // file input error
    catch ( IOException ioException ) {
    ioException.printStackTrace();
    } // end makePlayer method
    // return player to system resources and
    // reset media and controls
    public void removePlayerComponents()
    // remove previous video component if there is one
    if ( visualMedia != null )
    container.remove( visualMedia );
    // remove previous media control if there is one
    if ( mediaControl != null )
    container.remove( mediaControl );
    // stop player and return allocated resources
    player.close();
    // obtain visual media and player controls
    public void getMediaComponents()
    // get visual component from player
    visualMedia = player.getVisualComponent();
    // add visual component if present
    if ( visualMedia != null )
    container.add( visualMedia, BorderLayout.CENTER );
    // get player control GUI
    mediaControl = player.getControlPanelComponent();
    // add controls component if present
    if ( mediaControl != null )
    container.add( mediaControl, BorderLayout.SOUTH );
    } // end method getMediaComponents
    // handler for player's ControllerEvents
    private class PlayerEventHandler extends ControllerAdapter {
    // prefetch media feed once player is realized
    public void realizeComplete(
    RealizeCompleteEvent realizeDoneEvent )
    player.prefetch();
    // player can start showing media after prefetching
    public void prefetchComplete(
    PrefetchCompleteEvent prefetchDoneEvent )
    getMediaComponents();
    // ensure valid layout of frame
    validate();
    // start playing media
    player.start();
    } // end prefetchComplete method
    // if end of media, reset to beginning, stop play
    public void endOfMedia( EndOfMediaEvent mediaEndEvent )
    player.setMediaTime( new Time( 0 ) );
    player.stop();
    } // end PlayerEventHandler inner class
    // execute application
    public static void main( String args[] )
    SimplePlayer testPlayer = new SimplePlayer();
    testPlayer.setSize( 300, 300 );
    testPlayer.setLocation( 300, 300 );
    testPlayer.setDefaultCloseOperation( EXIT_ON_CLOSE );
    testPlayer.setVisible( true );
    } // end class SimplePlayer

    somebody? anybody? I know there are some JMF professionals in here, any ideas?
    I was reading the Sun documentation and it said something about increasing the JVM memory buffer or something? Well, i'm just clueless at this point.
    Help a brotha out!

  • How do I play video from photostream on apple TV?

    PhotoStream is now available on my applet TV and the notes on the upgrade said I could play video from my Photo Stream.  However the Photo Stream on the apple TV only presents photos for viewing.  Any idea on how to get it to show my videos?

    Welcome to the Apple Community.
    Unfortunately that's not possible.

  • How do I play video from my macbook pro to my tv?

    How do I play video from my macbook pro to my tv?

    What model MacBook Pro do you have? On my late 2011, I used to use a Mini DisplayPort/Thunderbolt to HDMI adapter to get video and audio from my Mac to my television. I used this adapter from Monoprice. Worked great - I just no longer use it because I bought a 27" monitor.
    You can also use AirPlay mirroring if you've the right MBP and an Apple TV - but the wired method works, too.
    Clinton

  • Play video from external HD to Apple TV

    I would like to play videos from an external drive to the Apple TV.
    The workarounds I've seen all involve moving the entire iTunes library to the external drive. I want to keep all my music on the internal HD but the videos on the external HD.
    Suggestions?

    Launch iTunes on your computer
    Mac - iTunes > Preferences > Advanced
    PC - Edit > Preferences > Advanced
    Uncheck 'Copy files to iTunes media folder when adding to library'
    This will allow you to drag and drop videos from the external drive to iTunes without copying to the internal drive. Once in iTunes you should be able to watch them on your Apple TV
    Hope that helps

  • Playing videos from iTunes onto a TV from my iPad

    Can I play videos from iTunes onto a TV from my iPad. All I seem to be able to get is the music when I connect via an HDMI cable or wirelessly to apple TV.
    Thanks
    Terry

    I have sorted now. Play through video app not music. Easy when you know how!!!

  • I have just bought a MacBook Air and i cannot play videos from the internet as it asks for a flash player to be installed i try to download Adobe flash player and it will not allow me to do so?

    I have just bought a MacBook Air and i cannot play videos from the internet as it asks for a flash player to be installed i try to download Adobe flash player and it will not allow me to do so?

    Ziatron is correct that Flash does not work on an iPad, but it does work on a Mac. See Adobe Flash Player 11.2.202.160.

  • Playing video from iPad to TV

    I bought the AV cable at the Apple store yesterday and tried it out. I can play
    video from the Video app, the Netflix app, and the YouTube app without a
    problem. But I can't play anything from the ABC app or the Hulu Plus app (the
    free stuff - I'm not subscribed yet) or the HGTV app. I get sound, but no
    picture. Anyone know why? Am I doing something wrong?

    I just tried to watch from the ABC Player on the TV, doesn't work. The app description in the app store doesn't indecate you can watch it on a TV. And there nowhere on the app to switch viewing from the iPad to the TV. So, I would say you can't view this on a TV.

  • Reading data from input stream on unix

    I have a program that reads data from input stream from the socket. If the data is over 1500 bytes it is sent in multiple TCP packets. Whats weird is, if I run the program in windows environment it waits till it receives all the packets but when I run the same program in unix environment it only reads the first packet and go further without waiting for all the TCP packets!!
    The line that reads from input stream is
    datalen = inStr.read(byteBuffer);is there anyway I can make it wait till it receives all the packets on unix system? I do not understand why it works fine for windows in this case but not for unix.
    I'll appreciate any help..
    Thanks

    Try using a DataInputStream with the readfully() method.

  • I can't play videos from you tube or Hulu on my ipad but they play fine on the iPhone, why is that and how can I fix it ?

    WHy can't I  play videos from you tube or watch Hulu on the ipad.......they play fine on the iPhone, how can I fix this ?

    Start by providing some relevant information if you need troubleshooting help. We have no idea how or what you are doing whatever it is that you are doing.

  • Firefox only can't play videos from Hamster web site

    Firefox plays videos from every other site but Hamster. IE and Chrome have no problems playing videos from this site

    Hi .
    Make sure your OS X software is up to date.
    Click the Apple  top left in your screen. From the drop down menu click Software Update.
    Or, open System Preferences > App Store > Check Now
    If your Mac is up to date, most news websites require Flash.
    Back to System Preferences > Flash Player then select the Advanced tab.
    Click: Check Now

  • IPad stop playing videos from sites

    Today my iPad stopped playing videos from site. IT WORKED YESTERDAY so iPad CAN play it. When Im trying to play video there is a crossed triangle so I can't press it. Please help!

    Its not theirs (player) they posts videos from vk.com . On this site it's ok to run video but on all of the others which have videos from vk it's not working.

Maybe you are looking for

  • How do I access kernels or process files on my IPhone

    My new IPhone has been taken over by someone. There are processes running on my phone that have been initiated by someone with APPLEAUTHAGENT. They are using Cloud Key Chain Pro and are monitoring everything on my phone as well as using my wifi and d

  • HELP! Mac Pro is overheating.

    I recently bought a new desk. It's an L-shape that has a built-in cabinet for the computer tower. I put the Mac Pro in there and started some back-up tasks and left the house. When I came back the fan was on - and louder than I ever heard it before.

  • In FD32 why credit value is calculating at cash sale cycle

    Hello Every body In credit management, customer having credit limit and also having in ova8 it is static credit limit check in sales order level. My question while customer take cash sales in sales order level, he adopted payment terms as cash sales.

  • Number of MTS Process x Hardware

    Hello, I'm trying to change the number of MTS process ( i followed the Tuning Guide and calculated the # of MTS and MaxTasks), but i need to know if my hardware can handle it. Is there any rule / restricion about it? MaxTasks: 160 MaxMTServer: 8 Task

  • I would like to know how to stretch a background image using HTML

    Hello Seniors of Sun, I gota small doubt in HTML, can any one please help me in solving it, I would like to know how to stretch a background image using HTML? I have tried and tried to figure this out and cannot.. so any one kindly help me in this...