摆脱FFmpeg非存在PPS错误

时间:2016-08-08 15:58:07

标签: c++ c video ffmpeg decode

我正在使用ffmpeg来解码视频。我知道我得到的错误是由于帧/ sliceHeader被解码而图片参数集信息不存在。我只是好奇,如果有人知道摆脱这个错误的方法?我的视频已成功解码,但在调试器中,此错误使元数据难以阅读。

错误是:

non existing PPS 0 referenced
decode_slice_header error
no frame! 

********我的代码在C ******

3 个答案:

答案 0 :(得分:1)

检查FFmpeg logging工具 - 您可以使用av_log_set_callback 提供自己的日志记录回调,只是忽略所有内容,或者按日志级别进行过滤,这取决于您。

答案 1 :(得分:0)

在我使用的情况下,我仍然能够收到严重错误,但不再使用以下参数解码错误:

ffmpeg -loglevel panic

以下是可用日志级别的文档片段:

-loglevel [repeat+]loglevel | -v [repeat+]loglevel
  Set the logging level used by the library. Adding "repeat+" indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted. "repeat" can also be used alone. If "repeat" is used alone, and with no prior loglevel set, the default loglevel will be used. If multiple loglevel parameters are given, using ’repeat’ will not change the loglevel. loglevel is a string or a number containing one of the following values:

  ‘quiet, -8’
  Show nothing at all; be silent.

  ‘panic, 0’
  Only show fatal errors which could lead the process to crash, such as and assert failure. This is not currently used for anything.

  ‘fatal, 8’
  Only show fatal errors. These are errors after which the process absolutely cannot continue after.

  ‘error, 16’
  Show all errors, including ones which can be recovered from.

  ‘warning, 24’
  Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.

  ‘info, 32’
  Show informative messages during processing. This is in addition to warnings and errors. This is the default value.

  ‘verbose, 40’
  Same as info, except more verbose.

  ‘debug, 48’
  Show everything, including debugging information.

  ‘trace, 56’

答案 2 :(得分:0)

对我来说,我的解决方案原来是: 希望它可以帮助任何人在c中使用ffmpeg!

av_log_set_level(AV_LOG_QUIET);