Fully working

parent b3f2b628
#!/bin/bash #!/bin/bash
btime_=`grep btime /proc/stat | awk '{print $2}'` btime_=`grep btime /proc/stat | awk '{print $2}'`
utime_=`awk '{print $1}' /proc/uptime` utime_=`awk '{print $1}' /proc/uptime`
btime_utime_=`echo "${btime_?} + ${utime_?}" | bc -l` btime_utime_=`echo "${btime_?} + ${utime_?}" | bc -l`
...@@ -111,6 +111,7 @@ tees="" ...@@ -111,6 +111,7 @@ tees=""
hlsselect="" hlsselect=""
streammap="" streammap=""
gpus=0 gpus=0
injectf=""
for ftype in mp4 hls for ftype in mp4 hls
do do
case $ftype in case $ftype in
...@@ -171,6 +172,11 @@ do ...@@ -171,6 +172,11 @@ do
tees="$tees|" tees="$tees|"
fi fi
tees="$tees [select=\'v:$((num-1)),a:$((num-1))\':f=mp4:movflags=+faststart]${scale}_${outf}" tees="$tees [select=\'v:$((num-1)),a:$((num-1))\':f=mp4:movflags=+faststart]${scale}_${outf}"
if [ x"$injectf" == "" ] ; then
injectf="${scale}_${outf}"
else
injectf="$injectf ${scale}_${outf}"
fi
elif [ "$ftype" == "hls" ] ; then elif [ "$ftype" == "hls" ] ; then
if [ x"$hlsselect" != x"" ] ; then if [ x"$hlsselect" != x"" ] ; then
hlsselect="$hlsselect," hlsselect="$hlsselect,"
...@@ -190,7 +196,7 @@ do ...@@ -190,7 +196,7 @@ do
done done
if [ X"$scalestring" != X"" ] ; then if [ X"$scalestring" != X"" ] ; then
if [ x"$HLS" == "y" ] ; then if [ x"$HLS" == x"y" ] ; then
if [ x"$tees" != x"" ] ; then if [ x"$tees" != x"" ] ; then
tees="$tees|" tees="$tees|"
fi fi
...@@ -201,6 +207,12 @@ if [ X"$scalestring" != X"" ] ; then ...@@ -201,6 +207,12 @@ if [ X"$scalestring" != X"" ] ; then
tees="${tees}${HLSDIR}/${outf}/stream_%v.m3u8" tees="${tees}${HLSDIR}/${outf}/stream_%v.m3u8"
fi fi
ffmpeg $YES -i $inf -filter_complex "[0:v]split=${num}${splits};$scalestring" $vmaps $amaps -f tee "$tees" ffmpeg $YES -i $inf -filter_complex "[0:v]split=${num}${splits};$scalestring" $vmaps $amaps -f tee "$tees"
echo ffmpeg $YES -i $inf -filter_complex "[0:v]split=${num}${splits};$scalestring" $vmaps $amaps -f tee "$tees"
for f in $injectf
do
spatialmedia -i -s left-right -m equirectangular ${scale}_${outf} injected_${outf}
done
fi fi
......
...@@ -5,13 +5,30 @@ else ...@@ -5,13 +5,30 @@ else
com="$1" com="$1"
fi fi
cd `pwd` cd `pwd`
EQUI="n"
case $com in
equi|equiall|equimp4|equihls)
EQUI="y"
;;
esac
for vl in VID_*_00_*.insv for vl in VID_*_00_*.insv
do do
vout=`echo $vl | sed -e "s/\.insv/\_VR\_180\_LR\.mp4/"` vout="$(echo $vl | sed -e 's/\.insv//' | sed -e 's/\.mp4//' )_VR_180_LR.mp4"
echo "--------------------------------------" echo "--------------------------------------"
echo "creating: $vout" echo "creating: $vout"
echo "LEFT: $vl" echo "LEFT: $vl"
vr=`echo $vl | sed -e 's/\_00\_/\_10\_/'` if [ x"$EQUI" == x"y" ] ; then
echo "RIGHT: $vr"
Insta360_EVO_to_VR $com $vl $vr $vout vr=`echo $vl | sed -e 's/\_00\_/\_10\_/'`
echo "RIGHT: $vr"
echo Insta360_EVO_to_VR $com $vl $vr $vout
Insta360_EVO_to_VR $com $vl $vr $vout
else
echo Insta360_EVO_to_VR $com $vl $vout
Insta360_EVO_to_VR $com $vl $vout
fi
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment