【问题标题】:Send .mov file to ffmpeg via pipe (stdin)通过管道(stdin)将 .mov 文件发送到 ffmpeg
【发布时间】:2014-10-12 14:24:33
【问题描述】:

如果在-i选项中指定文件,ffmpeg成功处理文件:http://pastebin.com/cn4w4aR2

但是,如果通过管道(到标准输入)将文件发送到 ffmpeg,我收到错误 stream 1, offset 0x24: partial file:

    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

如何通过管道将 .mov 文件发送到 ffmpeg?

【问题讨论】:

    标签: video ffmpeg pipe stdin mov


    【解决方案1】:

    最可能的问题:QuickTime 没有预先设置其moov 原子。有时,术语“快速启动”用于描述一个 QuickTime 文件,它的 moov 原子位于文件的头部而不是尾部。 QuickTime 解复用器需要先能够读取此原子,然后才能解释文件其余部分(mdat 原子)中的数据。

    如果输入数据来自文件,文件系统可以在文件周围随机搜索以找到必要的数据。但是,在通过标准输入的管道中,不允许这样(向后)搜索。

    解决方案是使用 FFmpeg 附带的 qt-faststart 实用程序重新排列 QuickTime 文件,或者重新考虑您的解决方案,使其不依赖于不可搜索的管道。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-18
      • 2017-10-02
      • 1970-01-01
      • 1970-01-01
      • 2020-02-16
      相关资源
      最近更新 更多