[FFmpeg-user] RETRIEVE FRAME RATE WITH DECIMAL VALUE
Ferdi Scholten
ferdi at sttc-nlp.nl
Fri Nov 8 02:18:31 EET 2024
On 07-11-2024 21:16, Hervé ANSELME wrote:
> Hi,
>
> using ffprobe release 6.1, I can retrieve the frame rate of a film with the following command :
>
> ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of default=noprint_wrappers=1 "the video.mkv"
>
> which for example, retrieves the frame rate value in fractional form :
>
> 24000/1001
>
> I wonder if there is a way to retrieve the value, in decimal form, rather than fractional form ; for example :
>
> 23,976215
>
> If anybody knows a solution, I'd appreciate.
>
> Thanks in advance for your answers and advices.
>
> Regards,
> HA
On linux this is simple with bash
echo "scale=6; $(ffprobe -v error -select_streams v:0 -show_entries
stream=avg_frame_rate -of default=noprint_wrappers=1:nokey=1 "the
video.mkv")" | bc
More information about the ffmpeg-user
mailing list