[FFmpeg-user] Add IFrames to H264 video file

Oren Winkler Oren.Winkler at nice.com
Mon Dec 28 15:17:02 CET 2015


Hi,
I am trying to process H264 raw data, that contains only one IFrame, at the beginning of the file, and the rest of the data is PFrames only.
I want to increase the number of IFrames in the file, using ffmpeg tool for it:

Command line:
ffmpeg -f h264 -i in77.h264 -vcodec libx264 -y -g 30 out1.h264

the -g flag is the GOP that defines the number of frames between each IFrame created.

The processing fails:
C:\Users\orenwi\Desktop\FFMPEG source\ffmpeg-20151122-git-3c110b0-win64-static\ffmpeg-20151122-git-3c110b0-win64-static\bin>ffmpeg -f h264 -i in77.h264 -vcodec libx264 -y -g 30 out1.h264
ffmpeg version N-76776-g3c110b0 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  8.100 / 55.  8.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 18.100 / 57. 18.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, h264, from 'in2.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Baseline), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
[libx264 @ 000000000415f620] using SAR=1/1
[libx264 @ 000000000415f620] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 000000000415f620] profile High, level 4.0
Output #0, h264, to 'out1.h264':
  Metadata:
    encoder         : Lavf57.18.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.15.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264 @ 0000000003960860] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000003960860] no frame!
[h264 @ 0000000003fae520] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000003fae520] no frame!
[h264 @ 0000000002f0e300] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000002f0e300] no frame!
[h264 @ 0000000002f547e0] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000002f547e0] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0000000003ff5fa0] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000003ff5fa0] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0000000003960860] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000003960860] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0000000003fae520] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000003fae520] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0000000002f0e300] AVC: nal size 0
    Last message repeated 1 times
[h264 @ 0000000002f0e300] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0000000002f547e0] AVC: nal size 0
    Last message repeated 1 times

It seems like the raw data file is corrupted, or some information is missing, although we can play it in  Elecard StreamEye Tools.
What do you think?

Best regards,



Oren Winkler
Core Engines Software Engineer
Recording Platform Group
NICE Systems. Israel

(T) +972-9-775-3356
(M) +972-54-2312-728
orenwi at nice.com<mailto:orenwi at nice.com>
www.nice.com<http://www.nice.com>



More information about the ffmpeg-user mailing list