[FFmpeg-devel] Hardware encoder ARM input as device input

Marcin Wo┼║niak marcin.wozniak at intermania.pl
Thu Feb 1 08:48:27 EET 2018


Hello,
I try to implement an HiSilicon H264 encoder direct input as ffmpeg 
libavdevice source (someking like V4L linux for cameras with H264 source 
driver).
I successfully recieve H264 packets with NAL units and set correct PTS 
according to source packet.
I am stuck at the moment where timing data is not extracted from raw 
H264 paassed data and looks like this:

Input #0, armdevice, from '/dev/video':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 
1920x1080, 1000k tbr, 1000k tbn, 2000k tbc

Resolution is okay but timing data is wrong. I passed SPS and PPS of 
incomming data in "read_packet".

In shotcut:
1. Open H264 encoder using low-level API in device_open
2. Initialize encoder with fps and resolution using API in device_init
3. In read_packet i get NAL units from buffer and:
av_new_packet(pkt,total);
memcpy(pkt->data,buffer) -> stub
  pkt->pts = buffer.u64PTS;
pkt->size = size
and return packet.

Profile level is guessed okay but not the timing data.

What am i doing wrong?
  Marcin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marcin_wozniak.vcf
Type: text/x-vcard
Size: 291 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180201/f075d70d/attachment.vcf>


More information about the ffmpeg-devel mailing list