欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

欧卡2入门方向盘选莱仕达V9莱仕达折叠便携游戏方向盘支架欢迎地图Mod入驻
查看: 1744|回复: 7
收起左侧

[游戏问题] 欧卡2如何使用m3u电台

[复制链接]
知行 发表于 2023-2-9 10:10 | 显示全部楼层 |阅读模式

欧卡2不支持m3u电台,报错日志:

00:06:15.201 : <ERROR> [fmod] (19) Unsupported file or audio format.
00:06:15.201 : <ERROR> [sound] Failed to initialize sound 'https://ali-m-l.cztv.com/channels/lantian/fm95/128k.m3u8'.

有什么解决办法吗,比如能不能转换一下?

 楼主| 知行 发表于 2023-2-10 08:18 | 显示全部楼层
回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-10 13:13 | 显示全部楼层
搞定,用 ffmpeg + icecast2

参见:https://www.streamingmediaglobal ... n=editors_selection


首先安装 icecast2,设置好密码,然后用 ffmpeg 推流。
例如 中国之声

ffmpeg -i https://ngcdn001.cnr.cn/live/zgzs/index.m3u8 -ab 64k -ac 1 -content_type audio/mpeg -f mp3 icecast://source:password@192.168.1.10:8000/zgzs


然后在浏览器中打开 http://192.168.1.10:8000/zgzs 测试,正常的话就可以添加到欧卡里了。
回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-24 15:48 | 显示全部楼层
[https @ 0x55e507335a00] Opening 'https://ngcdn001.cnr.cn/live/zgzs/4723094.ts' for reading
av_interleaved_write_frame(): Broken pipe 128.0kbits/s speed=   1x    
Error writing trailer of icecast://source:hackme@172.17.0.1:8888/zgzs: Broken pipe
size=   83951kB time=01:29:32.83 bitrate= 128.0kbits/s speed=   1x    
video:0kB audio:83951kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

点评

https://superuser.com/questions/1539444/how-to-make-ffmpeg-write-silence-when-the-input-stops [md] If you're encountering a problem like this, it's most likely that your Icecast `source_timeout` i  详情 回复 发表于 2023-2-24 16:06
回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-24 16:06 | 显示全部楼层
知行 发表于 2023-2-24 15:48

```
[https @ 0x55e507335a00] Opening 'https://ngcdn001.cnr.cn/live/zgzs/4723094.ts' for readi ...

https://superuser.com/questions/ ... hen-the-input-stops

If you're encountering a problem like this, it's most likely that your Icecast source_timeout is set too low. Try setting it to something unreasonably high or set it to -1 and it won't timeout at all.

This will ensure that ffmpeg will never timeout and the connection will remain open, thus eliminating the need for sending silence to mimic data being sent in the first place.

回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-24 16:19 | 显示全部楼层
-ab bitrate 设置音频码率
-ar freq 设置音频采样率
-ac channels 设置通道 缺省为1
-an 不使能音频纪录
-acodec codec 使用codec编解码
回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-25 18:15 | 显示全部楼层
回复 打印

使用道具 举报

 楼主| 知行 发表于 2023-2-25 18:20 | 显示全部楼层
回复 打印

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2024-3-29 19:58 , Processed in 0.055351 second(s), 11 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表