فهرست منبع

extracted parameters for segment-video script

Harlan Iverson 6 سال پیش
والد
کامیت
a4b8d91a3a
2فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 2 0
      scripts/go.sh
  2. 15 1
      scripts/import/segment-video.sh

+ 2 - 0
scripts/go.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+FLAVOR="raspi-ubuntu" # or mac or windows or x86-ubuntu or tinkerboard-ubuntu
+
 
 # Add user to video group for access to rasppi cam
 sudo usermod -aG video $USER

+ 15 - 1
scripts/import/segment-video.sh

@@ -29,4 +29,18 @@
 
 # rpi omx:  https://signal-flag-z.blogspot.com/2017/05/raspberry-pix264ffmpeg.html
 
-avconv -i $1 -c copy -flags +cgop -g 30 -hls_time 2 -hls_list_size 100000 -bsf h264_mp4toannexb out.m3u8
+VIDEO_PATH="$1"
+
+VIDEO_PATH_PREFIX=$(echo "$VIDEO_PATH" | cut -f 1 -d '.')
+PLAYLIST_PATH="$VIDEO_PATH_PREFIX.m3u8"
+
+avconv \
+  -i $VIDEO_PATH \
+   -c copy \
+   -flags \
+     +cgop \
+     -g 30 \
+     -hls_time 2 \
+     -hls_list_size 100000 \
+     -bsf h264_mp4toannexb \
+   $PLAYLIST_PATH