Codefox icon

Untitled

Codefox | PRO | 05/23/14 01:05:13 PM UTC | 0 ⭐ | 811 👁️ | Never ⏰ | []
Python |

1.07 KB

|

None

|

0 👍

/

0 👎

    if not re.match('.*matroska,webm,.*', infos, re.DOTALL):
        if re.match('.*, gif, from.*', infos, re.DOTALL):
            pipe = subprocess.Popen([ffmpeg_bin,
                              '-y',  # force overwrite
                              '-i', chunked_file.file.name,
                              '-f', 'webm',
                              '-c:v', 'libvpx',
                              '-crf', '12',
                              '-b:v', '500K',
                              chunked_file.file.name],  # output to original file
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
 
            pipe.wait()
 
            pipe = subprocess.Popen([ffmpeg_bin,
                                     '-i', chunked_file.file.name],
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)
 
            pipe.stdout.readline()
            infos = pipe.stderr.read()
        else:
            return AjaxResponseError({'error': 'wrongformat'})

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎