我想从 ffmpeg 流中获取单独的视频和单独的音频对象(python)
\n为此,我在我的 rasbery pi 上运行它:
\nffmpeg -f alsa -thread_queue_size 1024 -channels 1 -i hw:2,0 -thread_queue_size 1024 -s 1920x1080 -i /dev/video0 -listen 1 -f matroska -vcodec libx264 -preset veryfast -tune zerolatency http://:8080\nRun Code Online (Sandbox Code Playgroud)\n从服务器端,我像这样连接到流。我知道如何从这个数据包对象中获取声音,但我不\xe2\x80\x99不明白如何从数据包对象中获取视频帧?我想将视频流呈现为逐个图片和单独的声音,以便在程序中进行音频和视频处理。
\n process = (\n ffmpeg.input("http://192.168.1.78:8080").output(\n '-',\n format='matroska',\n acodec='libvorbis',\n vcodec='libx264'\n ).run_async(pipe_stdout=True, pipe_stderr=True)\n )\n while process.poll() is None:\n packet = process.stdout.read(4096)\nRun Code Online (Sandbox Code Playgroud)\n使用python 3.9 ffmpeg-python==0.2.0
\nPS\n本质上我需要为每个包提供一个视频数组和单独的音频。
\n