小编riy*_*uja的帖子

芹菜工人不工作虽然rabbitmq有队列建设

我正在接触芹菜,我按照教程编写了一个任务,但不知何故工人没有起床,我得到了以下日志输入命令后:

celery worker -A tasks -l debug
Run Code Online (Sandbox Code Playgroud)

我得到一个日志:

Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!

If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).

User information: uid=0 euid=0 gid=0 egid=0
Run Code Online (Sandbox Code Playgroud)

这是我的任务:

from celery import Celery

app = Celery('tasks', backend='amqp',broker='amqp://sanjay:**@localhost:5672//')

@app.task
def gen_prime(x):
    multiples = []
    results = []
    for i in xrange(2, …
Run Code Online (Sandbox Code Playgroud)

python rabbitmq celery python-2.7 digital-ocean

5
推荐指数
1
解决办法
3457
查看次数

cloudfront 视频流无法在 iOS 设备上运行

我正在尝试使用亚马逊cloudfront网络分发在iOS设备上流式传输视频(苹果设备不支持RTMP流式传输)并且视频存储在s3中。此外,每个人都可以访问该链接。当我尝试将视频链接粘贴到浏览器中时视频开始下载而不是流式传输。在检查了 Instagram 的网站后,我发现 Instagram 做了同样的事情(也许),但不同之处在于它使用 akamai CDN,而我使用的是亚马逊的 cloudfront

我的链接:

http://d16jy53srxox6v.cloudfront.net/brown.mp4
Run Code Online (Sandbox Code Playgroud)

Instagram 视频串流链接:

https://igcdn-videos-b-2-a.akamaihd.net/hphotos-ak-xfa1/t50.2886-16/11773361_692383954227382_242786346_n.mp4
Run Code Online (Sandbox Code Playgroud)

Instagram 视频流完美,我的视频可以下载而不是流式传输。在谷歌搜索后,我发现 HLS 是解决方案之一,但我正在寻找简单的流式传输替代方案,因为我的视频最大长度为 1 分钟,而 HLS 适合较大的文件。谁能建议我该怎么做才能使我的视频在没有 HLS 的情况下可以流式传输?

此外,我尝试在 ios 设备中流式传输它,但它尝试下载然后播放它。这是我的代码:

    -(IBAction)click:(id)sender
{
    // Make a URL
    NSURL *url = [NSURL URLWithString:
                  @"http://d16jy53srxox6v.cloudfront.net/brown.mp4"];

    // Initialize the MPMoviePlayerController object using url
    _videoPlayer =  [[MPMoviePlayerController alloc]
                     initWithContentURL:url];


    // Set control style to default
    _videoPlayer.controlStyle = MPMovieControlStyleDefault;

    // Set shouldAutoplay to YES
    _videoPlayer.shouldAutoplay = YES;
    _videoPlayer.movieSourceType=MPMovieSourceTypeStreaming;

    // Add _videoPlayer's view as subview to current view.
    [self.view addSubview:_videoPlayer.view];

    // …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 video-streaming ios amazon-cloudfront xcode6

5
推荐指数
1
解决办法
2287
查看次数