简体   繁体   English

通过管道(stdin)将.mov文件发送到ffmpeg

[英]Send .mov file to ffmpeg via pipe (stdin)

If specify file in -i option, ffmpeg successfully handles file: http://pastebin.com/cn4w4aR2 如果在-i选项中指定文件,则ffmpeg成功处理文件: http//pastebin.com/cn4w4aR2

But, if send file to ffmpeg via pipe (to stdin), i receive error stream 1, offset 0x24: partial file : 但是,如果通过管道(到stdin)发送文件到ffmpeg,我收到错误流1,偏移量0x24:部分文件

    serafim@serafim:~/Downloads/mov $ cat RecordedVideo-6sec.MOV | ffmpeg -i pipe:0 -codec copy -bsf h264_mp4toannexb -f hls -hls_list_size 0 -hls_time 5 -y index.m3u8
ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 25 2014 19:47:15 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.3 --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
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc6a4816800] stream 1, offset 0x24: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc6a4816800] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 720x1280, 1068 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2014-10-12 10:51:18
  Duration: 00:00:04.06, bitrate: N/A
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), 720x1280, 1068 kb/s, 24.61 fps, 120 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2014-10-12 10:51:18
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 64 kb/s (default)
    Metadata:
      creation_time   : 2014-10-12 10:51:18
      handler_name    : Core Media Data Handler
[mpegts @ 0x7fc6a481b800] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[adts @ 0x7fc6a481e200] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
Output #0, hls, to 'index.m3u8':
  Metadata:
    major_brand     : qt
    minor_version   : 0
    compatible_brands: qt
    encoder         : Lavf55.48.100
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), 720x1280, q=2-31, 1068 kb/s, 24.61 fps, 600 tbn, 600 tbc (default)
    Metadata:
      creation_time   : 2014-10-12 10:51:18
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, 64 kb/s (default)
    Metadata:
      creation_time   : 2014-10-12 10:51:18
      handler_name    : Core Media Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc6a4816800] stream 1, offset 0x28: partial file
pipe:0: Invalid data found when processing input
frame=    0 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

How send .mov file to ffmpeg via pipe? 如何通过管道将.mov文件发送到ffmpeg?

Most likely problem: The QuickTime does not have its moov atom up front. 最有可能的问题:QuickTime没有moov原子。 Sometimes, the term "quickstart" is used to describe a QuickTime file that has its moov atom at the head of the file rather than the tail. 有时,术语“快速启动”用于描述QuickTime文件,其文件头部的moov原子而不是尾部。 A QuickTime demuxer needs to be able to read this atom first before it can interpret the data in the remainder of the file (the mdat atom). QuickTime解复用器需要能够先解读这个原子才能解释文件其余部分( mdat atom)中的数据。

If the input data comes from a file, the filesystem can seek randomly around the file to locate the necessary data. 如果输入数据来自文件,则文件系统可以在文件周围随机查找以找到必要的数据。 However, in piping via stdin, there is no such (backwards) seeking allowed. 但是,在通过stdin进行管道处理时,没有允许这样的(向后)搜索。

The solution will be to use the qt-faststart utility included with FFmpeg to rearrange the QuickTime file, or rethink your solution so that it doesn't rely on non-seekable pipes. 解决方案是使用FFmpeg附带的qt-faststart实用程序来重新排列QuickTime文件,或重新考虑您的解决方案,使其不依赖于不可搜索的管道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM