Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coding a certain MP4 GOP with FFMPEG

I have a .y4m video file, and I want to convert it to .mp4 using FFmpeg. The problem is that I want a certain kind of GOP, this one: IBBPBBPBBPBB. But what I get, when I set the GOP size to 12 (-g 12) is IPPPPPPPPPPP. I've also tried using the -bf 8 option, but I get results like IPBBB... and the video doesn't play right.

Could you please tell me how to get the exact IBBPBBPBBPBB GOP using FFmpeg?

Thanks for your help

like image 877
Javi Avatar asked Oct 27 '25 03:10

Javi


1 Answers

I think you want something to the effect of :

-g 12 -bf 2 sgop

The -g flag sets the GOP size (as you already mentioned), the -bf 2 says that 2 B-frames should be inserted between each set of P-frames, and the sgop strictly enforces the GOP size.

like image 74
Sean Avatar answered Oct 30 '25 12:10

Sean