你好我已经在ffmpeg安装的官方教程中安装了ffmpeg和libx264: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
我想从mumudvb获取一个流并将其传递给ffmpeg进行h264编码 当我使用
ffserver -f /path/to/config -d
我得到了这个输出:
[h264 @ 0x1ab32c0] non-existing PPS 0 referenced
[mpegts @ 0x2c7cca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[h264 @ 0x1ab32c0] non-existing SPS 0 referenced in buffering period
[h264 @ 0x1ab32c0] non-existing PPS 0 referenced
[h264 @ 0x1ab32c0] decode_slice_header error
[h264 @ 0x1ab32c0] no frame!
[mpegts @ 0x1aadca0]
decoding for stream 0 failed
[mpegts @ 0x1aadca0] decoding for stream 1 failed
Input #0, mpegts, from 'http://127.0.0.1:9097':
Duration: N/A, start: 45508.714822, bitrate: N/A
Program 107
[mpegts @ 0x1aadca0] Stream #0:0[0x42e]: Video: h264 ([27][0][0][0] / 0x001B)[mpegts @ 0x30b0ca0] decoding for stream 1 failed
, 50 fpsitech@itech-All-Series:~$ , 50 tbr, 90k tbn, 180k tbc
[mpegts @ 0x1cd5ca0] Stream #0:1Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[0x42f](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
http://127.0.0.1:8888/tv7.ffm: Input/output error
Input #0, mpegts, from 'http://127.0.0.1:9093':
Duration: N/A, start: 25560.704144, bitrate: N/A
Program 103
Stream #0:0[0x406]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x407](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
Stream #0:2[0x40b](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Received signal 2: terminating.
[mpegts @ 0x30b0ca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
http://127.0.0.1:8888/tv3.ffm: Input/output error
[mpegts @ 0x1aadca0] Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'http://127.0.0.1:9094':
Received signal 2: terminating.
Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Duration: N/A, start: 43409.427056, bitrate: N/A
Program 104
Stream #0:0[0x410]Input #0, mpegts, from 'http://127.0.0.1:9098':
: Video: h264 ([27][0][0][0] / 0x001B), 50 fps, 50 tbr, 90k tbn, 180k tbc
Stream #0:1[0x411](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
Stream #0:2[0x415](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
http://127.0.0.1:8888/tv4.ffm: Input/output error
Received signal 2: terminating.
Duration: N/A, start: 26351.744300, bitrate: N/A
Program 108
Stream #0:0[0x438]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x439](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
Stream #0:2[0x43d](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
http://127.0.0.1:8888/tv8.ffm: Input/output error
Received signal 2: terminating.
ffmpeg将为我输出结果。但问题是输出比特率大约是2000k到3000k,应该是512k
这是我的ffserver配置:
Port 8888
BindAddress 0.0.0.0
MaxHTTPConnections 20000
MaxClients 10000
MaxBandwidth 1000000
CustomLog -
<Feed ch1.ffm>
File /tmp/ch1.ffm
FileMaxSize 100M
ACL allow 127.0.0.1
launch ffmpeg -i http://127.0.0.1:9094
</Feed>
<Stream ch1>
Feed ch1.ffm
Format mpegts
AudioBitRate 64
AudioChannels 2
AudioSampleRate 44100
#AVOptionAudio flags +global_header
VideoBitRate 512
VideoBufferSize 400
VideoFrameRate 25
VideoBitRateTolerance 100
VideoSize 720x576
VideoGopSize 12
AudioCodec aac
VideoCodec libx264
AVOptionVideo bsf h264_mp4toannexb
#AVOptionVideo threads 0
AVOptionVideo threads_type frame
AVOptionVideo coder 0
AVOptionVideo bf 0
AVOptionVideo flags +loop
AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
AVOptionVideo me_method hex
AVOptionVideo subq 7
AVOptionVideo me_range 16
AVOptionVideo g 250
AVOptionVideo keyint_min 10
AVOptionVideo sc_threshold 40
AVOptionVideo i_qfactor 0.71
AVOptionVideo b_strategy 1
AVOptionVideo qcomp 0.6
AVOptionVideo qmin 10
AVOptionVideo qmax 51
AVOptionVideo qdiff 4
AVOptionVideo refs 3
AVOptionVideo directpred 1
AVOptionVideo trellis 1
AVOptionVideo wpredp 0
#AVOptionVideo flags +global_header
StartSendOnKey
</Stream>