ffmpeg管道:0:找不到编解码器参数 [英] ffmpeg pipe:0: could not find codec parameters

查看:438
本文介绍了ffmpeg管道:0:找不到编解码器参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行此命令时,出现错误.如果我不用管道就可以运行.

When i run this command i get an error. If i run without the pipe, it works.

cat mymovie.m4v | ffmpeg -i pipe:0 -an -analyzeduration 1000000 -f image2 -vf 
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'

没有管道(工程)

ffmpeg -i mymovie.m4v -an -analyzeduration 2147483647 -probesize 2147483647 -f image2 -vf 
"select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr 'public/files/thumb%04d.png'

输出

ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 10 2014 17:50:46 with Apple LLVM version 5.1 (clang-503.0.38) 
(based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2 
--enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree 
--enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang 
--host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame 
--enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis 
--enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex 
--enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r 
--enable-libopenjpeg --extra-cflags='-

I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 '
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd87b80f000] stream 0, offset 0x2c: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fd87b80f000] Could not find codec parameters for stream 0
(Video: h264 (avc1 / 0x31637661), 1280x720, 3310 kb/s): unspecified pixel format

考虑增加"analyzeduration"和"probesize"选项的值 pipe:0:找不到编解码器参数

Consider increasing the value for the 'analyzeduration' and 'probesize' options pipe:0: could not find codec parameters

我尝试设置(链接)

-analyzeduration100 -probesize 10000000 
-analyzeduration 2147483647 -probesize 2147483647

还是没用.

推荐答案

MP4容器不是管道安装的最佳选择.制作MP4文件的多路复用器可能会将某些信息放在文件末尾.该信息对于正确的脱胶是必需的,但是如果使用管道则无法立即获得.但是,您有一些选择:

MP4 container is not the best choice for piping. The muxer that made the MP4 file may place certain info at the end of the file. This info is required for proper demuxing, but is not immediately available if using a pipe. However, you have a few options:

我不知道为什么首先需要使用管道.只需将文件用作常规输入即可:

I don't know why you need to use a pipe in the first place. Just use the file as a normal input:

ffmpeg -i input.mp4 ...

不要使用MP4

如果必须使用管道,请考虑使用其他容器,例如.mkv.ts作为输入.

如果必须使用MP4,则一种方法是重新排列 moov 原子,使其位于文件的开头:

If you must use MP4 then one method is to re-arrange the moov atom so it is at the beginning of the file:

ffmpeg -i input.mp4 -c copy -movflags +faststart output.mp4

这篇关于ffmpeg管道:0:找不到编解码器参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆