Hello, I have question about simple cutting/slice a video. I am working with a bash script, which should simply randomly slice one video in a loop function: ################################################################################################### function portion(){ durationInput=$(ffprobe -v error -hide_banner -i $1 -show_format | grep duration | cut -d= -f2);\ r=$RANDOM;\ ran=$(printf '%.2f' $(echo "scale=2; $r/32768" | bc ));\ start=$(printf '%.2f' $(echo "scale=2; $durationInput*($ran*0.9)" | bc ));\ duration=$(printf '%.2f' $(echo "scale=2; ($ran*4)+2" | bc ));\ filename=${1%%.*}_portion_$c.mp4 ffmpeg -i "$1" -ss $start -t $duration -c:v copy -c:a copy -y $filename } ################################################################################################### in=GoogleMaps_.mp4 for ((c=1; c<=10; c++)); do portion $in done When I am just copying the video codec sometimes the video is missing and I just get a file with sound. If I decode like with -c:v libx264 it works probably what could be the reason? Thanks. :) denis
Am So., 28. Feb. 2021 um 12:32 Uhr schrieb Denis Połeć <denis.polec@gmail.com>:
I have question about simple cutting/slice a video.
I am working with a bash script
Instead please test (only) the ffmpeg command line that fails or does not work as expected, and post the command line including the complete, uncut console output here, do not use -hide_banner. Please remember to test current FFmpeg git head before reporting issues or asking questions here. Carl Eugen
participants (2)
-
Carl Eugen Hoyos -
Denis Połeć