Add gst-concat-tests.sh
[experiments/gstreamer.git] / shell / gst-concat-tests.sh
1 #!/bin/sh
2
3 set -e
4 set -x
5
6 FILE1=sample_440hz.webm
7 FILE2=sample_880hz.webm
8
9 # This pipeline works fine
10 #gst-launch-1.0 \
11 #  concat name=c ! videoconvert ! videoscale ! autovideosink \
12 #  videotestsrc num-buffers=100 ! c. \
13 #  videotestsrc num-buffers=100 pattern=ball ! c.
14  
15 # Here only the video from the first stream is shown
16 gst-launch-1.0 \
17   concat name=c ! decodebin ! autovideosink \
18   filesrc location="$FILE1" ! c. \
19   filesrc location="$FILE2" ! c.
20
21 # This pipeline using one decoder per filesrc works fine
22 gst-launch-1.0 \
23   concat name=c ! videoconvert ! videoscale ! autovideosink \
24   filesrc location="$FILE1" ! matroskademux ! vp9dec ! c. \
25   filesrc location="$FILE2" ! matroskademux ! vp9dec ! c.
26
27
28 # These pipelines work fine, but should a streamsynchronizer be added?
29 # And if so, where?
30 gst-launch-1.0 \
31   concat name=video_concat ! autovideosink \
32   concat name=audio_concat ! autoaudiosink \
33   filesrc location="$FILE1" ! decodebin name=d1 \
34   filesrc location="$FILE2" ! decodebin name=d2 \
35   d1. ! video/x-raw ! queue ! video_concat. \
36   d1. ! audio/x-raw ! queue ! audio_concat. \
37   d2. ! video/x-raw ! queue ! video_concat. \
38   d2. ! audio/x-raw ! queue ! audio_concat.
39
40 gst-launch-1.0 -e \
41   mp4mux name=mp4 ! filesink location=out.mp4 \
42   concat name=video_concat ! videoconvert ! x264enc tune=4 ! mp4. \
43   concat name=audio_concat ! audioconvert ! voaacenc ! mp4. \
44   filesrc location="$FILE1" ! decodebin name=d1 \
45   filesrc location="$FILE2" ! decodebin name=d2 \
46   d1. ! video/x-raw ! queue ! video_concat. \
47   d1. ! audio/x-raw ! queue ! audio_concat. \
48   d2. ! video/x-raw ! queue ! video_concat. \
49   d2. ! audio/x-raw ! queue ! audio_concat.