0

I am new to FFMPEG. I am trying encode a stream in alternate I-Frames and P-Frames for the baseline profile IPIPIPIPIP.

I searched FFMPEG forums but was not able to get the required output

My script file:

export LD_LIBRARY_PATH=:./FFMPEGEncLibs
./ffmpegEnc -f rawvideo -r 25 -s 176x144 -vcodec rawvideo -i ./encIn/akiyo_qcif.yuv -c:v libx264 -x264-params cabac=0:8x8dct=0 -pix_fmt yuv420p -profile:v baseline -level 4.1 -psnr -intra -qp 9 -vframes 10 ./encOut/akiyo_cif.h264

Can someone suggest me changes to my script file, so that i would be able to encode in stream in IPIPIP format

Thanks in advance

llogan
  • 121,796
  • 28
  • 232
  • 243
Codec Guy
  • 137
  • 2
  • 11

1 Answers1

2
ffmpeg -i file -x264opts keyint=2:min-keyint=2 outfile

will add a new keyframe every second frame. The other frame will be a P frame.

Ronald S. Bultje
  • 10,828
  • 26
  • 47
  • Thanks for the reply. I have changed my script file as below ./ffmpegEnc -f rawvideo -r 25 -s 176x144 -i ./encIn/akiyo_qcif.yuv -x264opts keyint=2:min-keyint=2 -c:v libx264 -intra -qp 30 -vframes 3 ./encOut/akiyo_cif.h264 When i remove this -intra flag, I getting a error. If i keep this my second frame will also be I-Frame itself. Can u suggest me should i keep this flag or remove it. – Codec Guy Aug 05 '15 at 13:42
  • @CodecGuy You should show the actual error. A link to a pastebin, or an update to your question showing the complete console output would be helpful. – llogan Aug 05 '15 at 16:41
  • @LordNeckbeard, here is the output of my console [codecguy@platinum TestVectors]$ sh scripts.sh libavutil 52. 46.101 / 52. 46.101 libavcodec 55. 36.100 / 55. 36.100 libavformat 55. 19.102 / 55. 19.102 libavdevice 55. 4.100 / 55. 4.100 libavfilter 3. 88.101 / 3. 88.101 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 [rawvideo @ 0x1660ce0] Estimating duration from bitrate, this may be inaccurate Input #0, rawvideo, from './encIn/akiyo_qcif.yuv': – Codec Guy Aug 06 '15 at 04:50
  • Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 176x144, 7603 kb/s, 25 tbr, 25 tbn, 25 tbc Metadata: encoder : Lavf55.19.102 Stream #0:0: Video: h264 (libx264), yuv420p, 176x144, q=-1--1, 90k tbn, 25 tbc hcount : 10 , vconut : 8 ERRORO HOW DID THIS COME INTO I_8x8[codecguy@platinum TestVectors]$ – Codec Guy Aug 06 '15 at 04:54
  • @CodecGuy That's not the complete console output, and I was hoping you would avoid trying to cram this info into comments. As I mentioned earlier, use a link to a pastebin service, or even better, edit your question with the updated info. – llogan Aug 06 '15 at 05:43
  • @LordNeckbeard Here is the link to my paste bin http://pastebin.com/b8y7zZ4E If i remove -intra flag, I am getting this Error – Codec Guy Aug 06 '15 at 06:26