teltek / Galicaster

The Galicaster Project is an open initiative to provide flexible, state-of-the-art solutions for recording educational multimedia contents like lectures and conferences
galicaster.teltek.es
Other
35 stars 31 forks source link

avimux does not work for the RTP bin #95

Open esnalabu opened 10 years ago

esnalabu commented 10 years ago

Using Galicaster 1.3.1 and an Axis h264 camera.

I've been trying to set avimux in config for the rtp bin, but Galicaster fails when starting to record. The documentation tells me to use "videomux = avimux", but the source in the rtp.py bin does not have "videomux", but "muxer".

http://wiki.teltek.es/display/Galicaster/RTP+device+module https://github.com/teltek/Galicaster/blob/1.3.x/galicaster/recorder/bins/rtp.py

This is what the error logged using rtp bin and muxer = avimux:

2014-03-13 14:18:47,593 ERROR   recorder        GStreamer encountered a general stream error. (gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:galicaster_recorder/galicaster+recorder+bins+rtp+GCrtp:Grab1/GstBin:bin2/GstRTSPSrc:gc-rtp-src/GstUDPSrc:udpsrc1:
streaming task paused, reason not-negotiated (-4)) 
esnalabu commented 10 years ago

I managed to use avimux as default for the bin by moving the gc-rtp-dec before the tee name=gc-rtp-tee:

pipestr = (' rtspsrc name=gc-rtp-src ! gc-rtp-depay ! gc-rtp-videoparse ! gc-rtp-dec ! queue ! '
           ' tee name=gc-rtp-tee  ! queue ! xvimagesink async=false sync=false qos=false name=gc-rtp-preview '
           ' gc-rtp-tee. ! queue ! valve drop=false name=gc-rtp-valve ! '
           ' queue ! gc-rtp-muxer name=gc-rtp-mux ! queue ! filesink name=gc-rtp-sink async=false')
rubenrua commented 10 years ago

But if you move the gc-rtp-dec before the tee, the bitrate of the recorded video is going to be very high. Because you are going to record the raw video.

Take a look to rtpraw if you are interested in reencoding the video stream.

edmore commented 9 years ago

Hi,

@esnalabu did you manage to get the Axis camera to work with avimux or you had to use another bin?

esnalabu commented 9 years ago

Hi, We are using it and it's stable, but i'm fairly certain we could do it do it different/smarter. But it works pretty well. We had issues with rtpraw, so we ended up with using avimux like this:

pipestr = ("rtspsrc debug=false name=gc-rtp-src ! "
           "identity single-segment=true ! "
           "rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! "
           "tee name=gc-rtp-tee ! queue leaky=1 ! "
           "xvimagesink async=false sync=false qos=false name=gc-rtp-preview "
           "gc-rtp-tee. ! queue ! valve drop=false name=gc-rtp-valve ! "
           "videorate skip-to-first=true ! "
           "x264enc quantizer=22 speed-preset=2 profile=1 ! queue ! avimux ! "
           "filesink name=gc-rtp-sink async=false ")

This gives us bitrates like this: Camera:

Overall bit rate                         : 1 713 Kbps
Nominal bit rate                         : 2 048 Kbps

Presentation:

Overall bit rate                         : 803 Kbps
Nominal bit rate                         : 2 048 Kbps

Since we've doing this with our own rtpvideouib-bin, I haven't tested and do not know if the original issue with the rtp-bin has been resolved.

edmore commented 9 years ago

Okay thanks for the response. We are just testing mp4mux at the moment and will consider your solution if that is not successful.