【发布时间】:2015-04-10 17:09:44
【问题描述】:
我想流式传输 mp4,为此我阅读了有关 ffserver 的信息。
所以我搜索并阅读了 ffserver 文档,但仍然无法流式传输一个简单的文件。
为此,我做了这些:
1-A win 8 和最后安装的 VLC。
2-A Ubuntu 13 和最后一个 ffmpeg 包。
3-保存到 /etc/ 并从 http://ffmpeg.org/sample.html 复制的 ffserver.conf 文件(我只是将文本复制到新文件中)。
4-运行这个命令:ffserver -f /etc/ffconfig.conf 这是结果:
avserver version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers
built on Jul 15 2014 13:53:49 with gcc 4.8.1
Tue Feb 10 07:29:07 2015 AVserver started.
5-检查 http://localhost:8090/stat.html 并且服务器状态正常。它显示了 4 个流:test1.mpg、test.asf、stat.html、index.html。
6-运行这个命令:ffmpeg -i test.mp4 http://localhost:8090/feed1.ffm 这是结果:
ffmpeg version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers
built on Jul 15 2014 13:53:49 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2015-02-05 20:35:09
Duration: 00:21:36.12, start: 0.000000, bitrate: 788 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 720x404, 677 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
Metadata:
creation_time : 2015-02-05 17:05:45
Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 106 kb/s
Metadata:
creation_time : 2015-02-05 20:35:12
Incompatible sample format '(null)' for codec 'mp2', auto-selecting format 's16'
Last message repeated 1 times
Incompatible sample format '(null)' for codec 'libmp3lame', auto-selecting format 's16'
[buffer @ 0x900f0c0] w:720 h:404 pixfmt:yuv420p
[scale @ 0x8ea5080] w:720 h:404 fmt:yuv420p -> w:160 h:128 fmt:yuv420p flags:0x4
[buffer @ 0x8ea34a0] Invalid pixel format string '-1'
Error opening filters!
7-我查看错误,但找不到发生这种情况的原因以及哪里出错了!
到目前为止,我阅读了许多有关 ffserver 的示例和教程,但其中大部分是关于直播的,但我只想流式传输一些 mp4 文件。
编辑:
我像这个链接一样安装了真正的 ffmpeg:https://askubuntu.com/questions/373322/how-to-replace-avconv-with-the-real-ffmpeg-and-have-it-work-right 但同样的错误(只需将 ppa 更改为 ppa:mc3man/trusty-media 以获取最新版本):
pp@ubuntu:~$ ffmpeg -i big.mp4 http://localhost:8090/feed1.ffm
ffmpeg version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers
built on Jul 15 2014 13:53:49 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2015-02-05 20:35:09
Duration: 00:21:36.12, start: 0.000000, bitrate: 788 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 720x404, 677 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
Metadata:
creation_time : 2015-02-05 17:05:45
Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 106 kb/s
Metadata:
creation_time : 2015-02-05 20:35:12
Incompatible sample format '(null)' for codec 'mp2', auto-selecting format 's16'
Last message repeated 1 times
Incompatible sample format '(null)' for codec 'libmp3lame', auto-selecting format 's16'
[buffer @ 0xa04e0c0] w:720 h:404 pixfmt:yuv420p
[scale @ 0x9ee4080] w:720 h:404 fmt:yuv420p -> w:160 h:128 fmt:yuv420p flags:0x4
[buffer @ 0x9ee24a0] Invalid pixel format string '-1'
Error opening filters!
谁能给我确切的命令,我应该运行以进行测试?
(我知道这就像初学者的问题,但我阅读了文档并尽我所能测试了所有内容,但仍然没有运气)
【问题讨论】:
-
正如输出所提到的,您运行的不是 FFmpeg 而是 avconv,因为 Ubuntu 安装的是 avconv 而不是 FFmpeg。不过,我不知道这是否会导致您的问题。
-
我像这个链接一样安装了真正的 ffmpeg:askubuntu.com/questions/373322/… 但同样的错误
-
请显示最近 ffmpeg 的命令行输出。
-
您的第二个控制台输出也来自古老的分叉版本。
-
!正如我所说,我像askubuntu.com/questions/373322/… 一样完成了这项工作并测试了 3 次。你知道获得真正 ffmpeg 的更好方法吗?
标签: ubuntu ffmpeg streaming video-streaming ffserver