summaryrefslogtreecommitdiff
path: root/mediabrowser/ffmpeg.py
diff options
context:
space:
mode:
authorUser Jack <jack@garcon.2.localnet.cc>2016-01-02 11:49:34 +0000
committerYves Fischer <yvesf-git@xapek.org>2016-01-08 20:38:18 +0100
commita11dcb6ae177dfce7725d43a37648770d7340062 (patch)
treed8ac5eedc883427cd5ebf98959b091de01c7657f /mediabrowser/ffmpeg.py
parent7c6120bae3ed4e7cdd015b536a53bb2724967013 (diff)
downloadflask-mediabrowser-a11dcb6ae177dfce7725d43a37648770d7340062.tar.gz
flask-mediabrowser-a11dcb6ae177dfce7725d43a37648770d7340062.zip
pick video stream not just stream number 0
Diffstat (limited to 'mediabrowser/ffmpeg.py')
-rw-r--r--mediabrowser/ffmpeg.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mediabrowser/ffmpeg.py b/mediabrowser/ffmpeg.py
index d8d40f5..fd1782c 100644
--- a/mediabrowser/ffmpeg.py
+++ b/mediabrowser/ffmpeg.py
@@ -115,8 +115,8 @@ def calculate_splittimes(ospath, chunk_duration):
def thumbnail(ospath, width, height):
- process = LoggedPopen(shlex.split("ffmpeg -noaccurate_seek -ss 25.0 -i") + [ospath] +
- shlex.split("-frames:v 10 -map 0:0"
+ process = LoggedPopen(shlex.split("ffmpeg -v fatal -noaccurate_seek -ss 25.0 -i") + [ospath] +
+ shlex.split("-frames:v 10 -map 0:v"
" -filter:v 'scale=w=oh*a:h={}, crop=(min(iw\,{})):(min(ih\,{}))'"
" -f singlejpeg pipe:".format(height+(height/10), width, height)),
stdout=PIPE)
@@ -131,7 +131,7 @@ def thumbnail_video(ospath, width, height):
for pos in chunk_startpos:
command += ["-ss", "{:.6f}".format(pos), "-t", "2", "-i", ospath]
- filter = " ".join(map(lambda i: "[{}:0]".format(i), range(len(chunk_startpos))))
+ filter = " ".join(map(lambda i: "[{}:v]".format(i), range(len(chunk_startpos))))
filter += " concat=n={}:v=1:a=0 [v1]".format(len(chunk_startpos))
filter += "; [v1] fps=14 [v2]"
filter += "; [v2] scale='w=trunc(oh*a/2)*2:h={}' [v3]".format(height + 6)
@@ -140,4 +140,4 @@ def thumbnail_video(ospath, width, height):
command += shlex.split("-c:v libvpx -deadline realtime -f webm pipe:")
encoder = LoggedPopen(command, stdout=PIPE)
- return encoder.stdout
+ return encoder