视频流的FFMPEG选项

视频流的FFMPEG选项,ffmpeg,video-streaming,Ffmpeg,Video Streaming,我正在尝试使用ffmpeg使用ffserver来流式传输视频。下面是ffserver1.conf文件和ffmpeg命令的日志输出 其中一个错误引用了预设,每次尝试使用预设时,即使复制了当前目录中的所有预设文件,也会得到“未找到错误”文件 谢谢你的帮助 约尔茨 FFSERVER-CONF YorgZ Macbook$cat ffserver1.conf 端口8090 BindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 最大带宽40

我正在尝试使用ffmpeg使用ffserver来流式传输视频。下面是ffserver1.conf文件和ffmpeg命令的日志输出

其中一个错误引用了预设,每次尝试使用预设时,即使复制了当前目录中的所有预设文件,也会得到“未找到错误”文件

谢谢你的帮助

约尔茨

FFSERVER-CONF
YorgZ Macbook$cat ffserver1.conf
端口8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
最大带宽4000
自定义日志-
文件feed1.ffm
FileMaxSize 1G
ACL允许127.0.0.1
ACL允许本地主机
ACL允许10.0.0.0 10.0.255.255
饲料1.ffm
格式mp4
视频帧率29.97
视频比特率500
视频大小640x352
格式状态
ACL允许本地主机
ACL允许10.0.0.0 10.0.255.255
YorgZ Macbook$
FFMPEG命令和日志
YorgZ Macbook$./ffmpeg-loglevel debug-i TestStream.mp4-codec:v libx264-b:v 500k-vf“scale=640:352”-r 29.97-codec:a aac-b:a 128khttp://127.0.0.1:8090/feed1.ffm
ffmpeg版本2.1.3-tessus版权所有(c)2000-2013 ffmpeg开发者
基于llvm gcc 4.2.1(llvm构建2336.1.00)于2014年1月16日13:50:59构建
配置:--prefix=/Users/tessus/data/ext/ffmpeg/sw--as=yasm--extra-version=tessus--disable shared--enable static--disable ffplay--enable gpl--enable pthreads--enable postproc--enable-libmp3lame--enable libvorbis--enable libspeex--enable bzlibzlib enable libopencore-amrnb--启用libopencore amrwb--启用libxavs--启用-version3--启用libvo aacenc--启用libvo amrwbenc--启用libvpx--启用libgsm--启用libopus--启用fontconfig--启用libfreetype--启用libass--启用libbluray--启用过滤器--启用运行时cpudetec
libavutil 52.48.101/52.48.101
libavcodec 55.39.101/55.39.101
libav55.19.104/55.19.104格式
libav设备55.5.100/55.5.100
libavfilter 3.90.100/3.90.100
libswscale 2.5.101/2.5.101
libswresample 0.17.104/0.17.104
libpostroc 52.3.100/52.3.100
分割命令行。
读取选项'-loglevel'…与参数'debug'匹配为选项'loglevel'(设置日志级别)。
正在读取选项'-i'…作为输入文件与参数'TestStream.mp4'匹配。
正在读取选项“-codec:v”…与参数“libx264”匹配为选项“codec”(编解码器名称)。
读取选项'-b:v'…与参数为'500k'的选项'b'(视频比特率(请使用-b:v))匹配。
读取选项'-vf'…与参数'scale=640:352'的选项'vf'(设置视频过滤器)匹配。
读取选项'-r'…与参数'29.97'匹配为选项'r'(设置帧速率(Hz值、分数或缩写))。
正在读取选项“-codec:a”…与参数“aac”匹配为选项“codec”(编解码器名称)。
读取选项'-b:a'…与参数为'128k'的选项'b'(视频比特率(请使用-b:v))匹配。
阅读选项'http://127.0.0.1:8090/feed1.ffm“…匹配为输出文件。
已完成命令行的拆分。
解析一组选项:全局。
使用参数debug应用选项loglevel(设置日志级别)。
已成功分析一组选项。
解析一组选项:输入文件TestStream.mp4。
已成功分析一组选项。
打开一个输入文件:TestStream.mp4。
[mov,mp4,m4a,3gp,3g2,mj2@0x10201a200]格式mov,mp4,m4a,3gp,3g2,mj2探测,大小=2048,分数=100
[mov,mp4,m4a,3gp,3g2,mj2@0x10201a200]ISO:文件类型主要品牌:mp42
[mov、mp4、m4a、3gp、3g2、mj2@0x10201a200]avformat_find_stream_info()之前的文件位置为33783
[mov、mp4、m4a、3gp、3g2、mj2@0x10201a200]找到所有信息
[mov、mp4、m4a、3gp、3g2、mj2@0x10201a200]avformat_find_stream_info()之后的文件位置为64138
从“TestStream.mp4”输入#0、mov、mp4、m4a、3gp、3g2、mj2:
元数据:
主要品牌:mp42
次要版本:0
兼容品牌:isommp42
创建时间:2014-02-17 10:17:06
持续时间:00:01:40.10,开始时间:0.000000,比特率:582 kb/s
流#0:0(und),15,1/30000:视频:h264(约束基线)(avc1/0x31637661),yuv420p,640x360[SAR 1:1 DAR 16:9],1001/60000,483 kb/s,29.97 fps,29.97 tbr,30k tbn,59.94 tbc(默认)
元数据:
处理程序名称:VideoHandler
流#0:1(und),1,1/44100:音频:aac(mp4a/0x6134706D),44100赫兹,立体声,fltp,95 kb/s(默认)
元数据:
创建时间:2014-02-17 10:17:06
handler_名称:谷歌制作的IsoMedia文件,5-11-2011
已成功打开该文件。
解析一组选项:输出文件http://127.0.0.1:8090/feed1.ffm.
使用参数libx264应用选项codec:v(编解码器名称)。
使用参数500k应用选项b:v(视频比特率(请使用-b:v))。
应用参数比例为640:352的选项vf(设置视频过滤器)。
使用参数29.97应用选项r(设置帧速率(Hz值、分数或缩写))。
应用选项codec:a(编解码器名称)和参数aac。
使用参数128k应用选项b:a(视频比特率(请使用-b:v))。
已成功分析一组选项。
打开输出文件:http://127.0.0.1:8090/feed1.ffm.
[ffm@0x102037200]探测的ffm格式,大小为2048,分数为101
[AVIOContext@0x101d04fe0]统计信息:读取4096字节,0
2014年2月24日星期一11:53:05 127.0.0.1---[GET]“/feed1.ffm HTTP/1.1”200 4175
已成功打开该文件。
检测到8个逻辑核
[从流0:1@0x101d05a20输入的图形0]将“时间基数”设置为值“1/44100”
[从流0:1@0x101d05a20输入的图形0]将“采样率”设置为值“44100”
[从流0:1@0x101d05a20输入的图形0]将'sample_fmt'设置为值'fltp'
[图0中]
FFSERVER CONF

YorgZ-Macbook$cat ffserver1.conf
Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 4000
CustomLog -


<Feed feed1.ffm>
      File feed1.ffm
      FileMaxSize 1G
      ACL allow 127.0.0.1
      ACL allow localhost
      ACL allow 10.0.0.0 10.0.255.255
</Feed>

<Stream Live.mp4>
    Feed feed1.ffm
    Format mp4
    VideoFrameRate  29.97
    VideoBitRate    500
    VideoSize   640x352
</Stream>

<Stream stat.html>
    Format status
    ACL allow localhost
    ACL allow 10.0.0.0 10.0.255.255
</Stream>
YorgZ-Macbook$

FFMPEG COMMAND AND LOG 

 YorgZ-Macbook$./ffmpeg -loglevel debug -i TestStream.mp4  -codec:v libx264 -b:v 500k  -vf "scale=640:352" -r 29.97 -codec:a aac -b:a 128k http://127.0.0.1:8090/feed1.ffm

    ffmpeg version 2.1.3-tessus Copyright (c) 2000-2013 the FFmpeg developers
      built on Jan 16 2014 13:50:59 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
      configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
      libavutil      52. 48.101 / 52. 48.101
      libavcodec     55. 39.101 / 55. 39.101
      libavformat    55. 19.104 / 55. 19.104
      libavdevice    55.  5.100 / 55.  5.100
      libavfilter     3. 90.100 /  3. 90.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Splitting the commandline.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
    Reading option '-i' ... matched as input file with argument 'TestStream.mp4'.
    Reading option '-codec:v' ... matched as option 'codec' (codec name) with argument 'libx264'.
    Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '500k'.
    Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=640:352'.
    Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '29.97'.
    Reading option '-codec:a' ... matched as option 'codec' (codec name) with argument 'aac'.
    Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'.
    Reading option 'http://127.0.0.1:8090/feed1.ffm' ... matched as output file.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option loglevel (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input file TestStream.mp4.
    Successfully parsed a group of options.
    Opening an input file: TestStream.mp4.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x10201a200] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x10201a200] ISO: File Type Major Brand: mp42
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x10201a200] File position before avformat_find_stream_info() is 33783
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x10201a200] All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x10201a200] File position after avformat_find_stream_info() is 64138
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'TestStream.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 0
        compatible_brands: isommp42
        creation_time   : 2014-02-17 10:17:06
      Duration: 00:01:40.10, start: 0.000000, bitrate: 582 kb/s
        Stream #0:0(und), 15, 1/30000: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1001/60000, 483 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(und), 1, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
        Metadata:
          creation_time   : 2014-02-17 10:17:06
          handler_name    : IsoMedia File Produced by Google, 5-11-2011
    Successfully opened the file.
    Parsing a group of options: output file http://127.0.0.1:8090/feed1.ffm.
    Applying option codec:v (codec name) with argument libx264.
    Applying option b:v (video bitrate (please use -b:v)) with argument 500k.
    Applying option vf (set video filters) with argument scale=640:352.
    Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 29.97.
    Applying option codec:a (codec name) with argument aac.
    Applying option b:a (video bitrate (please use -b:v)) with argument 128k.
    Successfully parsed a group of options.
    Opening an output file: http://127.0.0.1:8090/feed1.ffm.
    [ffm @ 0x102037200] Format ffm probed with size=2048 and score=101
    [AVIOContext @ 0x101d04fe0] Statistics: 4096 bytes read, 0 seeks
    Mon Feb 24 11:53:05 2014 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
    Successfully opened the file.
    detected 8 logical cores
    [graph 0 input from stream 0:1 @ 0x101d05a20] Setting 'time_base' to value '1/44100'
    [graph 0 input from stream 0:1 @ 0x101d05a20] Setting 'sample_rate' to value '44100'
    [graph 0 input from stream 0:1 @ 0x101d05a20] Setting 'sample_fmt' to value 'fltp'
    [graph 0 input from stream 0:1 @ 0x101d05a20] Setting 'channel_layout' to value '0x3'
    [graph 0 input from stream 0:1 @ 0x101d05a20] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3
    [audio format for output stream 0:0 @ 0x102d004e0] Setting 'sample_fmts' to value 's16'
    [audio format for output stream 0:0 @ 0x102d004e0] Setting 'sample_rates' to value '22050'
    [audio format for output stream 0:0 @ 0x102d004e0] Setting 'channel_layouts' to value '0x4'
    [audio format for output stream 0:0 @ 0x102d004e0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
    [AVFilterGraph @ 0x101d03ea0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
    0.500000 0.500000 
    [auto-inserted resampler 0 @ 0x102d00ca0] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:1 chl:mono fmt:s16 r:22050Hz
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'video_size' to value '640x360'
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'pix_fmt' to value '0'
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'time_base' to value '1/30000'
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'pixel_aspect' to value '1/1'
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'sws_param' to value 'flags=2'
    [graph 1 input from stream 0:0 @ 0x103b003a0] Setting 'frame_rate' to value '30000/1001'
    [graph 1 input from stream 0:0 @ 0x103b003a0] w:640 h:360 pixfmt:yuv420p tb:1/30000 fr:30000/1001 sar:1/1 sws_param:flags=2
    [scaler for output stream 0:1 @ 0x103b00900] Setting 'w' to value '640'
    [scaler for output stream 0:1 @ 0x103b00900] Setting 'h' to value '352'
    [scaler for output stream 0:1 @ 0x103b00900] Setting 'flags' to value '0x4'
    [scaler for output stream 0:1 @ 0x103b00900] w:640 h:352 flags:'0x4' interl:0
    [format @ 0x103b00dc0] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16]
    [format @ 0x103b00dc0] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16'
    [AVFilterGraph @ 0x102d00fc0] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
    [scaler for output stream 0:1 @ 0x103b00900] w:640 h:360 fmt:yuv420p sar:1/1 -> w:640 h:352 fmt:yuv420p sar:44/45 flags:0x4
    [libx264 @ 0x102049800] broken ffmpeg default settings detected
    [libx264 @ 0x102049800] use an encoding preset (e.g. -vpre medium)
    [libx264 @ 0x102049800] preset usage: -vpre <speed> -vpre <profile>
    [libx264 @ 0x102049800] speed presets are listed in x264 --help
    [libx264 @ 0x102049800] profile is optional; x264 defaults to high
    Output #0, ffm, to 'http://127.0.0.1:8090/feed1.ffm':
      Metadata:
        major_brand     : mp42
        minor_version   : 0
        compatible_brands: isommp42
        creation_time   : now
        Stream #0:0(und), 0, 1/1000000: Audio: aac (libvo_aacenc), 22050 Hz, mono, s16, 128 kb/s (default)
        Metadata:
          creation_time   : 2014-02-17 10:17:06
          handler_name    : IsoMedia File Produced by Google, 5-11-2011
        Stream #0:1(und), 0, 1/1000000: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x352 [SAR 44:45 DAR 16:9], 1001/30000, q=2-31, 500 kb/s, 1000k tbn, 29.97 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    Stream mapping:
      Stream #0:1 -> #0:0 (aac -> libvo_aacenc)
      Stream #0:0 -> #0:1 (h264 -> libx264)
    Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
    [AVIOContext @ 0x101d04fe0] Statistics: 0 seeks, 0 writeouts
    [AVIOContext @ 0x101d03fa0] Statistics: 65536 bytes read, 0 seeks
    Mon Feb 24 11:53:05 2014 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 0
    YorgZ-Macbook$