ffmpeg - 为什么在 ts 文件上查找这么慢?

标签 ffmpeg stream seek transport

我正在处理一个 ts 文件,以下是 ffprobe 输出:

ffprobe version N-45589-gb6a0b8b-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2007-2014 the FFmpeg developers
  built on Aug 28 2014 02:30:32 with gcc 4.8 (Debian 4.8.3-9)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  0.101 / 56.  0.101
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[hevc @ 0x298b4a0] No start code is found.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
    Last message repeated 2 times
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
    Last message repeated 7 times
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] No start code is found.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[hevc @ 0x298b4a0] PPS id out of range: 0
[hevc @ 0x298b4a0] Error parsing NAL unit #2.
[mpegts @ 0x2987560] decoding for stream 0 failed
[mpegts @ 0x2987560] Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'mp4box-jlsj-4k.ts':
  Duration: 00:02:15.00, start: 0.001111, bitrate: 31116 kb/s
  Program 1
    Stream #0:0[0x65]: Video: hevc ([36][0][0][0] / 0x0024), 25 tbr, 90k tbn, 90k tbc
    Stream #0:1[0x66]: Audio: eac3, 48000 Hz, 5.1(side), fltp, 448 kb/s

我遇到的问题是在这个文件上搜索非常慢,完成搜索操作需要超过 1 分钟。

这个 ts 文件大小为 500MB,有 2,793,052 个 ts 包,2,750,469 个视频包,137 个带有 random_acces_indicator 的视频包。
寻道缓慢的可能原因是什么?为什么 ffmpeg 会报告这些错误?我需要做什么来进行分析?

最佳答案

我绝对不是 hevc专家,但似乎输入文件的容器已损坏或其中的数据已损坏。

尝试使用以下命令重新打包:ffmpeg -i <<INPUT>> -c copy <<OUTPUT.ts>> .如果出现任何问题或文件中的数据损坏,ffmpeg 应报告。

关于ffmpeg - 为什么在 ts 文件上查找这么慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31131456/

相关文章:

javascript - JWPlayer 时间搜索区域和重置变量

Android:视频 SeekTo 错误

video - 如何比较/显示 ffmpeg 中 2 个视频之间的差异?

windows - 在不更改代码的情况下将 C++ 输出流重定向到 VS 2010 中的文件?

c# - 将 ReadAsStreamAsync 与 StreamReader 一起使用时出现 "stream was not readable"ArgumentException

ios - 如何检测 MPMoviePlayerController 开始播放电影?

python - 编写视频而不会丢失数据或比特率 - opencv(python)

android - 我在 android 上得到了对 'avcodec_register_all' Ffmpeg 的 undefined reference

audio - 在 ffmpeg 中混合音轨的文件上添加另一个音频

.NET 流功能 - CanXXX 测试安全吗?