在iPhone OS 3中,Apple推出了HTTP Live Streaming,它允许从互联网直播视频.我目前正在运行一个网络摄像头,它将输入到我的服务器中,然后由ffmpeg转换为flv流,然后使用ffserver进行流式传输.有谁知道如何使用ffmpeg和ffserver设置iPhone可以使用的视频流?我应该能够动态地重新编码成任何格式.
尝试在Ubuntu 10.04LTS桌面上使用ffserver时,我收到"与localhost的TCP连接:8090失败:连接被拒绝"错误.
我在打字:
ffmpeg -f video4linux2 -s 640x480 -r 30000/1001 -i/dev/video0 -f avi -vcodec mjpeg -r 30000/1001
http://localhost:8090/feed1.ffm
这是完整的输出:
Input #0, video4linux2, from '/dev/video0':
Duration: N/A, start: 1314207657.841770, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 1280x720 [SAR 96:96 DAR 16:9], -5 kb/s, 30 tbr, 1000k tbn, 30 tbc
[tcp @ 0x9e58980] TCP connection to localhost:8090 failed: Connection refused
[buffer @ 0x9e58260] w:1280 h:720 pixfmt:yuvj420p tb:1/1000000 sar:96/96 sws_param:
Output #0, avi, to 'http://localhost:8090/feed1.ffm':
Metadata:
ISFT : Lavf53.8.0
Stream #0.0: Video: mjpeg, …Run Code Online (Sandbox Code Playgroud) 因此,要在Linux上使用ffmpeg录制网络摄像头视频,您可以使用类似...
ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 out.avi
Run Code Online (Sandbox Code Playgroud)
但是在Mac上这不起作用,所以我想知道你如何用mac上的ffmpeg与isight进行记录?
我已经研究了很多人说它无法完成,但大多数这些帖子都很老了所以我想知道从那以后它是否有所改变.
我已经设置了服务器和视频流,以便我可以使用以下命令行使用ffplay连接到流:
ffplay rtmp://<IP>/path
Run Code Online (Sandbox Code Playgroud)
是否可以使用QMediaPlayer QMediaContent或其他东西连接到此流?
或者也许我可以使用ffserver创建任何其他类型的流.
使用与ffplay相同的路径导致"不支持的url方案!"
通过进一步的实验,我尝试了ffserver http服务器流,但结果是在MFStreamer :: doRead()中Qt崩溃
显然它应该为MFStreamer调用BeginRead,但事实并非如此.
如何使用QMediaPlayer播放视频流?
编辑:这是我的代码
videotest.cpp
#include "videotest.h"
#include <QVBoxLayout>
#include <QVideoWidget>
#include <qmediaplayer.h>
#include <QMediaContent>
#include <QNetworkAccessManager>
#include <QNetworkReply>
struct VideoTest::Private
{
QMediaPlayer * mediaPlayer;
QNetworkAccessManager * networkAccessManager;
QNetworkReply * reply;
};
VideoTest::VideoTest(QWidget *parent)
: QMainWindow(parent)
{
d = new Private;
d->mediaPlayer = new QMediaPlayer(this, QMediaPlayer::StreamPlayback);
d->networkAccessManager = new QNetworkAccessManager(this);
ui.setupUi(this);
QVideoWidget * videoWidget = new QVideoWidget(ui.centralWidget);
videoWidget->show();
QPalette palette = videoWidget->palette();
palette.setColor(QPalette::Background, QColor(0, 0, 0));
videoWidget->setPalette(palette);
ui.videoLayout->addWidget(videoWidget);
d->mediaPlayer->setVideoOutput(videoWidget);
connect(ui.playButton, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ffserver和ffmpeg进行网络摄像头的实时视频流.我在网上找到了一些资源(#1和#2),这或多或少都做同样的事情.
我在运行OS X 10.6.5的MacBook Pro上.网络摄像头是iSight集成摄像头.如果我查看/ dev /我找不到类似于/ dev/video*的内容,那么iSight摄像头的安装位置以及如何在ffmpeg命令中引用它:
ffmpeg -r 15 -s 320x240 -f video4linux -i/dev/video0 http:// localhost:8090/webcam.ffm
有任何想法吗?
我有一个服务器有16个视频采集卡频道进入它并希望用ffmpeg流式传输,是否有可能有另一个流出去,这是16个独特频道的4x4拼贴?
编辑:添加赏金,因为还没有提交工作答案 - 将奖励它到第一个可以显示代码以生成16个实时频道的4x4网格(输入设备为http:// localhost:8090/x.mpg其中x =数字0-15,352x288 MPEG1VIDEO格式视频,YUV420P颜色为24-30FPS) - 或代码引导我到该解决方案 - 输出将位于http:// localhost:8090/all.mpg和将是一个1408x1152英里/加仑的直播.
我试图一个接一个地连接一些mp4文件.我执行以下操作:
ffmpeg -i concat:1.mp4\|2.mp4\|3.mp4\|4.mp4 -c copy final_output.mp4
Run Code Online (Sandbox Code Playgroud)
但总是得到消息"[mov,mp4,m4a,3gp,3g2,mj2 @ 0x148d420]发现重复的MOOV Atom.跳过它"
这是输出:
ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Oct 6 2014 17:33:05 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared --enable-avresample --disable-stripping --enable-gpl --enable-version3 --enable-runtime-cpudetect --build-suffix=.ffmpeg --enable-postproc --enable-x11grab --enable-libcdio --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libfaac --enable-libvo-aacenc --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfdk_aac --enable-libopus --enable-pthreads --enable-zlib --enable-libvpx --enable-libfreetype --enable-libpulse --enable-debug=3
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 …Run Code Online (Sandbox Code Playgroud) I have an EC2 instance with Apache as a reverse proxy and ffserver as a streaming server. There is an ELB (Classic) in front of the EC2 instance which works as an SSL termination point.
Apache configuration is rather simple:
<Location "/mp3/">
ProxyPass http://127.0.0.1:8081/ DisableReuse=On KeepAlive=Off
ProxyPassReverse http://127.0.0.1:8081/
SetEnv force-proxy-request-1.0.1
SetEnv proxy-nokeepalive 1
</Location>
Run Code Online (Sandbox Code Playgroud)
ffserver is used to stream live audio over the Internet. In ffserver's settings there is a MaxBandwidth option (default 1000). This setting become a …
我正在尝试从Logitech C920网络摄像头实时播放本地.H264网络摄像头,从Odroid设备(机器人)通过运行在单独服务器(CentOS 7.1)上的ffserver到用户浏览器,而无需重新连接.H264视频源.
在浏览器中使用实时视频源是一项挑战,所以现在我只是想让Odroid上的Logitech C920网络摄像头通过ffserver将其原生的.H264实时视频源流式传输到用户而无需用户在此过程中重新编码视频.显然,我想避免重新编码,因为这会花费太多CPU时间并且会杀死实时视频源.稍后我可能需要将容器更改为.flv或rtp,因此可以通过浏览器以实时方式播放.我正在使用Logitech C920网络摄像头,因为它可以在硬件上进行.H264编码.(它已经通过直接保存文件进行了测试,除了与Linux内核错误相关的众所周知的"急躁"问题外,它还可以运行:http://sourceforge.net/p/linux-uvc/mailman/message/33164469/,但这是一个不同的故事)
问题是,然而我设置了ffmpeg-ffserver,只要ffserver在图片中,feed就会被重新编码 - 甚至从h264(本机)到h264(libx264) - 在Odroid设备上占用100%的CPU并引入视频输入有很大的延迟.
下面是我的ffmpeg和ffserver设置.
来自Odroid设备的Ffmpeg将.H264源流式传输到ffserver
$ ffmpeg -s 1920x1080 -f v4l2 -vcodec h264 -i /dev/video0 -copyinkf -vcodec copy http://xxxyyyy.com:8090/feed1.ffm
ffmpeg version N-72744-g653bf3c Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu/Linaro 4.8.2-19ubuntu1)
configuration: --prefix=/home/odroid/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/odroid/ffmpeg_build/include --extra-ldflags=-L/home/odroid/ffmpeg_build/lib --bindir=/home/odroid/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / …Run Code Online (Sandbox Code Playgroud) 我使用ffmpeg和以下命令从相机中获取图像:
ffmpeg -y -f vfwcap -r 25 -i 0 http://10.172.180.235:8090/feed2.ffm
Run Code Online (Sandbox Code Playgroud)
在其他机器上(使用上面提到的ip)我使用以下配置文件运行ffserver:
HttpPort 8090
HttpBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 3000
CustomLog -
<Stream stat.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
ACL allow 10.172.180.199
ACL allow 10.172.180.216
ACL allow 10.172.180.215
</Stream>
<Feed feed2.ffm>
File /tmp/feed2.ffm
FileMaxSize 1G
ACL allow 127.0.0.1
ACL allow 10.172.180.199
ACL allow 10.172.180.216
ACL allow 10.172.180.236
ACL allow 10.172.180.109
</Feed>
<Stream live.flv>
Format flv
Feed feed2.ffm
VideoCodec libx264
VideoFrameRate 30
VideoBitRate 800
VideoSize 1280x720 …Run Code Online (Sandbox Code Playgroud)