forked from nicolargo/gstpipelinearena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivetestvideoencoder.sh
executable file
·31 lines (26 loc) · 1.26 KB
/
livetestvideoencoder.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Script to test video codecs (live)
# Nicolargo - http://blog.nicolargo.com/gstreamer
CODEC1="ffenc_mpeg4" ; CODEC1_OPT="bitrate=128000"
CODEC2="xvidenc" ; CODEC2_OPT="bitrate=128000 profile=145"
#CODEC1="vp8enc" ; CODEC_OPT1="max-latency=1 mode=cbr"
# Compare two codecs (CODEC1 vs CODEC2) and also vs source
gst-launch -tv autovideosrc ! videoscale ! videorate \
! "video/x-raw-yuv,width=(int)320,height=(int)240,framerate=(fraction)15/1" \
! tee name="source" \
! tee name="codec1" \
! queue ! cairotextoverlay text="$CODEC2" shaded-background=true \
! $CODEC2 $CODEC_OPT2 ! decodebin ! autovideosink \
codec1. \
! queue ! cairotextoverlay text="$CODEC1" shaded-background=true \
! $CODEC1 $CODEC_OPT1 ! decodebin ! autovideosink \
source. \
! queue ! cairotextoverlay text="Source" shaded-background=true ! autovideosink
# Compare codec vs source
gst-launch -tv autovideosrc ! videoscale ! videorate \
! "video/x-raw-yuv,width=(int)320,height=(int)240,framerate=(fraction)15/1" \
! tee name="source" \
! queue ! cairotextoverlay text="$CODEC1" shaded-background=true \
! $CODEC1 $CODEC_OPT1 ! decodebin ! autovideosink \
source. \
! queue ! cairotextoverlay text="Source" shaded-background=true ! autovideosink