mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-05 14:30:43 +09:00
Make sure the first frame is pts 0
This commit is contained in:
@@ -898,6 +898,7 @@ static AVStream* create_stream(AVFormatContext *av_format_context, AVCodecContex
|
||||
stream->id = av_format_context->nb_streams - 1;
|
||||
stream->time_base = codec_context->time_base;
|
||||
stream->avg_frame_rate = codec_context->framerate;
|
||||
//stream->r_frame_rate = codec_context->framerate;
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -1084,6 +1085,9 @@ static RecordingStartResult start_recording_create_streams(const char *filename,
|
||||
AVFormatContext *av_format_context;
|
||||
avformat_alloc_output_context2(&av_format_context, nullptr, arg_parser.container_format, filename);
|
||||
|
||||
av_opt_set(av_format_context->priv_data, "use_editlist", "1", 0);
|
||||
//av_opt_set(av_format_context->priv_data, "movflags", "+frag_keyframe+empty_moov+delay_moov", 0);
|
||||
|
||||
AVStream *video_stream = create_stream(av_format_context, video_codec_context);
|
||||
avcodec_parameters_from_context(video_stream->codecpar, video_codec_context);
|
||||
|
||||
@@ -3785,6 +3789,9 @@ int main(int argc, char **argv) {
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
av_opt_set(av_format_context->priv_data, "use_editlist", "1", 0);
|
||||
//av_opt_set(av_format_context->priv_data, "movflags", "+frag_keyframe+empty_moov+delay_moov", 0);
|
||||
|
||||
const AVOutputFormat *output_format = av_format_context->oformat;
|
||||
|
||||
std::string file_extension = output_format->extensions ? output_format->extensions : "";
|
||||
|
||||
Reference in New Issue
Block a user