Closed leokinglong closed 3 years ago
Hi @LeoKingLong, only -vid-info
is not exposed.
-irefresh-type
is exposed by forced-idr
: https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch#L552
profile, level, tier
is exposed: https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch#L565
Hi, @tianjunwork
I try with forced-idr,profile, level, tier again,it worked.
Can you also expose '-vid-info' parameter? Thanks~
Sure. May I know what information you need vui to carry?
Hi~ @tianjunwork 1 . Param '-pred-struct' is also not supporteded in ffmpeg svt plugin. ./ffmpeg -i ../movie/dance.mp4 -c:v libsvt_hevc -rc 1 -forced-idr 4 -profile 2 -tier 1 -level 0 -b:v 60M -g 5 -r 30 -bf 0 -umv 0 -tile_slice_mode 1 -tile_row_cnt 12 -tile_col_cnt 12 -preset 12 -thread_count 196 -pred-struct 0 -y 2_hd.hevc
func (ctxt *Context) SetTimebase(num1 int, den1 int) {
ctxt.time_base.num = C.int(num1)
ctxt.time_base.den = C.int(den1)
}
func (ctxt *Context) SetEncodeParams2(width int, height int, pxlFmt PixelFormat, hasBframes bool, gopSize int) {
ctxt.width = C.int(width)
ctxt.height = C.int(height)
// ctxt.bit_rate = 1000000
ctxt.gop_size = C.int(gopSize)
// ctxt.max_b_frames = 2
if hasBframes {
ctxt.has_b_frames = 1
} else {
ctxt.has_b_frames = 0
}
// ctxt.extradata = nil
// ctxt.extradata_size = 0
// ctxt.channels = 0
ctxt.pix_fmt = int32(pxlFmt)
//C.av_opt_set(ctxt.priv_data, "preset", "ultrafast", 0)
}
func AvOptSet(ctxt *Context ,name string,val string, searchFlags int) int{
return int(C.av_opt_set(((*C.struct_AVCodecContext)(ctxt)).priv_data, C.CString(name), C.CString(val), C.int(searchFlags)))
}
(2) The log printed by the ffmpeg svt plugin when encoding the frame by ffmepg api:
Sure. May I know what information you need vui to carry? @tianjunwork The vui_time_scale param.
I see, sure, we can expose -vid-info
api.
-pred-struct
is not exposed either. NOTE: PredStructure 0 means IPPP...., no B frame. In the screenshot you posted, PredStructure is 2, which means random access hierarchical coding structure which has B frame.
https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_user_guide.md#1-hierarchical-coding-structure-parameters
Hi @guojiansheng0925 , can we expose PredStructure and VideoUsabilityInfo through ffmpeg? Thank you.
Hi @tianjunwork , I have submitted the MR and could you please help to review the code?
Hi @LeoKingLong , the issue is automatically closed with PR merge. If you have following questions, feel free to reopen.
Command : ./ffmpeg -i ../movie/dance.mp4 -c:v libsvt_hevc -rc 1 -b:v 60M -g 5 -r 30 -bf 0 -umv 0 -tile_slice_mode 1 -tile_row_cnt 12 -tile_col_cnt 12 -vid-info 1 -y 2_hd.hevc
Result:
Unrecognized option 'vid-info'.
So how to use these parameters during encoding with ffmpeg_plugin ? Thanks~