Jinbo Li
2018-11-19 18:14:45 UTC
Hello,
Hello, I have an issue on implementing hardware encoding on raspberry pi by using openmax. The problem is that I always get wrong time stamp in my AVpacket even right after it gets initialized, the time stamp was always assigned to be 634 (seems to be the numerator of time base) and it does not change overtime. I have run this code on my another Ubuntu laptop, it doesn't have this issue for the printf.
code:
AVPacket pkt;
printf("0-time stamp = %ld, enc = %d/%d st = %d/%d\n", pkt.pts,
encoder_ctx->time_base.num,encoder_ctx->time_base.den,
fmt_encoder_ctx->streams[video_stream]->time_base.num,
fmt_encoder_ctx->streams[video_stream]->time_base.den);
printf("avframe time stamp = %ld\n", sw_frame->pts);
av_init_packet(&pkt);
printf("1-time stamp = %ld, enc = %d/%d st = %d/%d\n", pkt.pts,
encoder_ctx->time_base.num,encoder_ctx->time_base.den,
fmt_encoder_ctx->streams[video_stream]->time_base.num,
fmt_encoder_ctx->streams[video_stream]->time_base.den);
result:
0-time stamp = 634, enc = 1907363872/0 st = 634/19001
1-time stamp = 634, enc = 0/-2147483648 st = 634/19001
...(the printed time stamp is always 634 below)
Regards,
Jinbo Li
Hello, I have an issue on implementing hardware encoding on raspberry pi by using openmax. The problem is that I always get wrong time stamp in my AVpacket even right after it gets initialized, the time stamp was always assigned to be 634 (seems to be the numerator of time base) and it does not change overtime. I have run this code on my another Ubuntu laptop, it doesn't have this issue for the printf.
code:
AVPacket pkt;
printf("0-time stamp = %ld, enc = %d/%d st = %d/%d\n", pkt.pts,
encoder_ctx->time_base.num,encoder_ctx->time_base.den,
fmt_encoder_ctx->streams[video_stream]->time_base.num,
fmt_encoder_ctx->streams[video_stream]->time_base.den);
printf("avframe time stamp = %ld\n", sw_frame->pts);
av_init_packet(&pkt);
printf("1-time stamp = %ld, enc = %d/%d st = %d/%d\n", pkt.pts,
encoder_ctx->time_base.num,encoder_ctx->time_base.den,
fmt_encoder_ctx->streams[video_stream]->time_base.num,
fmt_encoder_ctx->streams[video_stream]->time_base.den);
result:
0-time stamp = 634, enc = 1907363872/0 st = 634/19001
1-time stamp = 634, enc = 0/-2147483648 st = 634/19001
...(the printed time stamp is always 634 below)
Regards,
Jinbo Li