LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-20-2023, 08:23 AM   #1
blumenwesen
Member
 
Registered: Jan 2022
Posts: 64

Rep: Reputation: 0
ffprobe get video volume of time interval


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 "FILE.mp4" -af volumedetect -vn -f null - 2>&1 | awk '/mean_volume:/ {print $5}'
# output:
# -19.4
An 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="FILE.mp4",asetnsamples=$(ffprobe -i "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:+#1
Is 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

Last edited by blumenwesen; 10-22-2023 at 04:39 PM.
 
Old 10-21-2023, 04:45 PM   #2
blumenwesen
Member
 
Registered: Jan 2022
Posts: 64

Original Poster
Rep: Reputation: 0
I've picked the scenes out now, but after the output the program does not end.
Can the script be adjusted so that it does not wait until the file has run through completely?

Code:
ffprobe -v error -hide_banner -show_entries frame=pkt_pts_time:frame_tags=lavfi.astats.Overall.RMS_level -of default=noprint_wrappers=1:nokey=1 \
-f lavfi amovie="FILE.mp4",astats=metadata=1:reset=1,aselect="between(t\,10\,10.1)"
# output
# -27.291128
# -26.758702
# -26.948367
# -26.799456
# ... after endless ſĦ  ��   ᕦ_…-·@    ��   ĦŊ waiting time ... exit

Last edited by blumenwesen; 10-21-2023 at 04:47 PM.
 
Old 10-22-2023, 04:37 PM   #3
blumenwesen
Member
 
Registered: Jan 2022
Posts: 64

Original Poster
Rep: Reputation: 0
Seems like I'm the only expert here, so I helped myself again.
Should have replaced 'aselect="between(t\,10\,10.1)"' with 'atrim=1000:1002'.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Redirect FFPROBE output to filr mackowiakp Linux - Newbie 2 07-14-2020 06:05 AM
[SOLVED] Using ffprobe - getting specific information for use in a script GPGAgent Linux - Newbie 16 09-09-2019 01:57 PM
Using ffprobe to sort videos Entropy1024 Linux - Newbie 2 04-13-2018 09:50 AM
Why do some tools (e.g. ffprobe) split their output between sdtout and stderr ? markus-n Linux - General 6 01-07-2018 04:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration