我曾尝试将 http live streaming
与 ffmpeg
窗口构建( 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
此错误消息是什么意思以及如何解决?
最佳答案
stream%05d.ts
对于 Windows,
%0
是脚本的名称,在您的情况下是 tes.bat
。也许你需要像这样逃避 %
stream%%05d.ts
Ignore percent sign in batch file
关于video - ffmpeg:无效的段文件名模板 'stream05d.ts',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16120124/