ffmpeg无法为输出文件#0写入标头 [英] ffmpeg Could not write header for output file #0
本文介绍了ffmpeg无法为输出文件#0写入标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
行
ffmpeg -f h264 -i pipe111.fifo -c:v copy -f mp4 -
给出错误:
Input #0, h264, from 'pipe111.fifo':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 480x270, 6 fps, 6 tbr, 1200k tbn, 12 tbc
[mp4 @ 0x1562130] muxer does not support non seekable output
Output #0, mp4, to 'pipe:':
Metadata:
encoder : Lavf56.9.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 480x270, q=2-31, 6 fps, 1200k tbn, 1200k tbc
Stream #0:0 -> #0:0 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
但是
ffmpeg -f h264 -i pipe111.fifo -c:v copy -f mp4 /some/file/in/fs.mp4
正常工作.为什么?没有错误.
works correctly. Why? NO ERROR.
推荐答案
Due to this question is still popular I want to write a quick answer from here https://superuser.com/questions/760056/receiving-ffmpeg-error-22-when-piping-data-to-stdout
mp4容器需要具有在文件中进行搜索的能力.管道是一条小溪,不可能在其中寻找.尝试使用诸如ts或flv之类的流容器.
the mp4 container requires the ability to seek within the file. A pipe is a stream, and impossible to seek inside of. Try using a streaming container like ts, or flv.
这篇关于ffmpeg无法为输出文件#0写入标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文