AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 5953
In Process
tommed
tommed
Asked: 2010-10-12 04:16:33 +0800 CST2010-10-12 04:16:33 +0800 CST 2010-10-12 04:16:33 +0800 CST

我怎样才能让 ffserver 工作?

  • 772

我有一个 mp4 文件,我希望通过 RTSP 对其进行压缩、调整大小和流式传输。

我的 ffserver.conf 文件如下所示:

Port 9091
RTSPPort 5454
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
NoDaemon

<Feed feed1.ffm> File /tmp/feed1.ffm FileMaxSize 500M </Feed>

<Stream live.mpeg> Format rtp File "/tmp/rtp.mp4" Feed feed1.ffm VideoCodec mpeg2video VideoFrameRate 15 VideoBitRate 200 VideoSize 400x320 #AudioCodec mp2 #AudioBitRate 32 #AudioChannels 2 #AudioSampleRate 22050 NoAudio #Preroll 10 ACL allow 127.0.0.1 </Stream>

<Stream stat.html> Format status # Only allow local people to get the status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 </Stream>

据我了解,我不需要使用 ffmpeg 输入视频流,因为我正在使用 File 属性,所以 ffserver 为我工作?

当我尝试使用 totem 播放视频时(ffplay 只是超时),我收到以下错误:

$ totem rtsp://127.0.0.1:5454/live.mpeg
** Message: Error: Could not read from resource.
gstrtspsrc.c(4408): gst_rtspsrc_send (): /GstPlayBin2:play/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Got error response: 454 (Session Not Found).

ffserver 的日志是这样的:

$ ffserver -f /tmp/ffserver.conf 
FFserver version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Oct  5 2010 22:36:53 with gcc 4.4.5
  configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  WARNING: library configuration mismatch
  libavutil   configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --enable-shared --disable-static
  libavcodec  configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --enable-shared --disable-static
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
Sun Oct 10 12:37:20 2010 FFserver started.
Sun Oct 10 12:38:34 2010 127.0.0.1 - - [DESCRIBE] "rtsp://127.0.0.1:5454/live.mpeg RTSP/1.0" 200 166
Sun Oct 10 12:38:38 2010 127.0.0.1:51118 - - "PLAY live.mpeg/streamid=0 RTP/UDP"
Sun Oct 10 12:38:38 2010 127.0.0.1 - - [] " RTP/UDP" 200 0
Sun Oct 10 12:38:43 2010 127.0.0.1 - - [TEARDOWN] "rtsp://127.0.0.1:5454/live.mpeg RTSP/1.0" 200 819
Sun Oct 10 12:38:43 2010 127.0.0.1:0 - - "PLAY live.mpeg/streamid=0 RTP/TCP"
Sun Oct 10 12:38:43 2010 127.0.0.1 - - [] " RTP/TCP" 200 0
Sun Oct 10 12:38:54 2010 127.0.0.1 - - [PLAY] "rtsp://127.0.0.1:5454/live.mpeg RTSP/1.0" 200 621

我究竟做错了什么?

video multimedia ffmpeg
  • 1 1 个回答
  • 11107 Views

1 个回答

  • Voted
  1. taneli
    2011-08-12T04:33:53+08:002011-08-12T04:33:53+08:00

    您可以使用 gstreamer 实现调整大小、重新编码为 mpeg2 和 RTSP 流,但我没有设法更改帧速率。如果这足够了,方法如下:

    • 安装 gst RTSP 服务器开发包:sudo apt-get install libgstrtspserver-0.10-dev
    • 获取此示例启动器的副本
    • 编译它gcc -o test-launch $(pkg-config --cflags --libs gstreamer-0.10 gst-rtsp-server-0.10) test-launch.c
    • 开始流式传输:./test-launch "( filesrc location=/tmp/rtp.mp4 ! decodebin ! videoscale ! video/x-raw-yuv,width=400,height=320 ! ffenc_mpeg2video ! mpegtsmux ! rtpmp2tpay name=pay0 pt=96 )"
    • 看视频:gst-launch-0.10 rtspsrc location=rtsp://127.0.0.1:8554/test ! decodebin ! xvimagesink

    一些警告:

    • 要更改端口,您必须gst_rtsp_server_set_port(server, 9091);在 test-launch.c 中的第 44 行和第 45 行之间添加一个调用
    • totem 读取流,但不显示任何内容,甚至不显示错误消息
    • mplayer 不支持流类型
    • 2

相关问题

  • 断断续续的视频播放[关闭]

  • 为什么默认不包含多媒体编解码器?

  • 帮助让 Flash 播放器在第二个屏幕上工作?

  • Ubuntu 和交互式媒体安装

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何安装 .run 文件?

    • 7 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    如何获得 CPU 温度?

    • 21 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Marko Smith

    如何使用命令行将用户添加为新的 sudoer?

    • 7 个回答
  • Marko Smith

    更改文件夹权限和所有权

    • 9 个回答
  • Marko Smith

    你如何重新启动Apache?

    • 13 个回答
  • Marko Smith

    如何卸载软件?

    • 11 个回答
  • Marko Smith

    如何删除 PPA?

    • 26 个回答
  • Martin Hope
    NES 如何启用或禁用服务? 2010-12-30 13:03:32 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    Olivier Lalonde 如何在结束 ssh 会话后保持进程运行? 2010-10-22 04:09:13 +0800 CST
  • Martin Hope
    David B 如何使用命令行将用户添加为新的 sudoer? 2010-10-16 04:02:45 +0800 CST
  • Martin Hope
    Hans 如何删除旧内核版本以清理启动菜单? 2010-08-21 19:37:01 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve