Starting and stopping stream capture repeatedly

Hi,
I am building a vmail server that captures an incoming, continuous RTP voice stream from a hardware phone and records portions of that stream to disk, based on control messages received (like record/stop buttons for a continuous RTP stream).
The first time I record, the sound file on the file system is well formatted. Subsequent recordings result in headerless audio files (although the audio data is correctly output to file otherwise).
The problem is that I need to get header information written to the audio files for subsequent recordings.
Here is a bit of source code to show how I am starting and stopping recording. At this point, the processor is already created and realized and the MediaLocator is previously initialized:
     MediaLocator recordedML ;
     public void startRecording() {
          try {
               processor.start();
               DataSource ds = null;
               ds = processor.getDataOutput();
               recordingDataSink = Manager.createDataSink(ds, recordedML);
               recordingDataSink.open();
               // starts sticking captured data into a file
               recordingDataSink.start();
          } catch (IOException e) {
               e.printStackTrace();
          } catch (NoDataSinkException e) {
               e.printStackTrace();
     public void stopRecording() {
          try {
               recordingDataSink.stop();
               recordingDataSink.close();
               recordingDataSink = null;
               processor.stop();
               processor.deallocate();
          } catch (IOException e) {
               e.printStackTrace();
Calling startRecording() and stopRecording() the first time results in a properly formatted sound file on the file system, captured from my incoming RTP stream.
Calling startRecording() and stopRecording() subsequent times results in headerless audio files.
So the problem seems to be that subsequent calls to processor.getDataOutput() result in a DataSource that doesn't print a file header.
What I have tried includes:
-recreating the processor, but this doesn't work because it seems you can only do this once for a single incoming stream - the processor never reaches the configured state a second time.
-reconfiguring the processor or re-realizing the processor, which doesn't do what I want either.
One way that I think this would work would be to write out the audio header manually after the capture is complete, but this seems like a gross hack and I would rather do it through JMF.
Is there a way to fix this via JMF? Is this a JMF bug or is it intended to work this way?
Cheers,
-Jeff

Hi, I am unfortunately unable to help you but perhaps you could help me. I have a Java GUI that I want to enable to record voice from a mic at the click of a button (stopping automatically if possible) and save to a defined file in the code. Would you be able to help me here? I have tried different source and rejigged things but I cannot seem to get anything working.
Any help gratefully apreciated.

Similar Messages

  • Script to auto start and stop an application

    Ok, I'm looking for an easy solution, maybe someone can point me in the right direction:
    I have a security camera program that runs on a Mac Mini that I would like to start and stop at a specific time of day. Is there an easy way to create an Applescript to do that?
    Thanks much in advance.

    Two scripts and iCal can do this for you. However, it assumes that your workstation is always logged into the Finder and that your app can be scripted beyond start and stop.
    --Script 1, launch application
    tell application "name of security app"
    activate
    -- do more stuff here like start capture
    end tell
    --Script 2, quit the application
    tell application "name of security app"
    quit
    end tell
    Save them both as scripts and then use iCal to make two repeating events. One to start the app and the other to stop it. Attach your scripts as event actions. Then sit back and let the iCal schedular the rest.

  • Starting and Stopping FMLE from command line yields corrupt .flv files

    I am using FMLE to record and live stream TV content. In order to this I am remotely calling FMLEcmd in order to start and stop encoding processes. The problem that I am running in to is that the .flv files generated are corrupt. The odd thing is that if I use the exact same profile XML from the GUI, then the encoding process works just fine and results appear as intended.
    Here is the way my workflow works:
    I start the process by calling
    FMLEcmd /p C:\lighttpd\htdocs\xml\default.xml /l C:\lighttpd\htdocs\logs\log.txt
    then at the conclusion of the recording I call
    FMLEcmd /s "C:\lighttpd\htdocs\files\default.flv"
    When I attempt to open the files using FFmpeg I get a codec error saying that no codecs were detected. When I attempt to open the files in VLC I get a error saying that the media types are "Undf". When I attempt to open or modify the files with flvtool2 I get an end-of-file error. My guess is that my stop command is incorrect and somehow abruptly stopping the stream, but I don't know another way to stop the stream. Do I need to specify a specific stream duration in the XML and make sure to call the stop command *after* the duration has been reached? What would cause this codec corruption when the same profile works properly from the GUI?
    Here is the profile I am attempting to use.
    <?xml version="1.0" encoding="UTF-16"?>
    <flashmedialiveencoder_profile>
        <preset>
            <name>Custom</name>
            <description></description>
        </preset>
        <capture>
            <video>
            <device>Osprey-440 Video Device 1A</device>
            <crossbar_input>0</crossbar_input>
            <frame_rate>20.00</frame_rate>
            <size>
                <width>640</width>
                <height>480</height>
            </size>
            </video>
            <audio>
            <device>SigmaTel Audio</device>
            <crossbar_input>0</crossbar_input>
            <sample_rate>22050</sample_rate>
            <channels>1</channels>
            <input_volume>75</input_volume>
            </audio>
        </capture>
        <process>
            <video>
            <preserve_aspect></preserve_aspect>
            <deinterlace></deinterlace>
            </video>
        </process>
        <encode>
            <video>
            <format>VP6</format>
            <datarate>650;</datarate>
            <outputsize>640x480;</outputsize>
            <advanced>
                <keyframe_frequency>5 Seconds</keyframe_frequency>
                <quality>Best Quality - Lower Framerate</quality>
                <noise_reduction>None</noise_reduction>
                <datarate_window>Medium</datarate_window>
                <cpu_usage>Dedicated</cpu_usage>
            </advanced>
            <autoadjust>
                <enable>false</enable>
                <maxbuffersize>1</maxbuffersize>
                <dropframes>
                <enable>false</enable>
                </dropframes>
                <degradequality>
                <enable>false</enable>
                <minvideobitrate></minvideobitrate>
                <preservepfq>false</preservepfq>
                </degradequality>
            </autoadjust>
            </video>
            <audio>
            <format>MP3</format>
            <datarate>48</datarate>
            </audio>
        </encode>
        <restartinterval>
            <days></days>
            <hours></hours>
            <minutes></minutes>
        </restartinterval>
        <reconnectinterval>
            <attempts></attempts>
            <interval></interval>
        </reconnectinterval>
        <output>
            <file>
            <limitbysize>
                <enable>false</enable>
                <size>10</size>
            </limitbysize>
            <limitbyduration>
                <enable>false</enable>
                <hours>0</hours>
                <minutes>60</minutes>
            </limitbyduration>
            <path>C:\lighttpd\htdocs\files\default.flv</path>
            </file>
        </output>
        <metadata>
            <entry>
            <key>author</key>
            <value></value>
            </entry>
            <entry>
            <key>copyright</key>
            <value></value>
            </entry>
            <entry>
            <key>description</key>
            <value></value>
            </entry>
            <entry>
            <key>keywords</key>
            <value></value>
            </entry>
            <entry>
            <key>rating</key>
            <value></value>
            </entry>
            <entry>
            <key>title</key>
            <value></value>
            </entry>
        </metadata>
        <preview>
            <video>
            <input>
                <zoom>100%</zoom>
            </input>
            </video>
            <audio></audio>
        </preview>
        <log>
            <level>100</level>
            <directory>C:\Documents and Settings\Administrator\My Documents\My Videos</directory>
        </log>
    </flashmedialiveencoder_profile>

    If issue of corrupt file after cmd line not in GUI mode. Are you using some automation to copy/paste output flv to someother location?
    AFAIK, after placing stop command, FMLE took some time to write proper EOF in FLV. wait ~10 sec for FMLE to complete file writing process and than play in FLV PLayer.
    I tried manually with steps you mentioned and it's working fine for me.I playerd file in Applian Flash PLayer. "http://www.applian.com/flvplayer/"

  • Start and Stop Trigger using PXI-6120 and DigitalSta​rtAndStopT​rigger.vi not working :-(

    Hello,
    I've been trying for a while now to get my PXI unit to capture a waveform between a Start and Stop (Reference) Trigger using the NI example DigitalStartAndStopTrigger.vi downloaded from the NI website. However, whilst the start trigger and stop trigger seem to be working i.e. the VI runs and stops at  the correct times there is never any data read from my DAQmx compatible PXI-6120 card. So I can see the VI is running around the aquisition loop but the Property Node AvailSampPerChan is always returning zero... this has me slightly puzzled. I thought this might just be a driver issue so I've updated my box to the following software versions (see below) and installed the latest drivers e.g. DCDNov07.exe (also from the NI site) but nothing has changed.
    my software as of now.
    Labview 7.1 (with the 7.1.1 upgrade applied)
    Max 4.3.0.49152
    DAQmx 8.6.0f12
    Trad DAQ 7.4.4f7
    before I updated I had the same problem but with the following versions:
    Labview 7.1 (with the 7.1.1 upgrade applied)
    Max 4.2.1.3001
    DAQmx 8.5.0f5
    Trad DAQ 6.9.3f4
    So to cut a long story short I still have the same problem with the triggers... does anybody have any ideas what is going wrong?
    To add insult to injury it the traditional DAQ example ai_start-stop_d-trig.vi was almost working correctly before I did the upgrade. It had the strange behaviour of capturing the AI0 channel but on the wrong edges (e.g. if I set Start on Rise and Stop on Fall it would do the opposite, Start on Fall and Stop on Rise).
    I'm going to leave my box doing a mass compile over night but i'd really like it if someone could suggest a solution or point me in the right direction.
    Many thanks,
    Mike

    Hi Graham
    I'm out of the lab today but I'll try and answer your questions as best I can...
    1) What are the values you have set for Buffer size, Rate, samples per read and post trigger Samples?
    At the moment I have all the values (e.g. sample rate, buffer size etc) unchanged apart from the ones I mentioned in my previous post (see above). I have in the past played around with changing the buffer sizes and rates in the example VI but as this appeared to have no effect on the behaviour I now have them setup as in the download.
    2) Does the program end after the stop trigger is implemented?
    Yep, if I toggle the trigger line high then low I see the program exits the read loop and the VI stops running as expected.
    3) Lastly can you give me the details of triggering method. Are you
    using a digital train of users set digital pulses? how long is the
    program running.I'm using the WriteDigChan.vi to manually toggle the first digital line of the PXI-6733 card which is wired directly to PFI0 of the PXI-6120 card. Generally, I just start the VI running  and then toggle the line high, wait a couple of seconds and then toggle it low.
    To me it all looks like it should be acquiring samples but as I said yesterday it just refuses to fill the buffer with any data (and hence no samples are read).
    Any ideas? and thanks for you help,
    Mike

  • Inserting FLV videos that allow student to start and stop anywhere

    Hello,
    I am inserting flv videos that students need to be able to start and stop anywhere, and when the video reaches the end, the student clicks on the NEXT button to go to next slide.
    As long as the student lets the video play without any interruptions, the NEXT button appears at the end.
    THe problem I am having is that everything works except the NEXT button is not appearing at the end of the Video unless the NEXT button is visible for the whole time the video is on.
    If the NEXT button is visible during the whole time the video is showing, the student is able to skip the video without watching it.
    I need the students to view the whole video as part of the course.
    Is this possible?

    Your original post didn't mention that the students should be able to repeat a portion of the video again if they choose to do so. This of course complicates matters further as you would then need to show either one of the standard Captivate playbars or use a Playbar widget as you are doing now. However, this also opens up for the user being able to skip the video once again, so it's not the best solution.
    As I see it you have two options:
    1) Present the video without the playbar as I described in my first post. Add the next button at the end of the video. This will make sure that the video has been watched to the end before the user can continue to the next slide. Perhaps you could add a "Replay" button so that the user would be able to watch the entire video again simply by replaying the slide.You can create Start and Stop(Pause) buttons by inserting Smart Shapes or Regular buttons and assign an Advanced Action to Pause or Continue the project.
    2) Modify one of the Playbar widgets so that the scrubber and the next button isn't activated until a certain frame has been reached on that particular slide. Once this frame is reached the widget could activate Play and Scrubber allowing the users to navigate to the next slide or move around in the video. However, this requires extensive knowledge of Flash and Actionscript to achieve and it will also be a very troublesome approach as the frame numbers would change if you insert new slides (or extend / shorten existing slides) prior to the slide(s) containing the video.
    www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips and Tricks and much more..

  • Videos start and stop such as iCloud information video

    When I try to use your video for information such as for iCloud the start and stop. Then I hit the arrow again start and stop. Is it my iPad or your video?

    (we are just users, like you.  It's not my video)
    Are you watching a video that has been downloaded to the pad, or are you streaming from apple's or anybody's website?  It sounds like a connection speed issue.  If you are streaming, you need a fast connection, 3 g likely will not work well. Wifi usually works better, but again, is dependant on your speed.

  • Why do online videos start and stop and what to do about it

    why do online videos start and stop and what to do about it

    It usually means a slow internet connection, or inadequate hardware or both.
    It is not a 10.6 problem as such as 10.6 handles video streaming quite well.
    In your post this tag seems incongruous in this 10.6 category. 

  • Starting and Stopping an FMS Instance?

    Hi there,
    I'm sorry if this issue has already been answered somewhere else, but my Google skills are up to par and I was unable to find a documented resolution to this problem within the last few days.  Opening a new topic was my last resort.
    I am designing a live-streaming system for a client.  We've been running an instance 24/7 for the last month and my client just received an enormous bill for that.
    Basically we need to be able to start and stop the instance as needed.  When I check the checkbox next to it in the Management Console and click on Instance Actions, Stop and Start are greyed out.  I am allowed to Terminate and Reboot the instance, but I'd like to keep my same instance and simply turn it on and off in between live streams.  I've read that the Start and Stop options are disabled because my instance is not stored on an EBS volume, and that running FMS on an EBS volume is not supported.  Must I leave the instance running all the time in order to get around having to set it up each time I need it?  Is there any sort of workaround or widely accepted answer for this?
    Thanks again.

    Hi Smit,
    I believe you are talking about FMS AWS instance and you may be using a centos 4.0.2 instance AMI or lower?
    Well ... earlier,  options for stopping a centos AWS image was not available, but recently they are there in place, so I suppose if you use a new centos 4.5.1 AMI then probably you can start stop the aws instance on yuor will. Give ut a shot and let me know.
    Regards,
    Shiraz Anwar
    I again cross-checked and found that you were right, start and stop is not supported there .... an alternative method is to take a snapshots of the runinng instnace and terminate that instance after that, later you can use your snapshot to attach to the EBS volume to run your system again. You may need to use the Elastic IP address, because you wont like your users to update each time you terminate the old instance, and create new instance from snapshot. I have never used it in this way, but this is one of the approach.

  • Suspect in define time start and stop process

    Hi experts,
    If you want to set the time to start process at one time and time I stop process at one time.
    How?
    Thanks,
    T N

    Hi
    For your extract process you can use the parameter BEGIN of the command ADD EXTRACT to set from what date on you want to start
    capturing information.
    ADD EXTRACT <group name>
    {, BEGIN {NOW | yyyy-mm-dd [:hh:mi:[ss[.cccccc]]]} |
       , EXTSEQNO <seqno>, EXTRBA <relative byte address> |
       , LOGNUM <log number>, LOGPOS <byte offset> |
       , EOF |
       , LSN <value> |
       , EXTRBA <relative byte address> |
       , EOF | LSN <value> |
       , PAGE <data page>, ROW <row> |
       }You should review the reference guide for more info.
    But still you have to start and stop the process manually, but an option could be to use a cron to run
    an script that starts or stops the GoldenGate processes.
    Hope this helps.

  • I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    You don't need to upgrade your software.  But if you're struggling with Spry, IMO you should cut your losses and switch to something better for the longrun.
    If you have a budget to work with, I highly recommend Project Seven's Pop-Menu Magic 3.  It's easy to use in DW CS4, 5, 6 or CC.  More importantly, it's bullet proof and works in all devices. 
    Pop-Menu  Magic3 by PVII (commercial DW extension)
    http://www.projectseven.com/products/menusystems/pmm3/index.htm
    If you don't have a budget to work with, you can roll your own menus with jQuery plugins.  A bit more effort on your part, but they perform better than Spry.
    jQuery Superfish
    http://users.tpg.com.au/j_birch/plugins/superfish/
    jQuery MegaMenu2
    DEMO:
    http://www.geektantra.com/projects/jquery-megamenu-2/
    DOWNLOAD:
    http://code.google.com/p/jquery-megamenu/
    Nancy O.

  • Need help getting Tomcat 5.0.28 to start (and stop, eventually)

    Hi!
    I am such a newbie to the Terminal and writing scripts, so please forgive my naiveté. I have successfully installed Tomcat in my /usr/local directory, but I am having trouble creating files to start and stop Tomcat, per the instructions on the following page:
    http://developer.apple.com/internet/java/tomcat1.html
    I've followed the directions but continue to get the following error after I execute ~/bin/start_tomcat.
    -bash: start_tomcat: command not found
    My file contains the following code:
    #!/bin/sh /n
    export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.28 /n
    export JAVA_HOME=/usr /n
    $CATALINA_HOME/bin/startup.sh /n
    If anyone can help me, I would really, really, really appreciate it!
    Thanks!
    PowerBook G4 12"   Mac OS X (10.4.5)  

    Why are there all those "/n" there? Either you or the place you copied from has the wrong slash. But still, it's wronger than that to have them at all: "\n" means a newline (i.e., press "return") not the actual "backslash en" characters. Sometimes people post code with those \n visible: by making it explicit where a line-break should be, one doesn't have as much trouble when a web browser reformats the text and puts line breaks where they don't belong.

  • Report on active sync actions (like starting and stopping the sync)

    Is there a way to report on who stopped or started an active sync? I'm guessing it has to be stored somewhere, but I can't find it.
    Thanks!

    Hi Smit,
    I believe you are talking about FMS AWS instance and you may be using a centos 4.0.2 instance AMI or lower?
    Well ... earlier,  options for stopping a centos AWS image was not available, but recently they are there in place, so I suppose if you use a new centos 4.5.1 AMI then probably you can start stop the aws instance on yuor will. Give ut a shot and let me know.
    Regards,
    Shiraz Anwar
    I again cross-checked and found that you were right, start and stop is not supported there .... an alternative method is to take a snapshots of the runinng instnace and terminate that instance after that, later you can use your snapshot to attach to the EBS volume to run your system again. You may need to use the Elastic IP address, because you wont like your users to update each time you terminate the old instance, and create new instance from snapshot. I have never used it in this way, but this is one of the approach.

  • Music starts and stops during playback of burned DVD

    I really need help with this problem...I made a slideshow and added music from itunes in the program IDVD. Once I burned the DVD the music will start and stop throughout the DVD and not at chapters as I read in other threads - but in random places on the DVD. The DVD sounds like it gets hung up and then starts again. This is my first project using IDVD, so any help would be great.

    Debra,
    Do your project have music purchased from iTunes? If so, that could be the cause of this problem. Music from iTunes is DRM-protected and can cause problems in playback. To take care of this, first burn all of your purchased music to a CD, then reimport in an aiff format. To do this, in iTunes, go to iTunes>Preferences>Advanced>Importing. Look for "Import using", and use the drop-down menu to select AIFF encoder.
    Good luck.

  • In Month View, showing start and stop times for appointments

    Hi, I want to show both the start and stop times for all appointments in my iCal Month view and have not been able to figure out how to do that. Any suggestions? - Dave

    I would also like to know how to do this if possible. I want to print month-view schedules with start and end times for events. Thought I'd bump this up to see if anyone has any ideas.

  • Printing event start and stop times

    In month view, is there any way to have both the start and stop times for an event show when you print the calendar so you can see the duration of an event - thanks.

    You might be able to use this script to reset the start/stop times to zero.  Try with a small selection and see if it works for you.
    http://dougscripts.com/itunes/scripts/ss.php?sp=batchtrimtime

Maybe you are looking for

  • BPM Process Context Issue

    Hi Experts,                Can i use WDJ context as process context in BPM(Once i assigned WDJ component to a Task, i can able to see the WD context in Data types ) or we have to create a separate xsd in BPM. i came to know about this functionality s

  • IDoc to File - Russian Characters not in UTF-8 format - File Receiver

    Hello, My scenario is Idoc to File. My SAP sender system is a Unicode system and my RFC connection to XI is also set to a unicode connection. My idoc is sent to XI OK and whenever I look at the payload in SXMB_MONI, I see the Russian characters OK, b

  • Stroke will not go below 1pt.

    Please help if you can. On some objects I draw in Illustrator CC, I can adjust the stroke by selecting any stroke weight, and it works. However, when I draw an object with the rectangle or pen tool and I select any weight under 1pt. (after I have dra

  • LR 3.6 Catalogue unable to be optimized

    In Lightroom 3.5 and now 3.6 every attempt to optimize my catalogue results in the error message "Your catalog was not optimized and Lightroom must restart.  Lightroom will check the catalog for damage when it resumes."  Lightroom resumes, and everyt

  • Generate report  - absolute begginner question -

    I need to generate a report from java . i was researching on iText but its for web based projects. What can i use for a desktop application. i am new to this, so can some one tell me a suitable technology and sample codes to understand it.