-
Notifications
You must be signed in to change notification settings - Fork 17
/
mp4-file-to-pravega-mp4mux.sh
47 lines (44 loc) · 1.45 KB
/
mp4-file-to-pravega-mp4mux.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
#
# Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
set -ex
ROOT_DIR=$(readlink -f $(dirname $0)/..)
pushd ${ROOT_DIR}/gst-plugin-pravega
cargo build
ls -lh ${ROOT_DIR}/target/debug/*.so
export GST_PLUGIN_PATH=${ROOT_DIR}/target/debug:${GST_PLUGIN_PATH}
# log level can be INFO, DEBUG, or LOG (verbose)
export GST_DEBUG=pravegasink:DEBUG,basesink:INFO
export RUST_BACKTRACE=1
PRAVEGA_SCOPE=${PRAVEGA_SCOPE:-examples}
PRAVEGA_STREAM=${PRAVEGA_STREAM:-mp4-1}
ALLOW_CREATE_SCOPE=${ALLOW_CREATE_SCOPE:-true}
PRAVEGA_CONTROLLER=${PRAVEGA_CONTROLLER:-127.0.0.1:9090}
VIDEO_FILE=${VIDEO_FILE:-/file/path/name.mp4}
FPS=25
KEY_FRAME_INTERVAL=$((1*$FPS))
gst-launch-1.0 \
-v \
filesrc location=${VIDEO_FILE} \
! qtdemux \
! h264parse \
! avdec_h264 \
! videoconvert \
! x264enc key-int-max=${KEY_FRAME_INTERVAL} tune=zerolatency speed-preset=medium \
! queue \
! timestampcvt input-timestamp-mode=start-at-current-time \
! mp4mux streamable=true fragment-duration=1 \
! fragmp4pay \
! pravegasink \
stream=${PRAVEGA_SCOPE}/${PRAVEGA_STREAM} \
allow-create-scope=${ALLOW_CREATE_SCOPE} \
controller=${PRAVEGA_CONTROLLER} \
keycloak-file=\"${KEYCLOAK_SERVICE_ACCOUNT_FILE}\" \
seal=false sync=false timestamp-mode=tai