Menu

RTSP DataSource

user
lefish
2008-12-09
2013-05-09
  • lefish

    lefish - 2008-12-09

    hello, all, i have wrote a DATASource for RTSP stream, but it doesn't work well on video and audio.
    Anybody can help me? here is my code:

    package com.omnividea.media.protocol.rtsp;

    import javax.media.MediaLocator;
    import javax.media.protocol.Positionable;

    public class DataSource extends com.omnividea.media.protocol.DataSource
            implements Positionable {
        private String urlString = "";

        public DataSource() {
            super();
        }

        public DataSource(MediaLocator ml) {
            super(ml);
            setLocator(ml);
        }

        public void setLocator(MediaLocator ml) {
            super.setLocator(ml);
            try {
                urlString = ml.toString(); // Old version
                System.out.println("RTSP source: " + urlString);
            } catch (Exception e) {
                System.out.println("Bad URL: " + ml);
            }
        }

        public String getUrlName() {
            return urlString;
        }

    }

    Thanks, all

     
    • lefish

      lefish - 2008-12-09

      the video and audio are very jerky?
      I tried to change buffer length, but no effect.

              BufferControl bc = (BufferControl) proc
                      .getControl("javax.media.control.BufferControl");
              if (bc != null) {
                  bc.setBufferLength(BufferControl.MAX_VALUE);
                  bc.setMinimumThreshold(10000);

              }
      Regards,
      lefish

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.