将流从hdhomerun发送到AWS EC2实例

时间:2018-08-13 08:16:29

标签: ffmpeg wowza

我正在尝试一些奇怪的事情以获得乐趣。将流从hdhomerun发送到AWS EC2实例。

第一个方法。用ffmpeg读取流 (在本地成功测试)

hdhomerun_config发现我的设备的IP地址为192.168.1.200,所以我以这种方式在路由器上打开了端口

<my home public ip>:5005 -> 192.168.1.200:80
<my home public ip>:5004 -> 192.168.1.200:5004

w3m和telnet说一切正常。

但是...

我从EC2实例开始

/usr/bin/ffmpeg -y -i 'http://<my home public ip>:5004/auto/v5057?transcode=internet240' -t 12 -vn -acodec pcm_s16le -ar 16000 -ac 1 '/tmp/test.wav'

在调谐器1中,我可以看到...

Virtual Channel none
Frequency   698.000 MHz
Program Number  186
Modulation Lock t8qam64
Signal Strength 89%
Signal Quality  100%
Symbol Quality  100%
Streaming Rate  none
Resource Lock   <EC2 public ip>

在hdhomerun系统日志中...

19700102-10:27:25 Tuner: tuner0 tuning 5057 Telecinco (t8qam64:698MHz-186)
19700102-10:27:25 Tuner: tuner0 streaming http to <EC2 public ip>:34124

一切似乎都很好,但是ffmpeg没有任何数据。

第二种方式。将视频流发送到wowza

我有一个在EC2实例中运行的wowza服务器

我从家里的一个Linux机器上做。

root# /usr/bin/hdhomerun_config 1250D7B2 scan /tuner1 scan.log
root# /usr/bin/hdhomerun_config 1250D7B2 set /tuner1/channel auto:651000000
root# /usr/bin/hdhomerun_config 1250D7B2 get /tuner1/streaminfo
root# /usr/bin/hdhomerun_config 1250D7B2 get /tuner1/program 190
root# /usr/bin/hdhomerun_config 1250D7B2 set /tuner1/target rtp://<wowza server public ip>:1935/TEST/hdhr
root# echo $?
root# 0

没有错误的结束购买无效 这是一个远景,但是....

任何可以做到这一点的想法。

谢谢!!!

2 个答案:

答案 0 :(得分:0)

HDHomerun调谐器以ttl = 3发送流,因此一旦离开路由器,它就永远不会到达您的EC2实例。我在Internet上流式传输的解决方案是在HDHomerun位置使用nginx反向代理将5004转发到调谐器。

答案 1 :(得分:0)

最后,我以这种方式将ffmpeg用作编码器...

# A tibble: 3 x 7
    bar   baz   foo  lala  toto   ttt  tutu
  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1     2     1     1     0     0     0     0
2     0     0     2     1     1     0     0
3     0     0     0     0     0     3     1

要守护我做到了...

using AutoMapper;
//using System.Linq;
using Squirrel.Api.Dtos.BoH.Corporation;
using Squirrel.Api.Dtos.Shared.Hardcoded;
using Squirrel.Api.Entities.ClientDB.Corporation;

namespace Squirrel.Api.Tasks.BoH.AutoMappers
{
    public class PopUpScreenBoHMapper : Profile
    {
        public PopUpScreenBoHMapper()
        {
            CreateMap<PopUpScreen, PopUpScreenBoHDto>()
                .ForMember(d => d.CompletionRuleId, o => o.MapFrom(s => s.CompletionRule.CompletionRuleId))
                .ForMember(d => d.CompletionRuleName, o => o.MapFrom(s => CompletionRuleDto.GetLocalizedName(s.CompletionRule.CompletionRuleId, s.CompletionRule.Name)))
                .ForMember(d => d.CreatedUserId, o => o.MapFrom(s => s.CreatedUser.UserId))
                .ForMember(d => d.CreatedUserName, o => o.MapFrom(s => s.CreatedUser.UserName))
                .ForMember(d => d.LastModifiedUserId, o => o.MapFrom(s => s.LastModifiedUser.UserId))
                .ForMember(d => d.LastModifiedUserName, o => o.MapFrom(s => s.LastModifiedUser.UserName));    
            //CreateMap<PopUpScreen, PopUpScreenBoHDto>()
            //    .AfterMap((o, d) =>
            //    {
            //        d.MenuEntryRels = (o.CustomSorted
            //                   ? d.MenuEntryRels.OrderBy(x => x.PositionY).ThenBy(x => x.PositionX)
            //                   : d.MenuEntryRels.OrderBy(x => x.MenuEntryName)).ToList();
            //    });
        }
    }
}