简体   繁体   English

使用ffmpeg将HLS转码/传输到RTMP以便Nginx联播不起作用

[英]Using ffmpeg to transcode/transmux HLS to RTMP for nginx simulcast not working

I want to take an HLS stream and transcode it to RTMP and simulcast it with the nginx RTMP module. 我想获取一个HLS流,并将其转码为RTMP,并使用nginx RTMP模块同时广播。

It's not working, however (I have it placed in the application section of the RTMP module). 但是,它不起作用(我已将其放置在RTMP模块的应用程序部分中)。

exec ffmpeg -i -re http://<HLS>.m3u8 -acodec aac -vcodec libx264 -f flv rtmp://localhost/live/test;

When I try to view my RTMP stream in VLC, it is not loading. 当我尝试在VLC中查看我的RTMP流时,它没有加载。 I have tried several variations of that ffmpeg directive, none have worked. 我已经尝试过该ffmpeg指令的几种变体,但都没有奏效。 Any advice? 有什么建议吗? If you need to see more of my config file, I can provide that, but this server has been working previously perfectly when sending video over via a Teradek encoder. 如果您需要查看更多我的配置文件,我可以提供,但是该服务器以前通过Teradek编码器发送视频时运行良好。 This new wrinkle is just not working. 这种新的皱纹是行不通的。

EDIT: Just had a thought. 编辑:只是有一个想法。 It'd probably help to have the codec information of the incoming HLS stream. 了解传入的HLS流的编解码器信息可能会有所帮助。 Here it is: 这里是:

  • Video Codec: H264 - MPEG-4 AVC 视频编解码器:H264-MPEG-4 AVC
  • Resolution: 640x360 分辨率:640x360
  • Frame rate: 24 影格速率:24
  • Decoded format: Planar 4:2:0 YUV 解码格式:平面4:2:0 YUV
  • Audio Codec: MPEG AAC Audio (mp4a) 音频编解码器:MPEG AAC音频(mp4a)
  • Channels: Stereo 频道:立体声
  • Sample rate:48000Hz 采样率:48000Hz

If you run in terminal 如果您在终端中运行

ffmpeg -i -re http://<HLS>.m3u8 -acodec aac -vcodec libx264 -f flv rtmp://localhost/live/test;

are you able to play the stream in VLC? 您可以在VLC中播放视频流吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM