5

我曾尝试使用http live streamingWindowsffmpeg构建(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

此错误消息是什么意思以及如何解决?

4

1 回答 1

10
stream%05d.ts

对于 Windows,%0是脚本的名称,在您的情况下是tes.bat. 也许你需要%像这样逃避

stream%%05d.ts

忽略批处理文件中的百分号

于 2013-04-20T16:08:41.673 回答