[Libav-user] hardware encoding on Raspberry Pi using Openmax has issue of time stamp

Jinbo Li jinbo.li at savoirfairelinux.com
Mon Nov 19 20:14:45 EET 2018


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hw_encode.cpp
Type: text/x-c++src
Size: 14866 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20181119/698b2383/attachment.cpp>


More information about the Libav-user mailing list