我尝试将http live streaming
用于ffmpeg
windows build(http://ffmpeg.zeranoe.com/builds/)
这是命令
ffmpeg.exe -v 9 -loglevel 99 -re -i tes.avi -an ^
-c:v libx264 -b:v 128k -preset medium ^
-flags -global_header -map 0 -f segment -segment_time 4 ^
-segment_list test.m3u8 -segment_format mpegts stream%^05d.ts
但是出现了错误消息,
[segment @ 045f5840] Codec for stream 0 does not use global headers but container format requires global headers
[segment @ 045f5840] Selected stream id:0 type:video
[mpegts @ 062f2540] Invalid segment filename template 'stream05d.ts'
[AVIOContext @ 04a90e00] Statistics: 0 seeks, 0 writeouts
Output #0, segment, to 'stream05d.ts':
Metadata:
encoder : Lavf55.2.100
Stream #0:0, 0, 1/90000: Video: h264, yuv420p, 720x400 [SAR 1:1 DAR 9:5], 10
01/24000, q=-1--1, 128 kb/s, 90k tbn, 23.98 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 -> libx264)
Could not write header for output file #0 (incorrect codec parameters ?): Invali
d argument
[AVIOContext @ 0215a3e0] Statistics: 3028576 bytes read, 88 seeks
此错误消息的含义是什么以及如何解决?
答案 0 :(得分:7)
stream%05d.ts
对于Windows,%0
是脚本的名称,在您的情况下为tes.bat
。也许你需要像这样逃避%
stream%%05d.ts