How to encode datastream

Hello guys please help me in my project ...
In my project i need to record the incoming data stream which is in ULAW/RTP format ..
I don't know which format will be supported to wright it in a media file ...
I use data sink to wright it in a file ... as it not supporting the format i couldn't do it ....
any one please help me in which format i can wright it in a media file or save it in a media file ?

u can refer to solution about RTPSocketAdapter.java.add your code in SockInputStream.read.

Similar Messages

  • How to encode URL parameters in pl/sql?

    How to encode url and its paramters in PL/SQL to call a page using html GET method? Is there any equiavlent method of java's URLEncoder.encode() method in pl/sql (in any web packages) ?
    Any help/pointers highly appreciated.
    P.S. : URGENT PLEASE!!!

    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:371959198986

  • How to encode a fileHandler to output french characters ?

    Hi everyone,
    I'm trying to encode a fileHandler to create a file that contains french special characters (è, é, . . . .).
    I tried the following code:
    fileHandler.setEncoding("ISO-8859-1");
    and the following
    fileHandler.setEncoding("UTF-8");
    But still the output returns a question mark instead of the é and a square instead of the é respectively.
    Can anyone advice how to encode the fileHandler to have french characters in the output file ?
    Thanks
    Lanlani

    Lanlani wrote:
    But still the output returns a question mark instead of the é and a square instead of the é respectively.And how are you determining that? Bear in mind that the tool you use for looking at the output may also have charset encoding problems.

  • How to encode music to Protected AAC file?

    How to encode music to Protected AAC file?

    Hi, 微雨轻韩.
    That is not an option with iTunes.
    Only files purchased from the iTunes Store are protected by Fairplay. Apple doesn't license its use for anything else.

  • How to encode URL in UTF-8 Using PL/SQL

    Hello,
    Platform:Oracle 9i, Sun Solaris,
    Using Oracle 0i XML/XDK Iam able to generate xml data and post it to url via HTTP POST. But the xml data need to be encoded in utf-8. Does anyone know how to encode the xml data within PL/sql ?
    Thanks for your time
    Seema

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • How to encode FCP files to Windows Media files by using Discreet Cleaner?

    Do you know how to encode from FCP to Windows Media files in Discreet Cleaner 6.0?
    Which is the right settings?
    I got errors when I tries
    In beforehand thank you very much for your answer

    Hello Mikey
    I have put up the following in the settings in Cleaner 6.0.1:
    SETTING
    Windows Media
    OUTPUT:
    Windows media
    TRACKS:
    Video media will be encoded into the output file
    IMAGE:
    - crop: manual
    - image size: 320x240
    - constrain aspect ratio: 4:3
    - deinterlace: auto
    Sharpen: radius: 1.5, amount: 50
    Adaptive noise reducwe: mild
    ADJUST:
    - Gamma: 15
    - Brightness: -5
    - Contrast: 5
    ENCODE:
    - Windows Media Video V7
    - Frame rate: 24 fps
    - Insert Key frames: every 300 frames
    - Video data rate: limit to 400 kbits/sec
    AUDIO:
    - Sample rate: 44.100 kHz
    - Data rate: 48.0 kbits/sec
    - Channels: stereo
    BATCH> set default destination- her har jeg valgt en folder på harddisk
    STATUS
    - "Ready"
    PLAY
    I get the following message after to played:
    "You need to clear the status and/or change settings for the media to begin encoding"
    What is wrong with the settings or status?
    Kind regards
    mary Ann

  • How to encode request url

    String szUsrName="venkat & ashique";
    <a href="javascript :
    window.open(../jsp/Customer.jsp?cust_name=<%=szUsrName%">)">
    </a>
    Request URL:=> Customer.jsp?cust_name=venkat & ashique
    --I think from ashique it is taking as another req parameter.
    but in Customer.jsp the request parameter value comming as '''venkat''' iwant to get whole String venkat & ashique. What is the problem i know.Problem is in the string '&' symbol is there.But the solution i dont know plz can u help me. How to encode that url</a>

    You need to escape non-alphanumeric characters with %XX where XX is the hexadecimal value for that character. For example:
    "venkat & ashique" => "venkat%20%26%20ashique"%20 is space and %26 is the &.

  • How to encode a password ??

    Hi,
    How to encode (and decode after) a password, in Base64 for example ? Is it possible to do that automatically with Java ??
    Thanks in advance
    Steve

    I have finding how to encode but i don't know how to decode now !
    This is my code :
    sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
    encoder.encode(myJTextField.getText());
    It works very well but this don't work (decode) :
    sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    decoder.decode(myPassword);
    the error : "the method decode with a String for parameter doesn't exist"
    And i don't know how to find the declaration of this method.
    Help plzzzzz
    Thanks
    Steve

  • How to encode request parameters?

    Hi I'm running a small web application developed with JSP pages. But it turns out that it relies on cookies to maintain sessions, which is a limitation if the client's cookie setting disables cookies.
    I know that I could encode the request parameters and use GET method to communicate information between client and server, but have no idea how this is done.
    Can you give me some code, or recommend some tutorial to me? Thanks!

    1. If you don't want to use cookies, you could use URL rewriting to append the session ID. When you redirect to another page, do something like the following:
    a. first choose whether you want to forward or sendRedirect: (the following example is a redirect)
    //encode the parameter values to encode special characters, such as spaces
    String parameterOne = java.net.URLEncoder.encode("some value");
    String parameterTwo = java.net.URLEncoder.encode("some other value");
    //build the query string any way you want
    String queryString="?key1="+parameterOne+"&key2="+parameterTwo;
    /* Use response.encodeRedirectURL if running it through a sendRedirect.
       Doing so will rewrite the url with the session ID appended to the
       end. */
    response.sendRedirect(response.encodeRedirectURL("some.jsp"+queryString));This little code snippet demonstrates two things. It shows that URL rewriting can be used to append the session ID. It also shows you how to encode parameters (i.e. use URLEncoder.encode()).
    If you want to encode your string in the JSP, you could also do it using javascript:
    <script language="JavaScript">
    <!--
       //this is just an example javascript function
       function openPage() {
          var thisForm=document.formName;
          /* get your form element values (these are text boxes).
             Note: the javascript escape() function url encodes the values.
                   there are also other js functions to do this. */
          var paramOne=escape(thisForm.paramOne);
          var paramTwo=escape(thisForm.paramTwo);
          var queryString="?paramOne="+paramOne+"&paramTwo="+paramTwo;
          window.open("some.jsp"+queryString,"some_window_name");
       }//end openPage
    //-->
    </script>Or, you could build it using JSP expressions and scriptlets. Its really up to you. These are just rudimentary examples to help you get started.

  • Do any one kown how to encoder pcm to alaw if you use jmf?

    I'm have the problem about it how to encoder pcm to alaw?
    I find some code about it, but not work in jmf.
    A friend in forum tell me write it by myself , because jmf not support for alaw.
    But i'm new about this, so i want whether somebody could help me if you have the same code about this.
    code like this:
    capture.java
    * support : locator, datasource
    public class Capture extends MainFrame {
        private static final long serialVersionUID = 1L;
        private Processor cp = null;
        private Boolean isMix = false;
        private Boolean isUlaw = false;
        private MainFrame mf = null;
        public Capture(MainFrame mf, boolean useVideo) {
            this.isMix = useVideo;
            this.mf = mf;
        public Capture(MainFrame mf) {
            this.mf = mf;
        public Capture(boolean useVideo) {
            this.isMix = false;
        //get video MediaLocator
        public MediaLocator getVideoLocator() {
            MediaLocator VideoLocator = null;
            Vector VideoCaptureList = null;
            CaptureDeviceInfo VideoCaptureDeviceInfo = null;
            VideoFormat videoFormat = new VideoFormat(VideoFormat.YUV);
            VideoCaptureList = CaptureDeviceManager.getDeviceList(videoFormat);
            if (VideoCaptureList.size() > 0) {
                VideoCaptureDeviceInfo = (CaptureDeviceInfo) VideoCaptureList.elementAt(0);
                VideoLocator = VideoCaptureDeviceInfo.getLocator();
            } else {
    //--- Search video device
                VideoCaptureList = (Vector) CaptureDeviceManager.getDeviceList(null).clone();
                Enumeration getEnum = VideoCaptureList.elements();
                while (getEnum.hasMoreElements()) {
                    VideoCaptureDeviceInfo = (CaptureDeviceInfo) getEnum.nextElement();
                    String name = VideoCaptureDeviceInfo.getName();
                    if (name.startsWith("vfw:")) {
                        CaptureDeviceManager.removeDevice(VideoCaptureDeviceInfo);
                int nDevices = 0;
                for (int i = 0; i < 10; i++) {
                    String name = com.sun.media.protocol.vfw.VFWCapture.capGetDriverDescriptionName(i);
                    if (name != null && name.length() > 1) {
                        System.err.println("Found device" + name);
                        System.err.println("Querying device.Please wait....");
                        com.sun.media.protocol.vfw.VFWSourceStream.autoDetect(i);
                        nDevices++;
                VideoCaptureDeviceInfo = (CaptureDeviceInfo) CaptureDeviceManager.getDeviceList(videoFormat).elementAt(0);
                VideoLocator = VideoCaptureDeviceInfo.getLocator();
            return VideoLocator;
        //get audio MediaLocator
        public MediaLocator getAudioLocator() {
            MediaLocator AudioLocator = null;
            Vector AudioCaptureList = null;
            CaptureDeviceInfo AudioCaptureDeviceInfo = null;
            AudioFormat audioFormat = new AudioFormat(AudioFormat.LINEAR);
            AudioCaptureList = CaptureDeviceManager.getDeviceList(audioFormat);
            if (AudioCaptureList.size() > 0) {
                AudioCaptureDeviceInfo = (CaptureDeviceInfo) AudioCaptureList.elementAt(0);
                AudioLocator = AudioCaptureDeviceInfo.getLocator();
                System.out.println("get audio locator");
            } else {
                System.out.println("empty");
                AudioLocator = null;
            return AudioLocator;
        public DataSource getDataSource() {
            try {
                DataSource[] source = new DataSource[2];    //audio 0; video 1;
                source[0] = Manager.createDataSource(getAudioLocator());
                if (isMix) {
                    DataSource MixDataSource = null;
                    source[1] = Manager.createDataSource(getVideoLocator());
                    MixDataSource = Manager.createMergingDataSource(source);
                    return MixDataSource;
                } else {
                    return source[0];
            } catch (Exception ex) {
                System.out.println("---error0---" + ex);
                return null;
        public DataSource getDataSourceByProcessor() {
            StateHelper sh = null;
            DataSource OutDataSource = null;
            DataSource InputSource = null;
            InputSource = getDataSource();
            try {
                cp = Manager.createProcessor(InputSource);
            } catch (IOException ex) {
                System.out.println("---error1---" + ex);
            } catch (NoProcessorException ex) {
                System.out.println("---error2---" + ex);
            sh = new StateHelper(cp);
            if (!sh.configure(10000)) {
                System.out.println("Processor Configured Error!");
                System.exit(-1);
            ContentDescriptor cd = new ContentDescriptor(ContentDescriptor.RAW_RTP);
            cp.setContentDescriptor(cd);
            AudioFormat ulawFormat = new AudioFormat(AudioFormat.ULAW_RTP, 8000.0, 8, 1);
           // change encode to alaw here?
            TrackControl[] tracks = cp.getTrackControls();
            boolean encodingState = false;
            for (int i = 0; i < tracks.length; i++) {
                if (!encodingState && tracks[i] instanceof FormatControl) {
                    if (tracks.setFormat(ulawFormat) == null) {
    tracks[i].setEnabled(false);
    } else {
    encodingState = true;
    //---- ptime set
                   if (isUlaw) {
         try {
         System.out.println("Cambiando la lista de codecs...");
         Codec[] codec = new Codec[3];
         codec[0] = new com.ibm.media.codec.audio.rc.RCModule();
         codec[1] = new com.ibm.media.codec.audio.ulaw.JavaEncoder();
         //codec[2] = new com.ibm.media.codec.audio.ulaw.Packetizer();
         codec[2] = new com.sun.media.codec.audio.ulaw.Packetizer();
         ((com.sun.media.codec.audio.ulaw.Packetizer) codec[2]).setPacketSize(160);
         (tracks[i]).setCodecChain(codec);
         } catch (UnsupportedPlugInException ex) {
         } catch (NotConfiguredError ex) {
    } else {
    tracks[i].setEnabled(false);
    if (!encodingState) {
    System.out.println("Encode error");
    System.exit(-1);
    if (!sh.realize(10000)) {
    System.out.println("Processor Realized Error!");
    System.exit(-1);
    OutDataSource = cp.getDataOutput();
    return OutDataSource;
    //run
    public void start() {
    cp.start();
    //stop
    public void close() {
    cp.close();

    test.java (get outputDatasource form capture.java)
    package siphone.test;
    import java.io.IOException;
    import java.net.InetAddress;
    import javax.media.Format;
    import javax.media.Manager;
    import javax.media.Player;
    import javax.media.PlugInManager;
    import javax.media.control.BufferControl;
    import javax.media.format.UnsupportedFormatException;
    import javax.media.protocol.DataSource;
    import javax.media.protocol.PushBufferDataSource;
    import javax.media.protocol.PushBufferStream;
    import javax.media.rtp.InvalidSessionAddressException;
    import javax.media.rtp.Participant;
    import javax.media.rtp.RTPControl;
    import javax.media.rtp.RTPManager;
    import javax.media.rtp.ReceiveStream;
    import javax.media.rtp.ReceiveStreamListener;
    import javax.media.rtp.SendStream;
    import javax.media.rtp.SendStreamListener;
    import javax.media.rtp.SessionAddress;
    import javax.media.rtp.SessionListener;
    import javax.media.rtp.event.ByeEvent;
    import javax.media.rtp.event.NewParticipantEvent;
    import javax.media.rtp.event.NewReceiveStreamEvent;
    import javax.media.rtp.event.NewSendStreamEvent;
    import javax.media.rtp.event.ReceiveStreamEvent;
    import javax.media.rtp.event.RemotePayloadChangeEvent;
    import javax.media.rtp.event.SendStreamEvent;
    import javax.media.rtp.event.SessionEvent;
    import javax.media.rtp.rtcp.SourceDescription;
    import siphone.decode.AlawRtpDecoder;
    import siphone.device.Capture;
    import siphone.gui.MainFrame;
    * @author kaiser
    public class Dial implements SessionListener, ReceiveStreamListener, SendStreamListener {
        private String ip = null;
        private int TargetPort;
        private int LocalPort;
        private MainFrame mf = null;
        private Capture capture = null;
        private DataSource oDataSource = null;
        private RTPManager rtp = null;
        private SendStream stream = null;
        private Player play = null;
        private Boolean LogStatu = false;
        static private Format AlawRtpFormat;
        public Dial(String ip, String rport, int lport, MainFrame mf) {
            this.ip = ip;
            this.TargetPort = Integer.parseInt(rport);
            this.LocalPort = lport;
            this.mf = mf;
            capture = new Capture(false);
            oDataSource = capture.getDataSourceByProcessor();
        public static void main(String[] args) throws IOException {
            Dial dial = new Dial("192.168.200.40", "40000", 10000, null);
            dial.Init();
            System.in.read();
            dial.stop();
        public synchronized void Init() {
            PushBufferDataSource pushDataSource = (PushBufferDataSource) oDataSource;
            PushBufferStream pushStream[] = pushDataSource.getStreams();
            SessionAddress localAddress, targetAddress;
            try {
                rtp = RTPManager.newInstance();
                rtp.addReceiveStreamListener(this);
                rtp.addSendStreamListener(this);
                rtp.addSessionListener(this);
                //port: TargetPort or LocalPort;
                localAddress = new SessionAddress(InetAddress.getLocalHost(), TargetPort);
                targetAddress = new SessionAddress(InetAddress.getByName(ip), TargetPort);
                rtp.initialize(localAddress);
                rtp.addTarget(targetAddress);
                BufferControl bc = (BufferControl) rtp.getControl("javax.media.control.BufferControl");
                if (bc != null) {
                    bc.setBufferLength(100);
                stream = rtp.createSendStream(oDataSource, 0);
                stream.start();
                capture.start();
                System.out.println("voice starting...........\n");
            } catch (UnsupportedFormatException ex) {
                System.err.println("error0:\n" + ex);
            } catch (InvalidSessionAddressException ex) {
                System.err.println("error1:\n" + ex);
            } catch (IOException ex) {
                System.err.println("error2:\n" + ex);
        //stop
        public void stop() {
            capture.close();
            if (rtp != null) {
                rtp.removeTargets("close session");
                rtp.dispose();
                rtp = null;
            System.out.println("close session...........\n");
        public void update(SessionEvent evt) {
            if (evt instanceof NewParticipantEvent) {
                Participant sPart = ((NewParticipantEvent) evt).getParticipant();
                System.out.print("  - join: " + sPart.getCNAME());
        public void update(ReceiveStreamEvent rex) {
            ReceiveStream rStream = rex.getReceiveStream();
            Participant rPart = rex.getParticipant();
            if (rex instanceof NewReceiveStreamEvent) {
                try {
                    DataSource rData = rStream.getDataSource();
                    RTPControl rcl = (RTPControl) rData.getControl("javax.media.rtp.RTPControl");
                    if (rcl != null) {
                        System.out.print("  - receive RTPControl info | the AudioFormat: " + rcl.getFormat());
                    } else {
                        System.out.print("  - receive RTPControl info");
                    if (rPart == null) {
                        System.out.print(" UNKNOWN");
                    } else {
                        System.out.print("data form " + rPart.getCNAME());
                    play = Manager.createRealizedPlayer(rData);
                    if (play != null) {
                        play.start();
                } catch (Exception ex) {
                    System.out.print("NewReceiveStreamEvent Exception " + ex.getMessage());
                    return;
            } else if (rex instanceof ByeEvent) {
                System.out.print("  - receive bye message: " + rPart.getCNAME() + "   exit");
                stop();
                return;
    }Anyone can tell me how to do?
    Thank you very much!

  • How to encode sql string for SQL Server when using JDBC?

    in code, dynamically generate sql stirng like:
    String sqlstring = "select column from table where column=' " + var + " ' ";
    Question is: if var include char ' , it will cause error becuase ' is reserved by SQL Server for string reference.
    So how to encode string for dynamic sql string? for example, following sql(when var =" I'm tester"):
    select column from table where column like ' I'm tester '
    Edited by: KentZhou on Jun 17, 2009 3:10 PM

    Use PreparedStatement. Use it all the way. It not only saves you from SQL injections, but also eases setting non-standard Java objects like Date and InputStream in a SQL statement.
    Prepare here: [http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html].

  • Anyone know how to encode  video files with 5.1 sound

    So now that TV officially accepts and handles 5.1 sound....
    Does anyone know how to encode their video files to include 5.1 audio?
    (assuming that ones video files contain audio that is 5.1 from the original source)

    Saw this somewhere:
    Ok, I managed to get Dolby Digital from a Video file. The steps are very easy:
    Create an mp4 from your DVD or other source with Handbrake or Visual Hub - Audio Settings are not important
    If you are ripping a DVD then open Mac the Ripper, choose Chapter extraction, open streams and select the Audio File you want to be extracted
    You will now need Quicktime Pro
    Open both files (the mp4 and the ac3) in Quicktime. Copy the ac3 stream and paste it to the mp4 file
    Save the file as a MOV movie
    Import it in iTunes
    That was it!!!
    I am now trying to figure out how to extract ac3 audio from mkv files...

  • How to encode primitive type  in JAVA

    who can give me some documents that clarify how to encode primitve type ,or directly clarify in your words. thanks!

    the rule is : 1 is encoded in binary string :
    0000 0000 0000 0000 0000 0000 0000 0001
    -1 is encoded in binary string:
    1111 1111 1111 1111 1111 1111 1111 1111

  • How to encode a certificate to base64BinaryFormat

    Hi all.
    I need to use WS- security in my soap message which needs my X509 certificate to be encoded in base64Binary format. can anyone suggest me how to encode a certificate to base64Binary format.
    Thanks
    Vignesh

    Lanlani wrote:
    But still the output returns a question mark instead of the é and a square instead of the é respectively.And how are you determining that? Bear in mind that the tool you use for looking at the output may also have charset encoding problems.

  • How to encode...

    Could any one please tell me how to encode
    sql = "select * from all_tables" to "select%20*%20from%20all_tables"
    I want to use URLEncoder.encode(String sql, String method). But I don't know the name of the method. Thank you in advance.
    -myaol

    As the API documentation says: "The recommended encoding scheme to use is UTF-8." So:URLEncoder.encode(sql, "UTF-8");

Maybe you are looking for

  • How to import bookmarks and address book from another laptop?

    I have another laptop that has my bookmarks and address book on it. How can I import this to my new laptop? The other laptop also uses Firefox as its browser.

  • ChaRM External Reference Number Field

    Hi In ChaRM, we have used external reference number field for information. When a ChaRM CR is created, the requester fills required information in the field. In Normal Correction, this information is not automatically taken from the CR document to th

  • How do i change the search engine?

    i just wanna know how to change the search engine

  • URGENT: REP-1249: There exist uncompiled program unit(s).

    Hi all, We just had a problem in our production environment one report suddently started giving the following error: Enter Password: REP-0069: Internal error REP-57054: In-process job terminated:Terminated with error: REP-1249: There exist uncompiled

  • Connecting to USB connected printer via LPD

    Hi there, Does anyone know if you can access a USB attached printer using the LPD protocol? I cannot find this in the Time Capsule documentation. I'm helping a Yosemite user where Bonjour is not working and thus the USB connected printer is not being