Closed zsz00 closed 7 months ago
I know what's going on.
modification: avio.jl # 301
opts = AVDict("flags2" => "+export_mvs")
ret = avcodec_open2(codec_context, codec, opts) # C_NULL
modification : avio.jl: # 449 decode()
frame = graph_input_frame(r)
fret = avcodec_receive_frame(r.codec_context, frame) # 解码获取frame.
if fret >= 0
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS)
if sd != C_NULL
sd_1 = unsafe_load(sd) # pointer(sd.data)
size_1 = sd_1.size
mvs = Ptr{AVMotionVector}(sd_1.data)
mvs_num = Int(size_1 ÷ sizeof(AVMotionVector))
for i in 1:mvs_num
mv = unsafe_load(mvs, i)
println("mv:", join((mv.source, mv.w, mv.h, mv.src_x, mv.src_y, mv.dst_x, mv.dst_y, mv.flags), ','))
end
end
end
I want to obtain frame data at ahead and behind line 446 in avio.jl https://github.com/JuliaIO/VideoIO.jl/blob/e4f619ab917810d93454d50fc2c40c7383f21058/src/avio.jl#L446
how to output the AVFrame data ? It's contain metadata and side_data what i want to get.