Windows 10上的Python Popen出现FFMPEG错误

时间:2019-06-05 00:12:07

标签: python windows ffmpeg popen

我正在尝试使用FFMPEG和Python的Popen从名为“ twws.mp4”的视频中提取关键帧。但是,我遇到了一些错误。该错误最近弹出。

我一直在使用https://github.com/chexov/image2pipe存储库进行帧提取。但是,即使这段代码中提到的示例也已停止工作。

    cmd = "ffmpeg -v error -skip_frame nokey -i twws.mp4 -vsync 0 -r 30 -s 
    300x300 -pix_fmt rgb24 -f image2pipe -"

    args = shlex.split(cmd)

    frame_ext_proc = subprocess.Popen(args,stdout=subprocess.PIPE, 
    stdin=subprocess.DEVNULL,bufsize=10**8)

我收到的错误如下:

  File ".\test.py", line 97, in <module>
    decoder.start()
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\process.py", line 105, in start
    self._popen = self._Popen(self)
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'images_from_url.<locals>.<lambda>'
PS C:\Users\g_host\Desktop\wxTest> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\spawn.py", line 99, in spawn_main
    new_handle = reduction.steal_handle(parent_pid, pipe_handle)
  File "C:\Users\g_host\AppData\Local\Programs\Python\Python36\lib\multiprocessing\reduction.py", line 87, in steal_handle
    _winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
PermissionError: [WinError 5] Access is denied
av_interleaved_write_frame(): Invalid argument
    Last message repeated 3 times
Error writing trailer of pipe:: Invalid argument

0 个答案:

没有答案