recording videos from rtsp: How to sent EOS to unplugged GstBin?

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

recording videos from rtsp: How to sent EOS to unplugged GstBin?

bamboosso
Hello,

I know how to unplug part of pipeline using: gst_pad_set_blocked_async thanks to this post: http://lists.freedesktop.org/archives/gstreamer-devel/2010-November/029283.html

So I created two Bins: one fake [queue->fakesink] one recording [queue->h264parse->mp4mux->filesink].
Now I can easly unplug fake one and replace with recording. Video file increase size in bytes so i assume its recording.

Unfortunately I don't know, how to post EOS message when I unplug recording_bin

Part of code: https://dl.dropbox.com/u/46679399/problem.cpp or problem.cpp

I tryed:
1. block pad -> unlink recording_bin -> send EOS to recording_bin -> set recording_bin to STATE_NULL ->remove recording bin from pipeline -> unblock pad
RESULT unplayable stream
2. block pad -> unlink recording_bin -> send EOS to recording_bin -> remove recording bin from pipeline -> unblock pad
RESULT unplayable stream, no cleaning from recording bin elements
3. block pad -> unlink recording_bin -> send EOS to recording_bin -> set recording_bin to STATE_NULL -> -> unblock pad
RESULT unplayable stream
4. create recording_bin as GstPipeline -> attach bus_call to recording_bin pipeline
RESULT no EOS message found
5. attach bus_call to GstBin->child_bud
RESULT silent

I think, that when I disconnect bin from pipeline it is not clocked any more, so no messages are going threw bin. I have continous playback in background so I cant stop whole pipeline and initialize it from begining.

gstreamer version: 0.10 [as new as possible] compiled from sources on ubuntu 10.4 lucid for arm (freescale iMX53)

I need it really bad...

Thanks for help in advance.

Regards
 Maciej Łaski
Reply | Threaded
Open this post in threaded view
|

Re: recording videos from rtsp: How to sent EOS to unplugged GstBin?

bamboosso
OK, I have alanyzed this GST_BOILERLATE and the solution is there.

But i Have different problem with rtsp and recording.

Using pipeline I got mp4 file with stream:

gst-launch -e rtspsrc location=rtsp://192.168.0.120:554/snl/live/1/2/Ux/sido=-Ux/sido= ! gstrtpjitterbuffer ! rtph264depay ! legacyh264parse access-unit=true output-format=0 ! mp4mux ! filesink location=camera.mp4

And i _CAN_ play it using gstreamer pipeline:
gst-launch filesrc location=camera.mp4 ! qtdemux name=demux demux.video_00 ! queue ! h264parse ! mfw_vpudecoder ! autovideosink

But playbin2, totem, mediaplayer classic (on windows) is unable to play stream?

What is missing in this file?

Totem output: https://dl.dropbox.com/u/46679399/totem_output.txt or totem_output.txt
Recorded file: https://dl.dropbox.com/u/46679399/camera.mp4 or camera.mp4

Any advices.

Thanks
 Maciej Łaski