I'm using FFprobe to get MAX_level stats from audio.
Problem
This ffprobe command use my_audio_file.mp3 as input file to generate MAX_level for every frame.
ffprobe -f lavfi -i amovie=my_audio_file.mp3,astats=metadata=1:reset=1 -show_entries frame=pkt_pts_time:frame_tags=lavfi.astats.Overall.MAX_level -of csv=p=0 1> my_output_log.txt
When I execute it, I get generated my_output_log.txt file with frame time and MAX_level value for this frame in the csv format. (1 column - frame time | 2 column - MAX_level for this frame)
You can see that MAX_level (2nd column) value generates every 0,026122
seconds. So, if you count all frames for 0 second, you got 39 frames. Input file duration = 3m 20s, then I get output file with +-8000 MAX_level values, but I need only 200 MAX_level values.
0.000000,0.0000000.026122,0.0000000.052245,0.0000000.078367,0.0000000.104490,0.0000000.130612,0.0000000.156735,0.0000000.182857,0.0000000.208980,0.0000000.235102,1.0000000.261224,5792.0000000.287347,9111.0000000.313469,9847.0000000.339592,9208.0000000.365714,8498.0000000.391837,9649.0000000.417959,12201.0000000.444082,11763.0000000.470204,9013.0000000.496327,9048.0000000.522449,8826.0000000.548571,9932.0000000.574694,9382.0000000.600816,9013.0000000.626939,8052.0000000.653061,8317.0000000.679184,5445.0000000.705306,6925.0000000.731429,7136.0000000.757551,7029.0000000.783673,7610.0000000.809796,9199.0000000.835918,8443.0000000.862041,7847.0000000.888163,6878.0000000.914286,7385.0000000.940408,9294.0000000.966531,8105.0000000.992653,8620.0000001.018776,7286.000000<38 frames>2.011429,4573.0000002.037551,5155.0000002.063673,4527.000000<etc>
I want to generate 1 frame for every second to optimize this process,
because I execute this command on the android device which generates it 17 seconds.
The output should be like this:
0.000000,0.0000001.018776,7286.0000002.011429,4573.0000003.004082,9935.0000004.022857,6132.000000<frame per second>200.012457,1002.000000
Question
How can I change FPS to 1 to get MAX_level value for every second?You can modify or use another ffprobe command to get correct result.