Gstreamer Android - Take Snapshot from Video

Liuting Du liuting at evercam.io
Fri Apr 10 06:25:12 PDT 2015


Hi,

I am developing an Android RTSP player using Gstreamer 1.0. The basic
requirement is to make the player load RTSP stream fast and and also allow
the user to take snapshots from the video and save it as an image file,
without influencing the video stream.

I forked the demo app and made some small changes on the demo code to meet
the basic requirements. This is the forked repo:
https://github.com/liutingdu/gst-launch-remote

The pileline I am using is:

rtspsrc protocols=4 location=rtsp://172.16.0.21:9021/h264/ch1/main/av_stream
user-id=admin user-pw=12345 latency=0 drop-on-latency=1 ! decodebin !
videoconvert ! autovideosink

While the video is playing,  I tried to launch a new pipeline for taking
snapshot using filesink:

rtspsrc protocols=4 location=rtsp://172.16.0.21:9021/h264/ch1/main/av_stream
user-id=admin user-pw=12345 latency=0 drop-on-latency=1 ! jpegenc !
filesink location=/sdcard/snapshot.jpeg

It saves the snapshot image but always interrupt the video that is
currently playing, tried to launch the pileline in a new Java thread but
got no luck.

After searching around, there seems are some possible approaches:

1. Use the 'tee' plugin to attach and detach the filesink

    rtspsrc ...... ! decodebin ! tee name=t ! queue ! videoconvert !
autovideosink t. ! queue ! jpegenc ! filesink location=/snapshot.jpeg

    But by simply launching this pipeline, it doesn't seem to be working.

    Maybe it requires making lots of changes on the C code to dynamically
attach new pipeline?

2. I've got a suggestion from someone who knows about Gstreamer, to use
'tee' with 'intervideosink' and 'intervideosrc'.

    But the 'intervideosink' element is not installed on the Android
distribution at all?

Then I am stuck with all approaches.. so the questions are:

1. Is any of the approaches listed above will definitely work and is
leading me to the right direction?
2. If any of them will work, what are the necessary changes that need to be
made, and is there any detailed document or sample available somewhere?
3. If none of them is correct, any suggestions?

I am completely new to C and Gstreamer, any help would be highly
appreciated.

Thanks in advance,

Liuting
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-android/attachments/20150410/9b0143e6/attachment.html>


More information about the gstreamer-android mailing list