- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想获取实时流数据(使用 mediasuop)并通过 ffmpeg 将其发送到 nginx-rtmp-server,但是如果我通过管道运行它,则会在记录后出现错误,如下所示。我通过OBS studio程序检查了rtmp服务器是否运行良好,但是当我使用我准备好的管道运行时,出现错误。你知道这个问题发生在哪里吗?
管道有问题? Sdp有问题吗?或者是其他东西?
我的管道
ffmpeg
-loglevel
debug
-nostdin
-protocol_whitelist
file,pipe,udp,rtp,rtmp
-analyzeduration 30M
-probesize
30M
-f
sdp
-i
pipe:0
-map 0:v:0
-c:v copy -map
0:a:0 -strict -2
-c:a aac
-flags +global_headers
{filePath}.flv
-pix_fmt
yuv420p
-preset
ultrafast
-use_wallclock_as_timestamps
1
-tune zerolatency
-qmin 2
-qmax 51
-muxrate 1300k
-sdp_file {file}.sdp
-r 30
-b:v 1000k
-bufsize 3000k
-minrate 500k
-maxrate 2000k
-qscale 3
-threads 4
-b:a 128k
-framerate 30
-g 50
-crf 30
-ar 44100
-s 400x700
-f
flv
rtmp://{rtmpServerUri}
和我的 sdp 文件
v=0
o=- 0 0 IN IP4 127.0.0.1
s=FFmpeg
c=IN IP4 127.0.0.1
t=0 0
m=video 23490 RTP/AVP 101
a=rtpmap:101 VP8/90000
a=sendonly
m=audio 29773 RTP/AVP 100
a=rtpmap:100 opus/48000/2
a=sendonly
和错误日志
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 12.0.5 (clang-1205.0.22.9)
' libavutil 56. 70.100 / 56. 70.100\n' +
' libavcodec 58.134.100 / 58.134.100\n' +
' libavformat 58. 76.100 / 58. 76.100\n' +
' libavdevice 58. 13.100 / 58. 13.100\n' +
' libavfilter 7.110.100 / 7.110.100\n' +
' libavresample 4. 0. 0 / 4. 0. 0\n' +
' libswscale 5. 9.100 / 5. 9.100\n' +
' libswresample 3. 9.100 / 3. 9.100\n' +
' libpostproc 55. 9.100 / 55. 9.100\n' +
"Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'
"Reading option '-nostdin' ... matched as option 'stdin' (enable or disable interaction on standard input) with argument 0"
"Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,pipe,udp,rtp,rtmp'"
"Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '30M'"
"Reading option '-probesize' ... matched as AVOption 'probesize' with argument '30M'"
"Reading option '-f' ... matched as option 'f' (force format) with argument 'sdp'"
"Reading option '-i' ... matched as input url with argument 'pipe:0'"
"Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:v:0'"
"Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'"
"Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:a:0'"
"Reading option '-strict' ..."
Routing option strict to both codec and muxer layer
matched as AVOption 'strict' with argument '-2'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+global_header'.
Reading option '{filePath}.flv' ... matched as output url." +
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'"
Reading option '-preset' ... matched as AVOption 'preset' with argument 'ultrafast'."
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'."
Reading option '-tune' ... matched as AVOption 'tune' with argument 'zerolatency'."
Reading option '-qmin' ... matched as AVOption 'qmin' with argument '2'."
Reading option '-qmax' ... matched as AVOption 'qmax' with argument '51'."
Reading option '-muxrate' ... matched as AVOption 'muxrate' with argument '1300k'."
Reading option '-sdp_file' ... matched as option 'sdp_file' (specify a file in which to print sdp information) with argument '{filename}.sdp'."
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '30'"
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1000k
Reading option '-bufsize' ... matched as AVOption 'bufsize' with argument '3000k'
Reading option '-minrate' ... matched as AVOption 'minrate' with argument '500k'
Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '2000k'
Reading option '-qscale' ... matched as option 'qscale' (use fixed quality scale (VBR)) with argument '3'
Reading option '-threads' ... matched as AVOption 'threads' with argument '4
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '30'
Reading option '-g' ... matched as AVOption 'g' with argument '50'
Reading option '-crf' ... matched as AVOption 'crf' with argument '30'
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '44100
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '400x700'
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp:{rtmpserver} ' ... matched as output url
Finished splitting the commandline.\n' +
Parsing a group of options: global .\n' +
Applying option loglevel (set logging level) with argument debug.\n' +
Applying option nostdin (enable or disable interaction on standard input) with argument 0.\n' +
Applying option sdp_file (specify a file in which to print sdp information) with argument {filename}.sdp
Successfully parsed a group of options
Parsing a group of options: input url pipe:0
Applying option f (force format) with argument sdp.
Successfully parsed a group of options
Opening an input file: pipe:0.
[sdp @ 0x12e008e00] Opening 'pipe:0' for reading
[sdp @ 0x12e008e00] video codec set to: vp8\n' +
[sdp @ 0x12e008e00] audio codec set to: opus\n' +
[sdp @ 0x12e008e00] audio samplerate set to: 48000\n' +
[sdp @ 0x12e008e00] audio channels set to: 2\n' +
[udp @ 0x12c610b70] end receive buffer size reported is 393216\n' +
[udp @ 0x12c610c30] end receive buffer size reported is 393216\n' +
[sdp @ 0x12e008e00] setting jitter buffer size to 500\n' +
[udp @ 0x12c611290] end receive buffer size reported is 393216\n' +
[udp @ 0x12c611330] end receive buffer size reported is 393216\n' +
[sdp @ 0x12e008e00] setting jitter buffer size to 500\n' +
[sdp @ 0x12e008e00] Before avformat_find_stream_info() pos: 310 bytes read:310 seeks:0 nb_streams:2\n'
[sdp @ 0x12e008e00] Could not find codec parameters for stream 0 (Video: vp8, 1 reference frame, yuv420p): unspecified size\n' +
"Consider increasing the value for the 'analyzeduration' (30000000) and 'probesize' (30000000) options
'Codec AVOption qmin (minimum video quantizer scale (VBR)) specified for output file #1 (rtmp:{rtmpserver}) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream
[rtmp @ 0x11c604310] No default whitelist set
[rtmp @ 0x11c604310] No default whitelist set
Starting connection attempt to {server} port 1935
[tcp @ 0x10c6054a0] Successfully connected to {server} port 1935
[rtmp @ 0x11c604310] Handshaking...
[rtmp @ 0x11c604310] Proto = rtmp, path = {serverpath}, app = live, fname = {filename}'
[rtmp @ 0x11c604310] Window acknowledgement size = 5000000
[rtmp @ 0x11c604310] Max sent, unacked = 5000000
[rtmp @ 0x11c604310] New incoming chunk size = 4096
[rtmp @ 0x11c604310] Releasing stream
[rtmp @ 0x11c604310] FCPublish stream
[rtmp @ 0x11c604310] Creating stream
[rtmp @ 0x11c604310] Sending publish command for {filename}
Successfully opened the file
Stream mapping
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (opus (native) -> aac (native)
Stream #0:1 -> #1:0 (opus (native) -> mp3 (libmp3lame)
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
pipe:0: Operation timed out
cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:3] (this is harmless if it occurs once at the start per stream)
cur_dts is invalid st:1 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
detected 8 logical cores
[graph_0_in_0_1 @ 0x10c605b50] Setting 'time_base' to value '1/48000
[graph_0_in_0_1 @ 0x10c605b50] Setting 'sample_rate' to value '48000'
[graph_0_in_0_1 @ 0x10c605b50] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_1 @ 0x10c605b50] Setting 'channel_layout' to value '0x3'
[graph_0_in_0_1 @ 0x10c605b50] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format_out_0_1 @ 0x10c605ea0] Setting 'sample_fmts' to value 'fltp'
[format_out_0_1 @ 0x10c605ea0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x12d204de0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
//// error ////
[flv @ 0x10c80aa00] dimensions not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1
[AVIOContext @ 0x10c6040a0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x10c6040a0] Statistics: 0 seeks, 0 writeouts
[rtmp @ 0x11c604310] UnPublishing stream
[rtmp @ 0x11c604310] Deleting stream
[aac @ 0x10c80ce00] Qavg: nan\n']
[AVIOContext @ 0x12d005120] Statistics: 310 bytes read, 0 seeks
Conversion failed!
如果你能告诉我为什么不,我将不胜感激......
最佳答案
你可以试试 实时在过滤器中,最好的直播到 YouTube:
-af asetpts=PTS/1,arealtime,asetpts=PTS*1
关于ffmpeg - 如何为流式传输配置 ffmpeg 管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68160860/
我一直在做一些关于测量数据传输延迟的实验 CPU->GPU 和 GPU->CPU。我发现对于特定消息大小,CPU->GPU 数据传输速率几乎是 GPU->CPU 传输速率的两倍。谁能解释我为什么会这样
我将 ElasticSearch 用作我的 Post 模型的 Rails pet 项目应用程序的全文引擎。在我的 posts_controller.rb 索引操作中: def index
概述 流经网络的数据总是具有相同的类型:字节,这些字节如何传输主要取决于我们所说的网络传输。用户并不关心传输的细节,只在乎字节是否被可靠地发送和接收 如果使用 Java 网络编程,你会发现,某些时候当
我正在编写一些代码,以便将共享点从该页面转移到另一个页面: Server.Transfer("/DefectManagement/DefectList/default.aspx") 但是我遇到了这个问
我有这个泄漏,任何猜测?这个类有一些奇怪的引用。我的代码的任何地方都没有 contentobserver In com.example:1.5.0:27. com.example.ui.record
我听说过点对点内存传输并阅读了一些关于它的内容,但无法真正理解与标准 PCI-E 总线传输相比它的速度有多快。 我有一个使用多个 GPU 的 CUDA 应用程序,我可能对 P2P 传输感兴趣。我的问题
ftping 文件时,Transmit 中是否有忽略或过滤器列表?我希望它忽略上传 .svn 文件等。 最佳答案 是的。转到首选项并选择 Rules标签。在那里您可以定义要跳过哪些文件的规则。实际上,
我有以下片段来生成声音,在 while 循环中,我想动态更改它,以便它在声音生成期间创建不同频率的声音。 for(uint16_t i = 0; i < sample_N; i++) { da
我正在尝试使用 Delphi 2010 和 Indy 对 Web 服务进行概念验证。我此时的代码是: procedure TForm1.Log(const sEvent, sMsg: String);
我有一个 ActiveMQ JMS 代理,在端口 61616 上使用默认的 openwire TCP 传输公开。 我有许多远程客户端可以绑定(bind)到此代理来监听他们的消息。 如果我想打开 kee
reconnection strategies文档仅使用 JMS 示例,但是 FTP transport documentation确实说明了重新连接策略的使用,但没有任何细节或示例。 进一步,如果你
我有 2 个 TreeView,第一个填充有项目。 try { CheckBoxTreeItem treeRoot = new CheckBoxTreeItem("Root"); tr
在我为学校开发的一个网站上,用户输入他们的学校电子邮件和密码,如果他们已注册,则登录。如果没有,则会显示登录的第二部分,要求输入笔名称并确认密码。正因为如此,以及我复杂的业余 Django 编程,我有
我正在开发一个 Web 服务,我们在其中使用 LINQ-to-SQL 进行数据库抽象。当客户使用我们的网络服务时,对象被序列化为 XML,一切都很好。 现在我们希望开发我们自己的使用本地数据类型的客户
我应该创建一个名为“Backwards”的方法,该方法将列表从尾部横向到头部,但是当我运行代码时,它出现说(第 88 行)它找不到光标 = cusor.prev;象征。我需要在循环中再次设置上一个链接
给定像 Uint8Array 这样的类型化数组,似乎有两种方法可以通过 worker 传输它们。 选项 1 直接发送缓冲区并在接收端进行转换: 发件人:postMessage({fooBuffer:
在 PHP + jQuery 环境中,我和我的 friend 无法得出最佳解决方案。我们正在使用 Ajax 从数据库中获取数据。 解决方案 1 - Ajax 应该只传输数据,而不是 HTML 好处:我
大家好,非常感谢您的宝贵时间。 有一个 std::stringstream 需要传输到远程机器。网络库允许我用以下方法构建数据包: CreatePacket( const void * DATA, s
我正在使用 libcurl 通过 FTP 传输二进制文件 (.exe),并将其保存到本地文件。问题是文件传输后,它已被更改,不再是有效的 Win32 应用程序,因此无法运行。这是我的做法: CURL
各位程序员, 当我将它上传到我的 FTP 时,我的网站出现此错误:资源被解释为样式表,但使用 MIME 类型文本/纯文本传输 BlahBlahi
我是一名优秀的程序员,十分优秀!