Get Video Duration with FFMPEG and Python
Get Video Duration with FFMPEG and Python
For this to work, you’ll need FFMPEG and Python on your machine or server already. Configuration of this is beyond the scope of this post, but installation through yum or apt-get should be sufficient (or equivalent on a Windows or Mac). To pull the duration of a video from any machine with FFMPEG and Python installed, run the following script. Take care to replace PATH_TO_YOUR_VIDEO_FILE with the path to your video and check to ensure your ffmpeg binary is located at /usr/bin/ffmpeg (you can do this by executing ‘which ffmpeg’ in your shell). The result is a dictionary with hours, minutes and seconds as the keys.
import subprocess import re process = subprocess.Popen(['/usr/bin/ffmpeg', '-i', PATH_TO_YOUR_VIDEO_FILE], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, stderr = process.communicate() matches = re.search(r"Duration:\s{1}(?P<hours>\d+?):(?P<minutes>\d+?):(?P<seconds>\d+\.\d+?),", stdout, re.DOTALL).groupdict() print matches['hours'] print matches['minutes'] print matches['seconds'] |
IT Recruiters are Ineffective
IT Recruiters are Ineffective
I recently updated my resume on Dice.com, not because I’m looking for a new job but to simply stay in good form for next time I am. Users are given the option to describe their current employment search situation as being satisfied with the current job and not looking, which is what I chose. Immediately, my inbox exploded and my phone started ringing with calls from IT recruiters who had clearly ignored this employment status. Many of these jobs were for companies thousands of miles away and for languages in which I do not program. If you want to attract top talent in the industry, do NOT harass programmers with unsolicited offers.
To this day, my phone is being blasted with calls, two months after initially updating my resume. The bottom of this post will list the worst offenders. If your company needs to hire new developers, avoid the companies on this list. They aren’t looking carefully, they are sending email to any name they can find. I’ll never take a job from these companies and I’d encourage other developers to do the same. Let’s stop this practice of spamming as a means of hiring by avoiding these companies as an industry.
- Helios and Matheson Information Technology Inc
- Mitchell/Martin Inc
- IT Solutions Inc
- Resolvit
- eTeam, Inc
- aptus solutions
- Cardinal Technology Solution
- JRD Systems, Inc
- Global Technical Talent
- Horizontal Integration