Open x850044053wwt opened 4 days ago
First, I think the meaning of pts and timestamp in BMF
is the same as in FFmpeg
, but bmf_sdk::Packet
is more like a general data structure, it can pack any data, so if you want to use the variable, you need to set the timestamp every time you create a bmf_sdk::Packet
, so the timestamp defaults to -1.
Second, the VideoFrame
is just like AVFrame
in FFmpeg, this data structure is used to pack various Frame from different video frame like ffmpeg
or cuda
.
For example, the pts is same as AVFrame
in ffmpeg_decoder and ffmpeg_encoder module. you can see the details:
> grep -r "set_pts"
...
./c_modules/src/ffmpeg_decoder.cpp: video_frame.set_pts(frame->pts);
./c_modules/src/ffmpeg_decoder.cpp: audio_frame.set_pts(frame->pts);
./c_modules/src/ffmpeg_decoder.cpp: av_packet.set_pts(pkt->pts);
./c_modules/src/ffmpeg_decoder.cpp: video_frame.set_pts(frame->pts); // sync with avframe
./c_modules/src/ffmpeg_decoder.cpp: audio_frame.set_pts(frame->pts); // sync with avframe
./c_modules/src/ffmpeg_decoder.cpp: bmf_av_packet.set_pts(av_packet->pts); // sync with AVPacket
./c_modules/src/ffmpeg_decoder.cpp: bmf_pkt.set_pts((int64_t)BMF_EOF);
./c_modules/src/ffmpeg_decoder.cpp: bmf_pkt.set_pts(BMF_EOF);
./c_modules/src/ffmpeg_filter.cpp: video_frame.set_pts(frame->pts);
./c_modules/src/ffmpeg_filter.cpp: audio_frame.set_pts(frame->pts);
./c_modules/src/ffmpeg_encoder.cpp: video_frame.set_pts(frame->pts);
...
How to understand the pts in VideoFrame and the timestamp of Packet? I have a 30fps video.In generateMode, VideoFrame timebase 1 / 19200, pts increments 1280 or 1920, and the timestamp is always -1