rtsp-server serves slowly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

rtsp-server serves slowly

Wes Miller
Administrator
Hi All,

Using the example code in rtsp-server  .../examples/test-video.c as a template, I have this partially working pipeline:

      gst_rtsp_media_factory_set_launch( factory,
      "( "
        "v4l2src "
        " ! videorate "
        " ! ffmpegcolorspace  "
        " ! video/x-raw-yuv,width=1280,framerate=30/1 "
        " ! ffenc_mpeg4 "
        " ! rtpmp4vpay name=pay0 pt=96  "
        "alsasrc device=\"hw:0,0\" "
        " ! audio/x-raw-int,rate=16000,channels=1,depth=16 "
        " ! audioresample "
        " ! audioconvert "
        " ! alawenc ! rtppcmapay name=pay1 pt=97 "
      ")"
   );


The video has a 4 second delay to get to 127.0.0.1 (using totem) and the audio turns everything into occasional clicks.  Everything video starts up slowly and seems to be sampling way too slow.  Wiggled fingers are more blur than fingers.  

If I just connect the camera to autovideosink I get better video quality, less blur though it is still there.

   gst-launch-0.10 v4l2src ! videorate  ! ffmpegcolorspace ! video/x-raw-yuv,width=1280,framerate=30/1  ! autovideosink

And if I hook up the microphone directly, I get sound but it is delayed about a half second:

     gst-launch-0.10 -v alsasrc device="hw:0,0" ! audio/x-raw-int,rate=16000,width=16,depth=16 ! audioresample ! audioconvert ! alsasink

     /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 200000
     /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 10000
     /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=
     (boolean)true, width=(int)16, depth=(int)16, rate=(int)16000, channels=(int)1


Sorry, I don't know the specs on the webcam, the maker doesn't seem to want to share in his included docs.

The rtsp-server window says:

** (lt-test-video:13312): WARNING **: 0x97aa000: got warning Can't record audio fast enough (gstbaseaudiosrc.c(822): gst_base_audio_src_create (): /GstPipeline:media-pipeline/GstBin:bin0/GstAlsaSrc:alsasrc0:
Dropped 4000 samples. This is most likely because downstream can't keep up and is consuming samples too slowly.)

Any suggestions for speeding up audio and video and getting better quality to flow through the connection?

Thanks,

Wes
Reply | Threaded
Open this post in threaded view
|

Re: rtsp-server serves slowly

Wes Miller
Administrator
A couple of minor updates.  Adding a queue to the audio pipe fixes the "all sound is a click" problem.

The audio and video are pretty well sync-ed, but the delay is still huge, up to 5 seconds and that just to the loopback!  I still don't always get transmission to another computer to work.

I have a new camera on the way, one that is supposedly better behaved with Linux.  Will also try with Ubuntu instead of Fedora.

Any help, please?

Wes