ffprobe get video volume of time interval
by blumenwesen from LinuxQuestions.org on (#6FQTN)
Try using ffprobe to determine the average volume of a video section.
Judging by my search, it is possible only with amovie and not with volumedetect.
As an example using ffmpeg:
Code:$ ffmpeg -hide_banner -ss 00:00:10.0 -to 00:00:15.0 -i "/DIR/FILE.mp4" -af volumedetect -vn -f null - 2>&1 | awk '/mean_volume:/ {print $5}'
# output:
# -19.4An error occurs when the start time "75%+#1" has been set:
Code:$ ffprobe -v error -hide_banner -read_intervals 75%+#1 -show_entries frame=pkt_pts_time:frame_tags=lavfi.astats.Overall.RMS_level -of default=noprint_wrappers=1:nokey=1 \
-f lavfi -i amovie="/FOLDER/FILE.mp4",asetnsamples=$(ffprobe -i "/DIR/FILE.mp4" -v error -hide_banner -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1),astats=metadata=1:reset=1
# output:
# Could not seek to position 75000000: Invalid argument
# Could not read packets in interval id:0 start:75 end:+#1Is there another more effective way to define the start and end time for the volume output, as a variable in time or in seconds?
thanks for help
Judging by my search, it is possible only with amovie and not with volumedetect.
As an example using ffmpeg:
Code:$ ffmpeg -hide_banner -ss 00:00:10.0 -to 00:00:15.0 -i "/DIR/FILE.mp4" -af volumedetect -vn -f null - 2>&1 | awk '/mean_volume:/ {print $5}'
# output:
# -19.4An error occurs when the start time "75%+#1" has been set:
Code:$ ffprobe -v error -hide_banner -read_intervals 75%+#1 -show_entries frame=pkt_pts_time:frame_tags=lavfi.astats.Overall.RMS_level -of default=noprint_wrappers=1:nokey=1 \
-f lavfi -i amovie="/FOLDER/FILE.mp4",asetnsamples=$(ffprobe -i "/DIR/FILE.mp4" -v error -hide_banner -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1),astats=metadata=1:reset=1
# output:
# Could not seek to position 75000000: Invalid argument
# Could not read packets in interval id:0 start:75 end:+#1Is there another more effective way to define the start and end time for the volume output, as a variable in time or in seconds?
thanks for help