Windows video converter reddit.com2/16/2023 Media_info = MediaInfo.parse('/home/pi/Desktop/a.mp4') Hence this additional example: # sudo apt install mediainfo Thank you.Īs a beginner, it did take a while to find out what was missing (sudo apt install mediainfo) and how to also address attributes in other ways (see below). The above pymediainfo answer really helped me. # we got here because no single 'return' in the above happen. ''' Video's duration in seconds, return a float number Pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.STDOUT) Raise Exception('Gvie ffprobe a full file path of the video') ''' Give a json from ffprobe command : The absolute (full) path of the video file, string. # man ffprobe # for more information about ffprobe # ffprobe -loglevel quiet -print_format json \ The code is not optimized for speed or beautiful purposes but it works on my machine hope it helps. It works on Ubuntu 14.04 where of course ffprobe installed. Secondes_dot_ = duration(filename) # float number of seconds You can use it by using probe(filename), or get duration by using duration(filename): json_info = probe(filename) To make things a little bit easier, the following codes put the output to JSON.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |