由于未指定像素格式,无法创建 ffmpeg、破折号清单
ffmpeg, dash manifest cannot be created due to unspecified pixel format
我在 OSX.
上使用 ffmpeg 2.8
我尝试将一个简短的 mp4 视频转换为 webm 以进行自适应流式传输,就像这里建议的那样 http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash 像这样:
VP9_DASH_PARAMS="-tile-columns 6 -frame-parallel 1"
ffmpeg -i t2.mp4 -c:v libvpx-vp9 -s 160x90 -b:v 250k -keyint_min 150 -g 150 ${VP9_DASH_PARAMS} -an -f webm -dash 1 video_160x90_250k.webm
ffmpeg -i t2.mp4 -c:a libvorbis -b:a 128k -vn -f webm -dash 1 audio_128k.webm
ffmpeg \
-f webm_dash_manifest -i video_160x90_250k.webm \
-f webm_dash_manifest -i audio_128k.webm \
-c copy -map 0 -map 1 \
-f webm_dash_manifest \
-adaptation_sets "id=0,streams=0 id=1,streams=1" \
manifest.mpd
但是这给了我一个警告未指定的像素格式:
[webm_dash_manifest @ 0x7f9414812800] Could not find codec parameters for stream 0 (Video: vp9, none, 160x90): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
video_160x90_250k.webm: could not find codec parameters
Input #0, webm_dash_manifest, from 'video_160x90_250k.webm':
Metadata:
encoder : Lavf56.36.100
Duration: 00:00:09.97, bitrate: 111 kb/s
Stream #0:0: Video: vp9, none, 160x90, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 9969
webm_dash_manifest_initialization_range: 437
webm_dash_manifest_file_name: video_160x90_250k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 139297
webm_dash_manifest_cues_end: 139399
webm_dash_manifest_bandwidth: 99164
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,2085,4171,6256,8342
Input #1, webm_dash_manifest, from 'audio_128k.webm':
Metadata:
encoder : Lavf56.36.100
Duration: 00:00:10.01, bitrate: 120 kb/s
Stream #1:0: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
webm_dash_manifest_duration: 10009
webm_dash_manifest_initialization_range: 4697
webm_dash_manifest_file_name: audio_128k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 151174
webm_dash_manifest_cues_end: 151240
webm_dash_manifest_bandwidth: 105517
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,4999,9998
Output #0, webm_dash_manifest, to 'manifest.mpd':
Metadata:
encoder : Lavf56.36.100
Stream #0:0: Video: vp9, none, 160x90 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 9969
webm_dash_manifest_initialization_range: 437
webm_dash_manifest_file_name: video_160x90_250k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 139297
webm_dash_manifest_cues_end: 139399
webm_dash_manifest_bandwidth: 99164
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,2085,4171,6256,8342
Stream #0:1: Video: vorbis, none, q=2-31, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 10009
webm_dash_manifest_initialization_range: 4697
webm_dash_manifest_file_name: audio_128k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 151174
webm_dash_manifest_cues_end: 151240
webm_dash_manifest_bandwidth: 105517
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,4999,9998
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
然而清单文件已创建。我尝试指定像素格式:
-pix_fmt yuv420p
然而这并没有改变任何东西。警告保持不变。
知道为什么会出现警告以及如何解决这个问题吗?
问题似乎是 ffmpeg
在将 webm_dash_manifest
与 VP9
编解码器一起使用时无法解码几帧以获取像素格式。 VP8
.
没有问题
这发生在 avformat_find_stream_info 函数中:
ret = read_frame_internal(ic, &pkt1);
if (ret == AVERROR(EAGAIN))
continue;
if (ret < 0) {
/* EOF or error*/
break;
}
read_frame_internal()
returns 垃圾并阻止代码到达 try_decode_frame()
部分。
当使用 VP8
时,它直接从编解码器上下文中检索参数:
// Try to just open decoders, in case this is enough to get parameters.
if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
if (codec && !st->codec->codec)
if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
av_log(ic, AV_LOG_WARNING,
"Failed to open codec in av_find_stream_info\n");
}
st->codec-pix_fmt
对于 VP8
是 0
,对于 VP9
是 -1
(未找到)。如果它应该直接从上下文中获取参数,那么 libvpx-vp9
.
可能存在问题
直接对 webm
文件使用 ffprobe
时有效:
ffprobe -i video_160x90_250k.webm
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 160x90, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
该问题似乎不会影响清单创建,因此我想您可以忽略这些警告。
我对 ffmpeg
还不够熟悉,无法提出补丁,因此最好将其作为错误报告在 ffmpeg
跟踪器上:http://ffmpeg.org/pipermail/ffmpeg-user/2015-September/028610.html
我在 OSX.
上使用 ffmpeg 2.8我尝试将一个简短的 mp4 视频转换为 webm 以进行自适应流式传输,就像这里建议的那样 http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash 像这样:
VP9_DASH_PARAMS="-tile-columns 6 -frame-parallel 1"
ffmpeg -i t2.mp4 -c:v libvpx-vp9 -s 160x90 -b:v 250k -keyint_min 150 -g 150 ${VP9_DASH_PARAMS} -an -f webm -dash 1 video_160x90_250k.webm
ffmpeg -i t2.mp4 -c:a libvorbis -b:a 128k -vn -f webm -dash 1 audio_128k.webm
ffmpeg \
-f webm_dash_manifest -i video_160x90_250k.webm \
-f webm_dash_manifest -i audio_128k.webm \
-c copy -map 0 -map 1 \
-f webm_dash_manifest \
-adaptation_sets "id=0,streams=0 id=1,streams=1" \
manifest.mpd
但是这给了我一个警告未指定的像素格式:
[webm_dash_manifest @ 0x7f9414812800] Could not find codec parameters for stream 0 (Video: vp9, none, 160x90): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
video_160x90_250k.webm: could not find codec parameters
Input #0, webm_dash_manifest, from 'video_160x90_250k.webm':
Metadata:
encoder : Lavf56.36.100
Duration: 00:00:09.97, bitrate: 111 kb/s
Stream #0:0: Video: vp9, none, 160x90, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 9969
webm_dash_manifest_initialization_range: 437
webm_dash_manifest_file_name: video_160x90_250k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 139297
webm_dash_manifest_cues_end: 139399
webm_dash_manifest_bandwidth: 99164
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,2085,4171,6256,8342
Input #1, webm_dash_manifest, from 'audio_128k.webm':
Metadata:
encoder : Lavf56.36.100
Duration: 00:00:10.01, bitrate: 120 kb/s
Stream #1:0: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Metadata:
webm_dash_manifest_duration: 10009
webm_dash_manifest_initialization_range: 4697
webm_dash_manifest_file_name: audio_128k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 151174
webm_dash_manifest_cues_end: 151240
webm_dash_manifest_bandwidth: 105517
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,4999,9998
Output #0, webm_dash_manifest, to 'manifest.mpd':
Metadata:
encoder : Lavf56.36.100
Stream #0:0: Video: vp9, none, 160x90 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 9969
webm_dash_manifest_initialization_range: 437
webm_dash_manifest_file_name: video_160x90_250k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 139297
webm_dash_manifest_cues_end: 139399
webm_dash_manifest_bandwidth: 99164
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,2085,4171,6256,8342
Stream #0:1: Video: vorbis, none, q=2-31, 1k tbn, 1k tbc (default)
Metadata:
webm_dash_manifest_duration: 10009
webm_dash_manifest_initialization_range: 4697
webm_dash_manifest_file_name: audio_128k.webm
webm_dash_manifest_track_number: 1
webm_dash_manifest_cues_start: 151174
webm_dash_manifest_cues_end: 151240
webm_dash_manifest_bandwidth: 105517
webm_dash_manifest_cluster_keyframe: 1
webm_dash_manifest_cue_timestamps: 0,4999,9998
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
然而清单文件已创建。我尝试指定像素格式:
-pix_fmt yuv420p
然而这并没有改变任何东西。警告保持不变。
知道为什么会出现警告以及如何解决这个问题吗?
问题似乎是 ffmpeg
在将 webm_dash_manifest
与 VP9
编解码器一起使用时无法解码几帧以获取像素格式。 VP8
.
这发生在 avformat_find_stream_info 函数中:
ret = read_frame_internal(ic, &pkt1);
if (ret == AVERROR(EAGAIN))
continue;
if (ret < 0) {
/* EOF or error*/
break;
}
read_frame_internal()
returns 垃圾并阻止代码到达 try_decode_frame()
部分。
当使用 VP8
时,它直接从编解码器上下文中检索参数:
// Try to just open decoders, in case this is enough to get parameters.
if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
if (codec && !st->codec->codec)
if (avcodec_open2(st->codec, codec, options ? &options[i] : &thread_opt) < 0)
av_log(ic, AV_LOG_WARNING,
"Failed to open codec in av_find_stream_info\n");
}
st->codec-pix_fmt
对于 VP8
是 0
,对于 VP9
是 -1
(未找到)。如果它应该直接从上下文中获取参数,那么 libvpx-vp9
.
直接对 webm
文件使用 ffprobe
时有效:
ffprobe -i video_160x90_250k.webm
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 160x90, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
该问题似乎不会影响清单创建,因此我想您可以忽略这些警告。
我对 ffmpeg
还不够熟悉,无法提出补丁,因此最好将其作为错误报告在 ffmpeg
跟踪器上:http://ffmpeg.org/pipermail/ffmpeg-user/2015-September/028610.html