我正在尝试从一个HLS m3u8实时视频流中提取音频到FLAC、PCM或OGG-OPUS。我试过几种选择。它们都在我的桌面上创建文件,但当我播放该文件时,没有录音。
转换为FLAC
gst-launch-1.0 souphttpsrc location=[m3u8 URL] ! hlsdemux ! decodebin ! audioconvert ! flacenc ! filesink location=audio.flac
转换为PCM
gst-launch-1.0 souphttpsrc location=[m3u8 URL] ! hlsdemux ! decodebin ! audioconvert ! audio/x-raw,format=S32BE,channels=1,rate=48000 ! filesink location=audio.pcm
转换为OGG-OPUS
gst-launch-1.0 souphttpsrc location=[m3u8 URL] ! hlsdemux ! decodebin ! audioconvert ! opusenc ! filesink location=audio.ogg
关于gst的m3u8 HLS流的m3u8信息-发现者-1.0
Properties:
Duration: 99:99:99.999999999
Seekable: no
Live: no
container: application/x-hls
container: MPEG-2 Transport Stream
audio: MPEG-4 AAC
Stream ID: 722f60699ac437d8b42b2325b9497eb8707874802bf34a0185ca68ebfd95dd38/src_0:1/00000101
Language: <unknown>
Channels: 2 (front-left, front-right)
Sample rate: 48000
Depth: 32
Bitrate: 0
Max bitrate: 0
video: H.264 (Main Profile)
Stream ID: 722f60699ac437d8b42b2325b9497eb8707874802bf34a0185ca68ebfd95dd38/src_0:1/00000100
Width: 768
Height: 432
Depth: 24
Frame rate: 30000/1001
Pixel aspect ratio: 1/1
Interlaced: false
Bitrate: 0
Max bitrate: 0
发布于 2022-01-24 15:26:08
我想出了这个问题,并在GitHub上发布了解决方案:
此Node.js示例将获取一个实时m3u8流,使用GStreamer提取音频,将其保存到FLAC音频文件中,并发送到AWS实时转录。(一些代码从在线上的其他示例中复制,并合并成一个工作示例。)
https://stackoverflow.com/questions/70718033
复制相似问题