RTP streaming from local file

I've a problem with JMF, in particular when I transmit a stream from a local file updated from receveing process. The file is "uLaw 8Khz, 8Bit".
It would seem that when the processor is running is made of a photo of current file size; this implies that is sent only part of the file accessed. The rest of the file is discarded and JMF raises the event EndOfStream.
Here's the source:
               // encoding = ULAW, sampleRate = 8000.0Hz, sampleSizeInBits = 8bit, channels = mono(1) or stereo(2)
               this.format = new AudioFormat(this.audioFormat, 8000, 8, 1);
               MediaLocator mlIn = null;
               if (rtpFilename != null && rtpFilename.startsWith("file://"))
                    mlIn = new MediaLocator(rtpFilename);
               else
                    mlIn = new MediaLocator("file://" + rtpFilename);
               logger.debug("Input Media locator URL: " + mlIn);
               if ((processor = createProcessor(mlIn)) != null) {
                    // configure the processor
                    stateHelper = new StateHelper(processor);
                    if (stateHelper.configure(10000)) {
                         processor.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW_RTP));
                         // Go through the tracks and try to program one of them to output gsm data
                         boolean encodingOk = false;
                         TrackControl track[] = processor.getTrackControls();
                         if (track != null) {
                              logger.debug("Track found: " + track.length);
                              for (int i = 0; i < track.length; i++) {
                                   if (!encodingOk && track[i] instanceof FormatControl) {
                                        if (((FormatControl) track).setFormat(format) == null) {
                                             track[i].setEnabled(false);
                                        } else {
                                             encodingOk = true;
                                   } else {
                                        // we could not set this track to gsm, so disable it
                                        track[i].setEnabled(false);
                         // At this point, we have determined where we can send out format data or not
                         logger.debug("Encoding " + this.format.getEncoding() + " result: " + encodingOk);
                         if (encodingOk) {
                              // realize the processor
                              if (stateHelper.realize(10000)) {
                                   try {
                                        // hand this datasource to manager for creating an RTP
                                        // datasink our RTP datasink will multicast the audio
                                        String locator = "rtp://" + this.ip + ":" + this.port + "/audio/1";
                                        MediaLocator mlOut = new MediaLocator(locator);
                                        logger.error("Output Media locator URL: " + mlOut);
                                        // create a send stream for the output data source of a processor and start it
                                        dsource = processor.getDataOutput();
                                        dsink = Manager.createDataSink(dsource, mlOut);
                                        dsink.open();
                                        // now start the datasink
                                        dsink.start();
                                        logger.debug("Data sink created for Media locator: " + mlOut);
                                        if (stateHelper.prefetch(10000)) {
                                             stateHelper.playToEndOfMedia(60000);
                                        } else {
                                             logger.warn("Processor prefetch failed");
                                   } catch (Exception e) {
                                        logger.error(e.getMessage(), e);
                                        running = false;
                                   } finally {
                                        if (stateHelper != null)
                                             stateHelper.close();
                                        if (dsink != null) {
                                             dsink.close();
                                             logger.debug("Datasink closed");
                                        try {
                                             if (dsource != null)
                                                  dsource.stop();
                                        } catch (IOException e) {
                                             logger.debug(e.getMessage(), e);
                              } else {
                                   logger.warn("Processor realization failed");
                         } else {
                              logger.warn("Encoding failed");
                    } else {
                         logger.warn("Processor configuration failed");
               } else {
                    logger.warn("Processor creation failed");
Thanks in advance mariusv5.

Hi,
I think you should go for BDC , using call transaction 'SE11' you can upload data from flat file. and Use FM gui_download to download the data from z table
thanks,
Prashant

Similar Messages

  • Discriminating "Streaming" from "Local files" on AppleTV ?

    Hi,
    Here's a small problem I am running into whilst setting up my AppleTV.
    I have an iMac whit a shared iTunes library that can be seen on my AppleTV.
    But once I synchronize some iTunes music with my AppleTV, how can I tell if the files are played from the AppleTv's hard drive or streamed from my iMac ?
    Thanks for your answers.
    Regards.
    FRED

    I solved it by turning off iTunes and "My Music" (the latter of which does not exist on the modern Mac) and using Add a Source to add the "iTunes Music" folder. Now it shows all 30,000 tracks. It looks like I have a CPU tax now...Spotify Helper runs at a constant 4%...I assume it's constantly checking for "iTunes Music" folder updates now. Anyway, thanks for the suggestions

  • Live Streaming from Video File

    Hi everyone,,, im newbie in programming streaming video with flash....ater reading documentations i tried the instructions on doc, i got a question that i've not been solved. How to make a "live streaming" from "video file". It likes a live streaming from camera but it uses video file  as the source.... many thanks

    Do you mean you have video file but you want to publish it as live stream , am i right? If yes following is the solution, but before that let me clarify you will need server to do it , i mean there is no way Flash client (i.e. .swf file running in Flash Player) can publish file from local disk.
    Now let me tell you how to do it from server:
    Place your video file under "streams" folder of your application i.e. say "myVideo.flv" under  <FMS root>/applications/myApp/streams/_definst_
    Now write following code in your main.asc file (this file would be under <FMS root>/applications/myApp )
    var mystream;
    application.onAppStart = function(){
         mystream = Stream.get("livestream");
         mystream.play("myVideo",0,-1,true);
    This will publish "myVideo" file as live stream under name of "livestream". Client would have to subscriber using NetStream and
    use ns.play("livestream",-1,-1)
    You might have to write some extra code if you want to loop same file else once play of recorded file gets over , live publish will automatically stop.
    let me know if this solves your problem

  • Import data from local file: insufficient privilege

    As part of a project I'm working on, I have to load data (only a few thousand records) into a HANA Development instance on HCP. Last week I did this several times with no problem using File > Import from HANA Studio and choosing Data From Local File. Yesterday and today I get this message (most of the time, but not all the time): SAP DBTech JDBC: [258]: insufficient privilege: Not authorized.
    Does anybody know why this might be and what do to about it?
    Are there batch alternatives? I have not found any. The INPUT INTO statement also gives authorization problems.

    Thanks for Your replies.
    Jochen - I can't find schema.ini file and your link doesn't work - I mean that site is under construction
    Mahesh - I tried to changed cells' format in excel, but file is saved without changes (as csv).
    Pandey - I read about DTW but I can't find it anywhere. Is there a site where it could be downloaded from?
    Finally I solved this problem. After saving file as xls I could changed cells' format and save with changes. It helped - data '1-10-103' is imported correctly.
    Regards,
    Hmg

  • While uploading data from local file

    Hi,
    While uploading data from local file having the header text into interal table using the GUI_UPLOAD function module,there is problem in upload because of header text in file, do we have any option in this FM itself to skip this header text and upload from sdecond line because as per our requirement we can't delete this header text from the file.

    Hi Manish,
    Do you have the problem while uploading? Is it giving any error?
    If not, if your uploading is successful into the internal table, then delete the first row, which is header, from the internal table using index eq 1.
    Regards,
    Chandra Sekhar

  • How to get folder(directory path only not file path) from local file system

    Hi Firends,
    How to get folder(directory path only not file path) from local file system , whenevr i will click on browse button.
    Please give reply for this one , if anybody knows.
    Thanks,
    Anderson.

    Hi Anderson,
    if you're using flash.filesystem.FileReference - then it is run in black box - except of filename, size and creation data (and few other properties available after some operation succeeded). This is part of security features in Flash runtime (described in header section):
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference .html
    This for example implies that user can download a content to local machine - but that content cannot be loaded back into Flash runtime. For this you would need either Air runtime flash.filesystem.File:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml
    (so you would created Air runtime based application: desktop or mobile but not web, even as standalone project) or you would need one of 3rd party tools that add file access/file information features to standard Flash runtime applications converted to standalone native applications.
    hth,
    kind regards,
    Peter

  • Save a rtp stream to a file

    hi,
    I can send and receive a rtp stream. Now I want to save a received rtp stream to a file,but i got an exception when create
    a DataSink:
    public synchronized void update(ReceiveStreamEvent evt) {
            RTPManager mgr = (RTPManager) evt.getSource();
            Participant participant = evt.getParticipant();
            ReceiveStream stream = evt.getReceiveStream();
            if (evt instanceof NewReceiveStreamEvent) {
                DataSource ds = stream.getDataSource();
        }

    Well gee wiz, I should would like to help you with your exception with your data sink...
    But you didn't post what exceptino you were getting, so I can't help you...
    And the code you posted has nothing to do with a DataSink to begin with, so I can't help you again...

  • Write(Export) the RTP Stream from a SIP Call to an audio file

    I am working on telephony system that need record each call to a file.
    I got the RTP Stream in ReceiveStreamEvent handler and start to record
    the problem is i got a file and play it but there are any sounds
    when i set FileTypeDescriptor.WAVE and AudioFormat.ULAW
    I try out the FileTypeDescriptor.WAVE and AudioFormat.IMA4_MS, i got a fixed size file with 60kb
    if the FileTypeDescriptor.MPEG_AUDIO and AudioFormat.MPEG, the processor cannot be realize,
    the thread is blocked!!
    Could anyone save me? thanks in advanced!
    =================================Code===================================================
    public void update(ReceiveStreamEvent evt){
    logger.debug("received a new incoming stream. " + evt);
    RTPManager mgr = (RTPManager) evt.getSource();
    Participant participant = evt.getParticipant(); // could be null.
    ReceiveStream stream = evt.getReceiveStream(); // could be null.
    if (evt instanceof NewReceiveStreamEvent)
    try
    stream = ( (NewReceiveStreamEvent) evt).getReceiveStream();
    DataSource ds = stream.getDataSource();
              recorder = new CallRecorderImpl(ds);
    recorder.start();
    catch (Exception e)
    logger.error("NewReceiveStreamEvent exception ", e);
    return;
    ========================================================================================
    this is the CallRecorderImpl Class
    public class CallRecorderImpl implements DataSinkListener, ControllerListener {
         private Processor processor = null;
         private DataSink dataSink = null;
         private DataSource source = null;
         private boolean bRecording = false;
         FileTypeDescriptor contentType = new FileTypeDescriptor(FileTypeDescriptor.WAVE);
         Format encoding = new AudioFormat(AudioFormat.IMA4_MS);
    MediaLocator dest = new MediaLocator("file:/c:/bar.wav");
         public CallRecorderImpl(DataSource ds) {
              this.source = ds;
         public void start() {
              try {
                   processor = Manager.createProcessor(source);
                   processor.addControllerListener(this);
                   processor.configure();
              } catch (Exception e) {
                   System.out.println("exception:" + e);
         public void stop() {
              try {
                   System.out.println("stopping");
                   this.dataSink.stop();
                   this.dataSink.close();
              } catch (Exception ep) {
                   ep.printStackTrace();
         public void controllerUpdate(ControllerEvent evt) {
              Processor pr = (Processor) evt.getSourceController();
              if (evt instanceof ConfigureCompleteEvent) {
                   System.out.println("ConfigureCompleteEvent");
                   processConfigured(pr);
              if (evt instanceof RealizeCompleteEvent) {
                   System.out.println("RealizeCompleteEvent");
                   processRealized(pr);
              if (evt instanceof ControllerClosedEvent) {
                   System.out.println("ControllerClosedEvent");
              if (evt instanceof EndOfMediaEvent) {
                   System.out.println("EndOfMediaEvent");
                   pr.stop();
              if (evt instanceof StopEvent) {
                   System.out.println("StopEvent");
                   pr.close();
                   try {
                        dataSink.stop();
                        dataSink.close();
                   } catch (Exception ee) {
                        ee.printStackTrace();
         public void dataSinkUpdate(DataSinkEvent event) {
              if (event instanceof EndOfStreamEvent) {
                   try {
                        System.out.println("EndOfStreamEvent");
                        dataSink.stop();
                        dataSink.close();
                        System.exit(1);
                   } catch (Exception e) {
         public void processConfigured(Processor p) {
              // Set the output content type
              p.setContentDescriptor(this.contentType);
              // Get the track control objects
              TrackControl track[] = p.getTrackControls();
              boolean encodingPossible = false;
              // Go through the tracks and try to program one of them
              // to output ima4 data.
              for (int i = 0; i < track.length; i++) {
              try {
                   track.setFormat(this.encoding);
                   encodingPossible = true;
              } catch (Exception e) {
                   track[i].setEnabled(false);
              if (!encodingPossible) {
                   System.out.println("cannot encode to " + this.encoding);
              return;
              p.realize();
         public void processRealized(Processor p) {
              System.out.println("Entered processRealized");
    DataSource source = p.getDataOutput();
    try {
         dataSink = Manager.createDataSink(source, dest);
         dataSink.open();
         dataSink.start();
         dataSink.addDataSinkListener(new DataSinkListener() {
                        public void dataSinkUpdate(DataSinkEvent e) {
                             if (e instanceof EndOfStreamEvent) {
                                  System.out.println("EndOfStreamEvent");
                                  dataSink.close();
    } catch (Exception e) {
         e.printStackTrace();
         return;
              p.start();
    ============================================

    Which shows that the output stream cannot be of that particulat format and descriptor.
    Look at this code
    import javax.swing.*;
    import javax.media.*;
    import java.net.*;
    import java.io.*;
    import javax.media.datasink.*;
    import javax.media.protocol.*;
    import javax.media.format.*;
    import javax.media.control.*;
    class Abc implements ControllerListener
         DataSource ds;
         DataSink sink;
         Processor pr;
         MediaLocator mc;
         public void maam() throws Exception
              mc=new MediaLocator("file:C:/Workspace/aaaaa.mpg");
              pr=Manager.createProcessor(new URL("file:G:/java files1/jmf/aa.mp3"));
              pr.addControllerListener(this);
              pr.configure();          
         public void controllerUpdate(ControllerEvent e)
              if(e instanceof ConfigureCompleteEvent)
                   System.out.println ("ConfigureCompleteEvent");
                             Processor p = (Processor)e.getSourceController();
                   System.out.println ("ConfigureCompleteEvent");
                         processConfigured(p);
              if(e instanceof RealizeCompleteEvent)
                   System.out.println ("RealizeCompleteEvent");
                           Processor p = (Processor)e.getSourceController();
                             processRealized(p);
              if(e instanceof ControllerClosedEvent)
                         System.out.println ("ControllerClosedEvent");
                     if(e instanceof EndOfMediaEvent)
                        System.out.println ("EndOfMediaEvent");
                        Processor p = (Processor)e.getSourceController();
                        p.stop();
                 if(e instanceof StopEvent)
                         System.out.println ("StopEvent");
                         Processor p = (Processor)e.getSourceController();
                         p.close();
                   try
                        sink.stop();
                        sink.close();
                   catch(Exception ee)
         public void processConfigured(Processor p)
              System.out.println("Entered processConfigured");
              p.setContentDescriptor (new FileTypeDescriptor (FileTypeDescriptor.MPEG_AUDIO));       
                /*    TrackControl track[] = p.getTrackControls ();
                 boolean encodingPossible = false;
                 for (int i = 0; i < track.length; i++)
                      try
                           track.setFormat (new VideoFormat (VideoFormat.MPEG));
                   encodingPossible = true;
                   catch (Exception e)
                   track[i].setEnabled (false);
         p.realize();
         public void processRealized(Processor p)
              pr=p;
              System.out.println("Entered processRealized");
              try
                   MediaLocator dest = new MediaLocator("file:C:/Workspace/ring1.mpg");
                   sink = Manager.createDataSink(p.getDataOutput(), dest);
              sink.addDataSinkListener(new DataSinkListener()
                        public void dataSinkUpdate(DataSinkEvent e)
                             if(e instanceof EndOfStreamEvent)
                        System.out.println ("EndOfStreamEvent");
                                  sink.close();
                   sink.open();
                   sink.start();
              catch(Exception eX)
              System.out.println("Just before start");
              p.start();
    /*     public void dataSinkUpdate(DataSinkEvent event)
              if(event instanceof EndOfStreamEvent)
                   try
                        System.out.println("EndOfStreamEvent");
                        dsk.stop();
                        dsk.close();
                        System.exit(1);
                   catch(Exception e)
    public class JMFCapture6
         public static void main(String args[]) throws Exception
              Abc a=new Abc();
              a.maam();

  • Importing previously exported data (from local file)

    After having searched to no end I still cannot find the answer to my question....
    Our current environment is an SAP and FLM system (forms livecycle management) using livecycle designer for design and all users on at least reader 9.
    I would like to know if it is possible for a user to fill in a form and save the entered data (to a local file) so the following week they can then open latest version of the PDF (requested from the FLM portal to be either completed online (portal) or offline (email)) they would then import the data, make any minor updates and submit. The forms should have reader extensions applied but as yet unsure of the exact settings (if any) as this happens automatically within FLM. The form shouldn’t change in future, more than some additional validation, but allow form numbers and versions within FLM to be better maintained. Plus to ensure users do not keep or use outdated forms.
    From my understanding there are 2 ways to import data, either folder level javascript or via certifying the form. For our setup folder level scripts are a non-starter as would have no way to maintain these on every PC (far to many) so that leave us with certifying forms....from the limited information I have found on this it appears that the certification may break when importing data, have very very basically tested this and appears to be true.
    So the last thought was if I can import data programmatically via javascript and fill fields in etc would this still have the same affect of breaking certification?
    Appreciate any advice

    > Hi Srdjan.
    >
    > Are you familiar with the MDM Import Manager?
    >
    > Best regards,
    > Nir
    Hi
    I haven't tried the MDM Import manager..but I solved it with LSMW. I created a recording for one record entry, then I specified the rest of the data in a text file, and passed it to LSMW..It worked (almost) perfectly!
    Thanks for the suggestion though, I'll give it a try some other time
    Best regards,
    S.

  • IOS: (not) playing sound from local file system - Error #2032

    Dear all,
    I am working on an app where I want to (among others) play sound files from the local file system.
    I have added a few mp3 files into my .ipa file.
    With a small file browser in my app I can select any one of them which returns me a File object.
    I then use this File object to do a URLRequest to load the sound:
    var req:URLRequest = new URLRequest(file.nativePath);
    sound = new Sound();
    sound.addEventListener(IOErrorEvent.IO_ERROR, soundLoadError);
    sound.addEventListener(Event.COMPLETE, soundLoaded);
    sound.load(req);
    It works in flash, but fails on the iPAD. Everytime I try to load, I get a IOErrorEvent with error code Error #2032
    When I replace new URLRequest(file.nativePath) with URLRequest("http://.../testfile.mp3"), everything works fine!
    Any help appreciated.
    Is this a matter of Security settings? Can I change those?
    Something to do with Sandboxing (whatever that is)?
    or something to do with cross-domain access?
    I have been looking around for days now and any help would be appreciated!
    I am using Flash CS5.5 & AIR 2.7
    Thanks, Marcus.

    Hi Sanika,
    this was something closer to that paragraph for "nativePath":
    Some Flex APIs, such as the source property of the SWFLoader class, use a URL (the url property of a File object), not a native path (the nativePath property).
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml#nativePath
    but that is not exactly what I've read (maybe that was A-blog or post on someone from A-team on his personal blog or post on stackoverflow).
    (myself I'm using and providing solutions for paths using FILE protocol - file URI schemes - mostly whenever I can and where it is supported)
    regards,
    Peter

  • Get image from local file system for printing

    If a user clicks Print, I would like to be able to print the
    stationery header if the user wants to print on plain paper. Can I
    pick up the image from the users local file system and add it
    directly to the print send object? Prior to this the user would
    simply upload the location of the image to the remote server where
    the swf resides, or do I have to ask him to upload the image itself
    and then download it again every time he uses the program?
    Doug

    Here is a snippet from the Flex 2 user guide about urlloader:
    When using this method, consider the Adobe® Flash®
    Player security model:
    For Flash Player 8 and later:
    Data loading is not allowed if the calling SWF file is in the
    local-with-file-system sandbox and the target resource is from a
    network sandbox.
    Data loading is also not allowed if the calling SWF file is
    from a network sandbox and the target resource is local.
    As far as I know there is no way for a user to "trust" an swf
    file. This is not like an activeX control.

  • Can an applet loading from a browser read from local file system?

    I have to load my applet from a browser, and the "browse" button on it should be able to select and read certain files in the local file system( or the files located under the server's home directory). Is there a way to address the security issue? I know there are ways to enable an appletviewer to do it, but how about a browser?

    You'll need to have a signed applet.

  • How can i Store rtmp streaming into local File System?

    I use socket and netstream.appendBytes to receive and play flv frames.
    now I got the BytesArray,but how can i store them into local File?
    FlashPlayer can't use Air File APIs.

    This is by design.  Content on the Internet does not have access to your local filesystem.  We offer Local Shared Objects (LSOs) for storing small amounts of information, but this would not be suitable for scraping a video feed to disk.

  • Send live stream from local PC to global server

    hello,
    I'd like to capture audio/video from my local PC, and transmit it to a global server, which will send my content to some audiences.
    Since the local PC has no unique IP, the server can't call RTPManager.addTarget(...) to receive live stream.
    Someone recommends me transfer the stream using servlet. But I have no idea.
    Is it possible using JMF RTP, and how?
    Thanks a lot,
    Derek

    Hi Derek,
    I am working on the same thing. I am not able to improve a bit on how to transmit audio captured from my mic. Can u please help me in doing. It will be of much help for me. I would like to transmit sound to computers in the intranet. My email id is [email protected] I would really appreciate if u can help me on this .
    Regards,
    Firmin Dani.

  • Live streaming from mp4 file

    Hello everybody,
    I know that's a noob question (as I am) but i can't make it run.
    I have an mp4 file and the folders structure is....
    Application/test/sources/_definst_
    in _definst_ source.mp4
    in test folder main.asc file
    main.asc file contains
    var mystream;
    var intervalID;
    application.onAppStart = function(){
    mystream = Stream.get("mylive");
    intervalID = setInterval(startPublish,100); / checking every 100 ms if we can start publish
    function startPublish(){
    if(checkTime() == true){
    clearInterval(intervalID ); //clearing the interval so that startPublish won't be called again
    myStream.play("mp4:sample.mp4",0,-1,true) //starting the live publish of recorded file sample.mp4
    function checkTime(){
    myDate = new Date();
    if(myDate.getHours() == 21) // This means its 2 PM
    return true;
    else
    return false;
    All this stuff doesn't work. When I go to the admin panel and select test under new instance the stream appears on the left side but if press enter on _definst_ it disappears from the column.
    What's wrong?
    Is possible with this code run that video on ios devices?
    Thank you very much

    Hi,
    By default the FMS looks for the media under <application>/streams/_definst_/ and not sources/_definst_/. In case you want to specify the media location then copy the Application.xml from the vod sample application and edit the Streams tag. For eg :
    <StreamManager>
                        <VirtualDirectory>
          <!-- Specifies application specific virtual directory mapping for recorded streams.   --> 
           <Streams>/;<root_install>/applications/vod/sources/_definst_/</Streams>    
                        </VirtualDirectory>
    </StreamManager>
    This should solve your problem. The main.asc is fine.
    Hope this helps.
    Thanks,
    Apurva

Maybe you are looking for

  • F4IF_INT_TABLE_VALUE_REQUEST Problem

    Hi Folks, I have problem with FM F4IF_INT_TABLE_VALUE_REQUEST Here is the scenario. i have interbnal table tbwerks[] that contains plant and description(two fields). DATA: BEGIN OF tbwerks OCCURS 10,        werks LIKE t001w-werks,        name1 like t

  • Output not coming correct

    Hi, I had developed this code and after all modifications and alterations in it ,i am pasting here bcoz it is still giving the problem that the values of ITAB does not contain the correct data as it keep on repeating the same value for the data in IT

  • OWB-Location for Sybase is defined through database link but not working.

    Hi, HS details are configured and database link from oracle to sybase database is working fine. In OWB, table list of sybase database is also displayed. Location defined for sybase database through connector which refers to database link created from

  • Where/what is the app to click on to transfer music from the computer to the iphone?

    Where/what is the app to click on to transfer music from the computer to the iphone?

  • How to run jsp in tomcat server

    hi this is satish1529, i am new to jsp technology,i have written small jsp file and html file,i don't know where to place jsp and html files in tomcat server and where i have to do setting in the server and how to run jsp file. pls give me step by st