From 925422b8fda8b3754340a041c86b1c53f76eb847 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 18 Jan 2016 19:49:30 +0100 Subject: skip -ss on first fragment --- mediabrowser/ffmpeg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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" -- cgit v1.2.1