Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3056 Discussions

How can i insert key-frame at specific interval through ffmpeg?

joonsik_b_
Beginner
1,136 Views

i'm working on ffmpeg with qsv (Xeon E3 1285).

i tried to insert key-frame every 5sec with command below.

ffmpeg -t 1800 -i 2hour.mp4 -c:v h264_qsv -s 1280x720 -b:v 2M -maxrate 2M -minrate 2M -bufsize 917k -an -segment_time 5 -sc_threshold 0 -strict -2 -force_key_frames "expr:gte(t,n_forced*5)" -f segment output%03d.h264

it works fine when i use libx264(-c:v libx264) so that i can cut the video into exactly 5 sec.

But with QSV it doesn't work. video segment is 10 sec now.

How can i insert key-frame when i want?

0 Kudos
2 Replies
Jeffrey_M_Intel1
Employee
1,136 Views

Only a subset of parameters are implemented in the h264_qsv interface.  You can check yourself in the ffmpeg libavcodec/qsv* source files.

GOP structure and IDR interval are parameters set up at Media SDK initialization.  Much of this is done in qsvenc.c.  Here you can see that IDR interval is set directly with -idr_interval.

You can add your own QSV-specific parameters (as in qsvenc_h264.c) or figure out a way to plug the FFmpeg general parameters into QSV initialization. 

However, I suspect that there is more going on here than simple parameter setting.  The support for segment processing may still need some more work.  That is out of the scope of this forum, but you can take it to the appropriate FFmpeg lists directly.  (https://ffmpeg.org/mailman/listinfo)

 

 

0 Kudos
poovarasan_d_
Beginner
1,136 Views

@joonsik : Could you help us, we are facing problem with QSV and FFMPEG installation. Please refer this forum, https://software.intel.com/en-us/forums/intel-media-sdk/topic/703141

0 Kudos
Reply