- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想为 NGINX rtmp 模块使用 HLS_Variant 功能。
但是,如果我按照文档中的示例进行操作,我将无法正常工作。
我有以下测试:
application Test {
live on;
record off;
on_publish http://127.0.0.1/php/rtmp_auth.php;
on_publish_done http://127.0.0.1/php/on_publish_done.php;
exec_push /usr/local/bin/ffmpeg -loglevel debug -i rtmp://localhost:1935/Test/$name
-c:v libx264 -acodec aac -preset veryfast -b:v 256k -tune zerolatency -vf "scale=480:trunc(ow/a/2)*2" -f flv rtmp://localhost:1935/Z006/$name_low
-c:v libx264 -acodec aac -preset veryfast -b:v 768k -tune zerolatency -vf "scale=720:trunc(ow/a/2)*2" -f flv rtmp://localhost:1935/Z006/$name_mid
-c:v libx264 -acodec aac -preset veryfast -b:v 1024k -tune zerolatency -vf "scale=960:trunc(ow/a/2)*2" -f flv rtmp://localhost:1935/Z006/$name_high
-c:v libx264 -acodec aac -preset veryfast -b:v 1920k -tune zerolatency -vf "scale=1280:trunc(ow/a/2)*2" -f flv rtmp://localhost:1935/Z006/$name_higher
-c copy -f flv rtmp://localhost:1935/Z006/$name_src 2>>/tmp/Log.log; }
application Z006 {
live on;
record off;
hls on;
hls_path /usr/local/www/stream/tmp/hls0;
hls_nested on;
hls_variant _low BANDWIDTH=288000; # _low - Low bitrate, sub-SD resolution
hls_variant _mid BANDWIDTH=448000; # _mid - Medium bitrate, SD resolution
hls_variant _high BANDWIDTH=1152000; # _high - Higher-than-SD resolution
hls_variant _higher BANDWIDTH=2048000; # _higher - High bitrate, HD 720p resolution
hls_variant _src BANDWIDTH=4096000; # _src - Source bitrate, source resolution
}
如您所见,这并没有什么特别之处。
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)
configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --disable-static --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --cxx=c++ ->
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtmp://localhost:1935/Test//'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'veryfast'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '256k'.
Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=480:trunc(ow/a/2)*2'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://localhost:1935/Z006//_low' ... matched as output url.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'veryfast'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '768k'.
Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=720:trunc(ow/a/2)*2'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://localhost:1935/Z006//_mid' ... matched as output url.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'veryfast'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1024k'.
Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=960:trunc(ow/a/2)*2'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://localhost:1935/Z006//_high' ... matched as output url.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'veryfast'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1920k'.
Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=1280:trunc(ow/a/2)*2'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://localhost:1935/Z006//_higher' ... matched as output url.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://localhost:1935///_src' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtmp://localhost:1935/Test//.
Successfully parsed a group of options.
Opening an input file: rtmp://localhost:1935/Test//.
[NULL @ 0x80609a000] Opening 'rtmp://localhost:1935/Test//' for reading
[rtmp @ 0x806089300] No default whitelist set
[tcp @ 0x806089380] No default whitelist set
[tcp @ 0x806089380] Original list of addresses:
[tcp @ 0x806089380] Address 127.0.0.1 port 1935
[tcp @ 0x806089380] Address ::1 port 1935
[tcp @ 0x806089380] Interleaved list of addresses:
[tcp @ 0x806089380] Address 127.0.0.1 port 1935
[tcp @ 0x806089380] Address ::1 port 1935
[tcp @ 0x806089380] Starting connection attempt to 127.0.0.1 port 1935
[tcp @ 0x806089380] Successfully connected to 127.0.0.1 port 1935
[rtmp @ 0x806089300] Handshaking...
[rtmp @ 0x806089300] Type answer 3
[rtmp @ 0x806089300] Server version 13.14.10.13
[rtmp @ 0x806089300] Proto = rtmp, path = /Test//, app = Test/, fname =
[rtmp @ 0x806089300] Window acknowledgement size = 5000000
[rtmp @ 0x806089300] Max sent, unacked = 5000000
[rtmp @ 0x806089300] New incoming chunk size = 4096
[rtmp @ 0x806089300] Creating stream...
[rtmp @ 0x806089300] Sending play command for ''
我认为错误显然是空的'fname'。
最佳答案
我想我成功了。
经过几天的测试和调试支持重建后,我发现了问题。
当您使用以下组合时,一切都开始了:
2021/11/29 09:50:42 [debug] 90542#0: epoll timer: 9996
2021/11/29 09:50:42 [debug] 90542#0: epoll: fd:15 ev:2005 d:00007FEFED509668
2021/11/29 09:50:42 [debug] 90542#0: *3 http upstream request: "/php/rtmp_auth.php?"
2021/11/29 09:50:42 [debug] 90542#0: *3 http upstream process header
2021/11/29 09:50:42 [debug] 90542#0: *3 malloc: 000056047409F050:4096
2021/11/29 09:50:42 [debug] 90542#0: *3 posix_memalign: 00005604740A0060:4096 @16
2021/11/29 09:50:42 [debug] 90542#0: *3 recv: eof:1, avail:-1
2021/11/29 09:50:42 [debug] 90542#0: *3 recv: fd:15 80 of 4096
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 01
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 06
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 00
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 01
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 00
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 36
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 02
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record byte: 00
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi record length: 54
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi parser: 0
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi header: "Location: /"
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi parser: 0
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi header: "Content-type: text/html; charset=UTF-8"
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi parser: 1
2021/11/29 09:50:42 [debug] 90542#0: *3 http fastcgi header done
2021/11/29 09:50:42 [debug] 90542#0: *3 HTTP/1.1 302 Moved Temporarily
Server: nginx/1.20.2
Date: Mon, 29 Nov 2021 08:50:42 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Location: /
如您所见,fastcgi 将 http 代码设置为 302,位置为“/”。
<?php
$streamName = $_POST["name"];
//Check for streamkey here
//If okay, set Location and Return Code (Set 403 if Auth failed)
header('Location: '.$streamName, TRUE, 200);
?>
在我们手动设置新位置后,日志更改为:
2021/11/29 09:57:56 [debug] 90618#0: epoll timer: 10000
2021/11/29 09:57:56 [debug] 90618#0: epoll: fd:15 ev:2005 d:00007F491020B668
2021/11/29 09:57:56 [debug] 90618#0: *3 http upstream request: "/php/rtmp_auth.php?"
2021/11/29 09:57:56 [debug] 90618#0: *3 http upstream process header
2021/11/29 09:57:56 [debug] 90618#0: *3 malloc: 000055F9E1EC9050:4096
2021/11/29 09:57:56 [debug] 90618#0: *3 posix_memalign: 000055F9E1ECA060:4096 @16
2021/11/29 09:57:56 [debug] 90618#0: *3 recv: eof:1, avail:-1
2021/11/29 09:57:56 [debug] 90618#0: *3 recv: fd:15 88 of 4096
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 01
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 06
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 00
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 01
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 00
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 40
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 00
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record byte: 00
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi record length: 64
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi parser: 0
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi header: "Location: Test_input"
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi parser: 0
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi header: "Content-type: text/html; charset=UTF-8"
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi parser: 1
2021/11/29 09:57:56 [debug] 90618#0: *3 http fastcgi header done
2021/11/29 09:57:56 [debug] 90618#0: *3 HTTP/1.1 302 Moved Temporarily
Server: nginx/1.20.2
Date: Mon, 29 Nov 2021 08:57:56 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Location: Test_input
现在 $name 变量已设置为下次与 exec 命令一起使用。
关于nginx - rtmp 流的 ffmpeg 覆盖,fname 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70023047/
我正在尝试使用 ldash 等选项和 http_opts ,正如 dash muxer 文档所描述的,但 FFmpeg 无法识别它们。我正在使用最新发布的 ffmpeg v4.2.2 版本。我在 ff
假设我们有许多想要与 -vcodec 副本(或等效语法)合并的视频记录。无需重新编码,不会损失质量。并且很少有记录(minor set),有另外的编解码器,参数等等。所以我们可以使用 ffprobe
有没有办法安装 ffmpeg 没有root访问权限?使用 ./configure 无法做到这一点来自 git 克隆 git://source.FFmpeg.org/fFFmpeg.git 最佳答案 是
在应用程序中直接使用 FFmpeg 与使用 Ffmpeg 命令行有什么区别? 最佳答案 没有:FFmpeg 命令行只是一个使用 FFmpeg API 的应用程序。当然,在使用该应用程序时,您仅限于已实
我正在使用以下命令对文件(下面的媒体信息)进行编码: ffmpeg -i AHomeMovie.mkv -map 0 -c copy -c:v libx264 -preset veryslow -cr
我正在制作一张圣诞贺卡,我需要将视频嵌入到右侧(边框内)的卡片中,并在左侧显示一些文本。 为简单起见,假设我有一个带有透明孔的盒子。我想在那个洞里显示视频。 我正在使用 ffmpeg-python很高
我正在使用 laravel ffmpeg 为视频创建缩略图,但是当我运行代码时,它返回给我 Call to undefined method FFMpeg\FFMpeg::fromDisk() 我不知
我为我的 nvidia 下载了 cuda 驱动程序 但它仍然不使用我的 GPU,它仍然使用 cpu。 我怎样才能让它使用GPU。 我也听说过硬件加速,但那不起作用。 它必须是 h.264 最佳答案 你
尝试剪切视频的多个部分时,我遵循此问题的解决方案 Cut multiple parts of a video with ffmpeg .但问题是,如果我剪切多次(比如大约 20 次或更多),视频和音频
所以我最近开始在我打算在商业上分发的应用程序中实现 ffmpeg。而且我很难理解整个许可过程。 我见过的最常回答的问题似乎是关于 x264,它需要 x264.org 的付费许可才能在商业上使用它(对吗
我使用 ffmpeg 更改视频文件的分辨率,转换到另一个位置后,视频持续 0 秒,但最初持续 2 分钟 我的ffmepg代码: ffmpeg -i input.mp4 -filter:v scale=
如上: FFMPEG 不支持在没有第三部分库的情况下加载外部过滤器是否有特定原因? (像弗莱0r) 我必须重新编译整个包来添加一个新的过滤器! 最佳答案 只有开发人员可以肯定地回答,但我会冒安全风险和
我收到了一个编码器,我需要用 FFMPEG 编译,我是新手,所以我不知道如何用 ffmpeg 添加/编译它。编码器是JSV,我的服务器是ubuntu 14.04。 我已经开始阅读这篇 https://
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为
我正在制作一个利用 ffmpeg 重新混合和转码视频文件的程序。我想使用 ffmpeg -codecs和 ffmpeg -formats (或通过 ffmpeg 可用的任何其他命令)来检查我可以在哪些
这个问题在这里已经有了答案: ffmpeg moving text drawtext (1 个回答) 3年前关闭。 我正在使用此命令使用 ffmpeg 将文本从一个地方移动到另一个地方 ffmpeg
为什么 ffmpeg/ffprobe 为流和整个文件提供不同的比特率值? 当我使用 ffprobe 分析 mp3 文件时,它会在第一行和第二行给出不同的比特率。 有谁知道,有什么区别? // File
如何在ffmpeg中使用drawtext在视频上绘制多色文本? 示例:我想突出句子中的专有名词, “XYZ公司股价上涨91%” 高亮 XYZ 白色 黄色 用绿色突出显示 91% 如果您有任何其他方法不
我想让我的不和谐机器人播放音乐,但我不断收到“找不到 FFMPEG”错误。 我的机器人主要是由 ping 制成的,所以我不会上传那部分。音乐代码应该是这个。 const Discord = requi
我需要帮助在 ffmpeg drawtext 过滤器中正确/(完全)显示德语变音符号“äüö”。我现在不能说我的无能是由于缺乏 ffmpeg 专业知识或机器配置,还是两者兼而有之。非常感谢您的意见。
我是一名优秀的程序员,十分优秀!