diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2016-01-18 19:49:30 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2016-01-18 19:49:58 +0100 |
commit | 925422b8fda8b3754340a041c86b1c53f76eb847 (patch) | |
tree | 8309fa741799829168985abbf8da53d15e1a50d8 /mediabrowser/ffmpeg.py | |
parent | 69b83475a898b511d4e26544f2d0b4a09940c3ea (diff) | |
download | flask-mediabrowser-925422b8fda8b3754340a041c86b1c53f76eb847.tar.gz flask-mediabrowser-925422b8fda8b3754340a041c86b1c53f76eb847.zip |
skip -ss on first fragment
Diffstat (limited to 'mediabrowser/ffmpeg.py')
-rw-r--r-- | mediabrowser/ffmpeg.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mediabrowser/ffmpeg.py b/mediabrowser/ffmpeg.py index 816d546..d4ad699 100644 --- a/mediabrowser/ffmpeg.py +++ b/mediabrowser/ffmpeg.py @@ -30,8 +30,13 @@ def stream(ospath, ss, t): logging.info('start ffmpeg stream h264 480p on path=%s ss=%s t=%s', ospath, ss, t) t_2 = t + 2.0 output_ts_offset = ss + if ss != 0.0: + ss_string = "-ss {:0.6f}".format(ss) + else: + ss_string = "" + cutter = LoggedPopen( - shlex.split("ffmpeg -v fatal -ss {ss:.6f} -i ".format(**locals())) + + shlex.split("ffmpeg -v fatal {ss_string} -i ".format(**locals())) + [ospath] + shlex.split("-c:a aac -strict experimental -ac 2 -b:a 64k" " -c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.0 -preset ultrafast -trellis 0" |