server side chopping of webm, resulting files have broken index, to get seeking to work they need to be run through mkvmerge once.
This commit is contained in:
parent
a0db8b77ad
commit
0b71fa1ef1
2 changed files with 37 additions and 0 deletions
|
|
@ -392,3 +392,22 @@ def timeline_strip(item, cuts, info, prefix):
|
|||
print 'writing', timeline_file
|
||||
timeline_image.save(timeline_file)
|
||||
|
||||
def chop(response, video, start, end):
|
||||
if end <= start:
|
||||
return ''
|
||||
t = end - start
|
||||
cmd = [
|
||||
'ffmpeg',
|
||||
'-y',
|
||||
'-i', video,
|
||||
'-ss', '%.3f'%start,
|
||||
'-t','%.3f'%t,
|
||||
'-vcodec', 'copy',
|
||||
'-acodec', 'copy',
|
||||
'-f', 'webm',
|
||||
'/dev/stdout'
|
||||
]
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=open('/dev/null', 'w'))
|
||||
stdout, stderr = p.communicate()
|
||||
return stdout
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue