Permalink
Browse files

Fix screenshot generation of items imported with Mirobridge. Patch fr…

…om Doug Vaughan. Backport to .24-fixes.

git-svn-id: http://svn.mythtv.org/svn/branches/release-0-24-fixes@27162 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent 9e941db commit 6754905e6dc910cef5207e11fb8355a5ac67bd3b Robert McNamara committed Nov 10, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 mythtv/contrib/imports/mirobridge/mirobridge.py
View
6 mythtv/contrib/imports/mirobridge/mirobridge.py
@@ -188,6 +188,8 @@
# 0.6.2 Trapped possible unicode errors which would hang the MiroBridge process
# 0.6.3 Pull hostname from python bindings instead of socket libraries
# Add support for Miro version 3.5.x
+# Fixed screenshot code due to changes in ffmpeg. First
+# noticed in Ubuntu 10.10 (ffmepg v 0.6-4:0.6-2ubuntu6)
examples_txt=u'''
For examples, please see the Mirobridge's wiki page at http://www.mythtv.org/wiki/MiroBridge
@@ -856,7 +858,7 @@ def getVideoDetails(videofilename, screenshot=False):
video = re.compile(u' Video: ')
video_HDTV_small = re.compile(u' 1280x', re.UNICODE)
video_HDTV_large = re.compile(u' 1920x', re.UNICODE)
- width_height = re.compile(u'''^(.+?)[ ]\[?([0-9]+)x([0-9]+)[^\\/]*$''', re.UNICODE)
+ width_height = re.compile(u'''^(.+?)\[?([0-9]+)x([0-9]+)\\,[^\\/]''', re.UNICODE)
audio = re.compile(u' Audio: ', re.UNICODE)
audio_stereo = re.compile(u' stereo,', re.UNICODE)
audio_mono = re.compile(u' mono,', re.UNICODE)
@@ -963,7 +965,7 @@ def takeScreenShot(videofile, screenshot_filename, size_limit=False, just_demens
else:
delay = 60 # For a large videos take screenshot at the 1 minute mark
- cmd = u'ffmpeg -i "%s" -y -f image2 -ss %d -sameq -t 0.001 -s %d*%d "%s"'
+ cmd = u'ffmpeg -i "%s" -y -f image2 -ss %d -sameq -vframes 1 -s %d*%d "%s"'
width = int(ffmpeg_details[u'width'])
height = int(ffmpeg_details[u'height'])

0 comments on commit 6754905

Please sign in to comment.