I finally found a proper solution to this problem using sox - which returns the correct information. How to get the real, actual duration of an MP3 file (VBR or CBR) server-side There are 60 seconds in a minute, not 100. Iv) To get values of more than one parameter: $ mediainfo -Inform="Video %Width%,%Height%,%BitRate%,%FrameRate%" Iii) To get the duration of audio stream only: $ mediainfo -Inform="Audio %Duration%" Ii) To get the duration of the media file: $ mediainfo -Inform="General %Duration%" I) To get the duration of video stream: $ mediainfo -Inform="Video %Duration%" How to find duration of a video file using mediainfo in seconds or other formats? Result = n(, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) You can use the following method instead to get the duration: def get_length(input_video): There is one simple command which returns only the duration of the input file: ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 There is no need to iterate though the output of FFprobe. Using ffmpeg to obtain video durations in python Try this: ffmpeg -i file.mp4 2>
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |