如何从无尽的音频流中获取和分开音频
首先,我有一个无尽的凸轮流,其中包括音频和视频。
如何根据RTSP流中的时间间隔在流媒体流中进行分配。
我已经尝试了下面的代码,但是在流结束之前我无法获取音频数据
command = ['ffmpeg.exe',
'-i', 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4',
'-f', 's16le',
'-acodec', 'libmp3lame',
'-ar', '44100',
'-ac', '2',
'-']
pipe = sp.Popen(command, stdout=sp.PIPE)
raw_audio = self.pipe.stdout.read()
print(raw_audio)
Firstly I have an endless cam stream which includes audio and video.
How to get divided .wav files according to time intervals from RTSP streaming while streaming.
I have tried the code below but I couldn't get the audio data before the stream ended
command = ['ffmpeg.exe',
'-i', 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4',
'-f', 's16le',
'-acodec', 'libmp3lame',
'-ar', '44100',
'-ac', '2',
'-']
pipe = sp.Popen(command, stdout=sp.PIPE)
raw_audio = self.pipe.stdout.read()
print(raw_audio)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
输出容器。类似:-f segment
现在,如果您真正需要的是原始样本,而不一定是.wav文件,则需要通过删除
' - acodec','libmp3lame'
来修复命令,并指定号码要阅读的样本:Try
-f segment
output container. Something like:Now, if what you really need are the raw samples and not necessarily .wav files, you need to fix your command by removing the
'-acodec', 'libmp3lame'
option and specify the number of samples to read: