ffmpeg投掷“;输出文件“0不包含任何流”;尝试用图像制作幻灯片时

ffmpeg投掷“;输出文件“0不包含任何流”;尝试用图像制作幻灯片时,ffmpeg,phantomjs,video-streaming,rtmp,Ffmpeg,Phantomjs,Video Streaming,Rtmp,我正在尝试使用phantomjs创建视频流,phantomjs从url创建屏幕截图,然后它将帧传输到ffmpeg,这样他就可以使用它将视频流传输到rtmp url。 以下是我迄今为止所做的尝试: phantomjs runner.js | ffmpeg -f image2pipe -vcodec png -c:a copy -c:v libx264 -f flv rtmp://localhost/mystream 下面是脚本: var page = require('webpage').c

我正在尝试使用phantomjs创建视频流,phantomjs从url创建屏幕截图,然后它将帧传输到ffmpeg,这样他就可以使用它将视频流传输到rtmp url。 以下是我迄今为止所做的尝试:

phantomjs runner.js | ffmpeg -f image2pipe  -vcodec png -c:a copy -c:v libx264  -f flv rtmp://localhost/mystream
下面是脚本:

var page = require('webpage').create();
page.viewportSize = { width: 640, height: 480 };

page.open('http://www.goodboydigital.com/pixijs/examples/12-2/', function () {
  setInterval(function() {
    page.render('/dev/stdout', { format: "png" });
  }, 25);
});
这是输出:

ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.29)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Output #0, flv, to 'rtmp://localhost/mystream':
Output file #0 does not contain any stream

您当前的命令没有指定任何输入,因此请使用

phantomjs runner.js | ffmpeg -f image2pipe -i pipe:.png -c:a copy -c:v libx264  -f flv rtmp://localhost/mystream
没有音频输入,因此设置音频编解码器是毫无意义的。如果输出需要音频流,请使用

phantomjs runner.js | ffmpeg -f image2pipe -i pipe:.png -f lavfi -i anullsrc -c:v libx264 -c:a aac -f flv rtmp://localhost/mystream

真正的问题是什么?你想解决什么问题?@LordNeckbeard我想从url截图创建一个视频,然后将其发布到rtmp服务器。基本上,phantomjs完成了截图并将其渲染到“/dev/stdout”的过程,因此我可以通过ffmpeg获得它们。我尝试了上面的命令,但它不起作用当我问问题时,一定要解释它不起作用的精确性,否则它是重复的。“它不起作用”永远不是一个很好的堆栈溢出问题描述。我会让错误信息在问题中更加突出。你有没有在谷歌上搜索错误信息,看看其他人都做了些什么来解决这个问题我对题目提出了一个建议,看看吧。是的,这正是我需要的。谢谢我可以使用jpg而不是png吗?非常感谢。同样,
flac
mp3
的选项是:
cat-input | ffmpeg-i管道:.flac-qscale:a 0“outputfile.mp3