tags:

views:

157

answers:

1

On Linux, YouTube places temporary flash files in /tmp. Nautilus can display the duration (Minutes:Seconds) of them, but I haven't found a way to extract the duration using python.' The fewer dependencies your method requires the better.

Thanks in advance.

+2  A: 

One way it can be done using ffmpeg. ffmpeg needs to be installed with h.264 and h.263 codec support. Then following is the command to retrieve the video duration, which can be called via python system(command).
ffmpeg -i flv_file 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//

bhups