How to segment seek in dynamic pipeline
xmufzy
xmufzy at foxmail.com
Wed Aug 26 15:23:28 UTC 2020
Hello, I'm a newbie for Gstreamer
I need implement a pipeline for join server segment of video to one file,
the pipeline like this
Stage0:
pipeline:
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --> x264enc -->
filesink
```cpp
g_assert(gst_element_seek (demux_bg,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE| GST_SEEK_FLAG_SEGMENT
|GST_SEEK_FLAG_FLUSH| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 3 * GST_SECOND,
GST_SEEK_TYPE_SET, (3
+g_elements.stage_dua[0])*GST_SECOND)==true);
```
Stage1:
pipeline change :
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
--> mixer -->
x264enc --> filesink
filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------/
```cpp
g_assert(gst_element_seek (g_elements.demux_bg,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE |
GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 5 * GST_SECOND,
GST_SEEK_TYPE_SET, (5+g_elements.stage_dua[1]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_fga,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE|
GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 1 * GST_SECOND,
GST_SEEK_TYPE_SET, (1+g_elements.stage_dua[1]) *
GST_SECOND)==true);
```
Stage2:
pipeline change :
filesrc(backgroup.mp4) --> qtdemux --> h264dec --> queue --\
--> mixer -->
x264enc --> filesink
filesrc(fga.mp4) --> qtdemux --> h264dec -->queue ---------//
filesrc(fgb.mp4) --> qtdemux --> h264dec -->queue ---------/
```cpp
g_assert(gst_element_seek (g_elements.demux_bg,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE
|GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 2 * GST_SECOND,
GST_SEEK_TYPE_SET, (2+g_elements.stage_dua[2]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_fga,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE
|GST_SEEK_FLAG_SEGMENT| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 6 * GST_SECOND,
GST_SEEK_TYPE_SET, (6+g_elements.stage_dua[2]) *
GST_SECOND)==true);
g_assert(gst_element_seek (g_elements.demux_shoe,
1.0, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_ACCURATE| GST_SEEK_FLAG_SEGMENT
| GST_SEEK_FLAG_TRICKMODE),
GST_SEEK_TYPE_SET, 9 * GST_SECOND,
GST_SEEK_TYPE_SET, (9+g_elements.stage_dua[2]) *
GST_SECOND)==true);
The pipeline can't work.
Thank you.
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list