ubuntu - 使用 ffmpeg 和 nginx 直播 .webm 文件

标签 ubuntu nginx ffmpeg webm mpeg-dash

您好,我是 ffmpeg 的新手,我需要一些有关 .webm 文件实时流式传输的帮助,该文件仍在写入中。我有一个 .webm 文件只包含 vp9 编解码器 中的视频,需要实时流式传输(最好不使用 DASH 进行转码和流式传输)。我已经编译了 nginx 和 nginx-来自 ( https://github.com/arut/nginx-ts-module#features) 的 ts-module 具有以下配置

nginx version: nginx/1.12.1
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) 
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/home/ubuntu/NGINX/nginx-ts-module-master

媒体文件具有以下属性(通过 mediainfo 获得):

General
Complete name                            : video_4_1_Admin_0.webm
Format                                   : WebM
Format version                           : Version 2
File size                                : 19.7 MiB
Duration                                 : 1ms
Overall bit rate                         : 165 Gbps
Writing library                          : libwebm-0.2.1.0
Video
ID                                       : 1
Format                                   : VP9
Codec ID                                 : V_VP9
Width                                    : 320 pixels
Height                                   : 180 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Language                                 : English
Default                                  : Yes
Forced                                   : No

我正在尝试使用以下流式传输文件

ffmpeg -re -i video_4_1_Admin_0.webm -bsf:v vp9_superframe -c copy -f webm_chunk  http://127.0.0.1:8000/publish/sintel

我收到以下错误

Input #0, matroska,webm, from 'video_4_1_Admin_0.webm':
  Metadata:
    encoder         : libwebm-0.2.1.0
  Duration: 00:00:00.00, start: 0.000000, bitrate: 174444152 kb/s
    Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 320x180, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
Output #0, webm_chunk, to 'http://127.0.0.1:8000/publish/sintel':
Output file #0 does not contain any stream

我不确定要传递给 ffmpeg 的确切选项是什么,以便它创建 .mpd 和所需的 block ,这将允许我对媒体进行 LiveStream,我尝试将示例 ( https://github.com/arut/nginx-ts-module#features ) 中给出的选项替换为 vp9 等价物。但是,我不确定。有人可以帮我吗?提前致谢

最佳答案

WebM 不是 MPEG-TS。

Nginx 不适合您的用例。您可以改用 Icecast。

关于ubuntu - 使用 ffmpeg 和 nginx 直播 .webm 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47710873/

相关文章:

mysql - 如何将 MySQL 用于 Nginx 的动态文档根目录?

docker - Nginx docker 容器在 Ubuntu 20.04 中退出并出现错误 “fopen:No such file or directory:fopen('/etc/nginx/ssl/live/test.example.dev/fullchain.pem'”

video - ffmpeg在特定时间在mp4上覆盖png

android - 在 Android 中可以使用 red5 代替 FFmpeg 吗?

ios - 如何在 iOS 上将 h.264 文件包装为 mp4

python - ubuntu安装opencv2.4编译报错

python - Django-oscar 错误 - django.core.exceptions.ImproperlyConfigured : Application labels aren't unique, 重复项:静态文件

nginx - 如何编写 nginx 规则/正则表达式以匹配空非空路径

python - Ubuntu 上的 Azure CLI 权限被拒绝错误

node.js - 加载共享库 : libgtk-x11-2. 0.so.0 时出错: