def ffmpeg_args(): ret = ['ffmpeg', '-f'] p = Platform() if p.isMacOSX(): ret.append('avfoundation') elif p.isLinux(): ret.append('v4l2') else: raise NotImplementedError ret.extend([ '-framerate', '30', '-video_size', '640x480', ]) if p.isMacOSX(): ret.extend([ '-i', 'default', '-f', 'avfoundation', '-i', ':0', ]) elif p.isLinux(): ret.extend([ '-i', '/dev/video0', '-f', 'alsa', '-thread_queue_size', '99999', '-i', 'hw:0', ]) ret.extend([ '-async', '1', '-c:a', 'aac', '-vcodec', 'libx264', '-tune', 'zerolatency', '-preset', 'veryfast', '-x264opts', 'crf=20:vbv-maxrate=3000:vbv-bufsize=100:intra-refresh=1:slice-max-size=1500:keyint=30:ref=1', ]) # Ubuntu-only? if p.isLinux() and isUbuntu(): ret.extend(['-strict', '-2']) ret.extend(['-f', 'mpegts', '-']) return ret
def test_isLinuxConsistency(self): """ L{Platform.isLinux} can only return C{True} if L{Platform.getType} returns C{'posix'} and L{sys.platform} starts with C{"linux"}. """ platform = Platform() if platform.isLinux(): self.assertTrue(sys.platform.startswith("linux"))