Giter Site home page Giter Site logo

libimxvpuapi's People

Contributors

artox avatar bmx666 avatar dougnazar avatar dv1 avatar lu-zero avatar maxkrummenacher avatar otavio avatar willnewton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libimxvpuapi's Issues

libimxvpuapi freezes with normal h264 decoding

I tested example/decode-example with given h264 test file (test-320x240.h264)
and it seems to run but on third execuction time it fails.

Here's the log:
//////////////////////////////////////////////////////////
/imxvpuapi/imxvpuapi_vpulib.c:1807 (imx_vpu_dec_decode) log: input info: 6214 byte
../imxvpuapi/imxvpuapi_vpulib.c:1846 (imx_vpu_dec_decode) log: pushing main frame data with 6214 byte
../imxvpuapi/imxvpuapi_vpulib.c:1691 (imx_vpu_dec_push_input_data) log: bitstream buffer status: read ptr 0x44c37090 write ptr 0x44c37093 num free bytes 3143676
../imxvpuapi/imxvpuapi_vpulib.c:2063 (imx_vpu_dec_decode) log: waiting for decoding completion
../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode) info: timeout after waiting 500 ms for frame completion
../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode) info: timeout after waiting 500 ms for frame completion
../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode) info: timeout after waiting 500 ms for frame completion
../imxvpuapi/imxvpuapi_vpulib.c:2072 (imx_vpu_dec_decode) info: timeout after waiting 500 ms for frame completion
[ERR] fatal: VPU is busy in vpu_DecGetOutputInfo
imx_vpu_dec_decode() failed: timeout
../imxvpuapi/imxvpuapi_vpulib.c:1104 (imx_vpu_dec_close) debug: closing decoder
////////////////////////////////////////////////////////////

Should the provided example work normally with any number of execution times?
My goal is to decode h264 video on VPU.

The best,
Tommi

JPEG decoder return decode info with null dma buffer

Hello,
I'm using usb camera, capture data format MJPEG and push to imx8m JPEG decoder, When i call imx_vpu_api_jpeg_dec_decode, in second time, crash when dma buffer can not map to, could you finger me the reason of the error:

../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:497 (imx_vpu_api_get_free_frame_entry_index) debug: (re)allocated space for additional frame entry
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1682 (imx_vpu_api_dec_push_encoded_frame) log: pushed frame with context 0x4059000000000000 PTS 0 DTS 4606281698874543309 frame entry index 0 and 53256 bytes of main data
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1737 (imx_vpu_api_dec_decode) log: decoding frame(s); drain mode enabled: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1831 (imx_vpu_api_dec_decode) debug: VPU has no decoded frames to output
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1878 (imx_vpu_api_dec_decode) log: scanning for frames in the stream buffer; read offset 0 write offset 53256 fill level 53256
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1894 (imx_vpu_api_dec_decode) log: found frame, offsets: first 0 last 53256 associated frame entry index: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1907 (imx_vpu_api_dec_decode) log: decode() result: codec state CODEC_HAS_INFO (2) num used input bytes 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1878 (imx_vpu_api_dec_decode) log: scanning for frames in the stream buffer; read offset 0 write offset 53256 fill level 53256
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1894 (imx_vpu_api_dec_decode) log: found frame, offsets: first 0 last 53256 associated frame entry index: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1907 (imx_vpu_api_dec_decode) log: decode() result: codec state CODEC_WAITING_FRAME_BUFFER (6) num used input bytes 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:560 (imx_vpu_api_dec_clear_added_framebuffers) log: clearing 0 added framebuffer(s)
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:692 (imx_vpu_api_dec_get_new_stream_info) debug: setnoreorder() called; frame reordering: 0 codec state: CODEC_ERROR_UNSPECIFIED (-5)
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:727 (imx_vpu_api_dec_get_new_stream_info) debug: crop rectangle not available, setting whole frame as rectangle instead: left 0 top 0 width 1280 height 720
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:827 (imx_vpu_api_dec_get_new_stream_info) debug: stream info: aligned width/height: 1280/720 actual width/height: 1280/720 Y/UV stride: 1280/1280 Y/UV size: 921600/460800 Y/U/V offsets: 0/921600/1382400 sliceheight: 720 min fb pool framebuffer size: 1382400 frame rate: 0/0 min num required framebuffers: 1 color format: semi planar YUV 4:2:0 8-bit semi-planar: 1 is interlaced: 0 is 10 bit: 0 has HDR metadata: 0 has color description: 0 has location of chroma info: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:2011 (imx_vpu_api_dec_decode) log: new stream info was seen earlier, and new framebuffers are needed
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:547 (imx_vpu_api_dec_add_framebuffer_entries) debug: (re)allocated space for additional 1 framebuffer entries
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1514 (imx_vpu_api_dec_add_framebuffers_to_pool) debug: adding framebuffer entry with index 0: virtual address 0xffff4fb28000 physical address 0x55c00000 size 1382400
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1737 (imx_vpu_api_dec_decode) log: decoding frame(s); drain mode enabled: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1831 (imx_vpu_api_dec_decode) debug: VPU has no decoded frames to output
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1878 (imx_vpu_api_dec_decode) log: scanning for frames in the stream buffer; read offset 0 write offset 53256 fill level 53256
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1894 (imx_vpu_api_dec_decode) log: found frame, offsets: first 0 last 53256 associated frame entry index: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1907 (imx_vpu_api_dec_decode) log: decode() result: codec state CODEC_HAS_FRAME (1) num used input bytes 53256
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1979 (imx_vpu_api_dec_decode) log: decoded frame is available
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1737 (imx_vpu_api_dec_decode) log: decoding frame(s); drain mode enabled: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1774 (imx_vpu_api_dec_decode) log: found frame entry at index 0 and framebuffer entry at index 0 for decoded frame with physical address 0x55c00000
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:2106 (imx_vpu_api_dec_get_decoded_frame) log: got frame with context 0x4059000000000000 PTS 0 DTS 4606281698874543309 frame entry index 0 framebuffer entry index 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1737 (imx_vpu_api_dec_decode) log: decoding frame(s); drain mode enabled: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1831 (imx_vpu_api_dec_decode) debug: VPU has no decoded frames to output
[04:40:03:121][Warning]Core:phone.service: buffer got ok
[04:40:03:122][Info]Core:phone.service: hw mjpeg dec_process elapsed = 22.067282 ms
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1682 (imx_vpu_api_dec_push_encoded_frame) log: pushed frame with context 0xccf8 PTS 11318158608 DTS 281472648902528 frame entry index 0 and 52472 bytes of main data
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1737 (imx_vpu_api_dec_decode) log: decoding frame(s); drain mode enabled: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1831 (imx_vpu_api_dec_decode) debug: VPU has no decoded frames to output
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1878 (imx_vpu_api_dec_decode) log: scanning for frames in the stream buffer; read offset 0 write offset 52472 fill level 52472
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1894 (imx_vpu_api_dec_decode) log: found frame, offsets: first 0 last 52472 associated frame entry index: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1907 (imx_vpu_api_dec_decode) log: decode() result: codec state CODEC_NEED_MORE (0) num used input bytes 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1878 (imx_vpu_api_dec_decode) log: scanning for frames in the stream buffer; read offset 0 write offset 52472 fill level 52472
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1894 (imx_vpu_api_dec_decode) log: found frame, offsets: first 0 last 52472 associated frame entry index: 0
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1907 (imx_vpu_api_dec_decode) log: decode() result: codec state CODEC_HAS_FRAME (1) num used input bytes 52472
../imxvpuapi2/imxvpuapi2_imx8m_hantro_decoder.c:1979 (imx_vpu_api_dec_decode) log: decoded frame is available
phone.service: ../imxdmabuffer/imxdmabuffer.c:81: imx_dma_buffer_map: Assertion `buffer != NULL' failed.
Aborted (core dumped)

imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed

Hello,
I'm trying to decode mjpeg on coral-dev but I'm running into the error below. Any suggestions or advices are appreciated.

I'm running customer image build with yocto:

root@coral-dev:~# uname -a
Linux coral-dev 5.15.52-5.15.52-2.1.0+g36363d8623ba #1 SMP PREEMPT Tue Sep 6 09:50:50 UTC 2022 aarch64 GNU/Linux
root@coral-dev:~# gst-launch-1.0 --version
gst-launch-1.0 version 1.20.4
GStreamer 1.20.4
Unknown package origin
root@coral-dev:~# 

Error:

root@coral-dev:~# gst-launch-1.0 --gst-debug=2 v4l2src device=/dev/video0 ! image/jpeg, width=800,height=600, framerate=5/1 ! imxvpudec_jpeg ! fakesink
Setting pipeline to PAUSED ...[ 1421.110014] usb 1-1.4: Failed to query (GET_DEF) UVC control 12 on unit 1: -32 (exp. 3).

Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.329565253   397 0xaaaaf03aa580 ERROR              imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.329694973   397 0xaaaaf03aa580 ERROR              imxvpudec gstimxvpudec.c:488:gst_imx_vpu_dec_set_format:<imxvpudecjpeg0> could not open decoder: error
0:00:00.329738173   397 0xaaaaf03aa580 WARN            videodecoder gstvideodecoder.c:928:gst_video_decoder_setcaps:<imxvpudecjpeg0> Subclass refused caps
0:00:00.329970733   397 0xaaaaf03aa580 ERROR              imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.330010933   397 0xaaaaf03aa580 ERROR              imxvpudec gstimxvpudec.c:488:gst_imx_vpu_dec_set_format:<imxvpudecjpeg0> could not open decoder: error
0:00:00.330043333   397 0xaaaaf03aa580 WARN            videodecoder gstvideodecoder.c:928:gst_video_decoder_setcaps:<imxvpudecjpeg0> Subclass refused caps
0:00:00.330077293   397 0xaaaaf03aa580 WARN                GST_PADS gstpad.c:4351:gst_pad_peer_query:<capsfilter0:src> could not send sticky events
0:00:00.394068376   397 0xaaaaf03aa580 WARN          v4l2bufferpool gstv4l2bufferpool.c:855:gst_v4l2_buffer_pool_start:<v4l2src0:pool0:src> Uncertain or not enough buffers, enabling copy threshold
0:00:01.145123686   397 0xaaaaf03aa580 ERROR              imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:01.145210326   397 0xaaaaf03aa580 ERROR              imxvpudec gstimxvpudec.c:488:gst_imx_vpu_dec_set_format:<imxvpudecjpeg0> could not open decoder: error
0:00:01.145244166   397 0xaaaaf03aa580 WARN            videodecoder gstvideodecoder.c:928:gst_video_decoder_setcaps:<imxvpudecjpeg0> Subclass refused caps
0:00:01.145473606   397 0xaaaaf03aa580 ERROR              imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:01.145513326   397 0xaaaaf03aa580 ERROR              imxvpudec gstimxvpudec.c:488:gst_imx_vpu_dec_set_format:<imxvpudecjpeg0> could not open decoder: error
0:00:01.145545606   397 0xaaaaf03aa580 WARN            videodecoder gstvideodecoder.c:928:gst_video_decoder_setcaps:<imxvpudecjpeg0> Subclass refused caps
0:00:01.145638006   397 0xaaaaf03aa580 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:01.145674126   397 0xaaaaf03aa580 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../gstreamer-1.20.4/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.848592994
Setting pipeline to NULL ...
0:00:01.146180526   397 0xaaaaf03aa580 ERROR              imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1196:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:01.146221206   397 0xaaaaf03aa580 ERROR              imxvpudec gstimxvpudec.c:488:gst_imx_vpu_dec_set_format:<imxvpudecjpeg0> could not open decoder: error
0:00:01.146254086   397 0xaaaaf03aa580 WARN            videodecoder gstvideodecoder.c:928:gst_video_decoder_setcaps:<imxvpudecjpeg0> Subclass refused caps
Freeing pipeline ...
root@coral-dev:~# 

Regards,
Nikolay Kovachev

Error trying to decode fragmented (FU-A) RTP H.264 Encoded Video Stream

I'm trying to decode a H.264 RTP video stream, I'm removing the 12 bytes from the RTP header and calling imx_vpu_api_dec_push_encoded_frame with the encoded frame data being the Fragmented Frame (FU indicator + FU header + FU payload). I'm getting an error from the VPU, as it never has a frame to decode and continuously outputs codec state CODEC_NEED_MORE even after pushing frames in successfully. I'm also uncertain how the VPU is acquiring the data from SPS and PPS NALUs, I see a reference in the decode-example but not any mention to how the VPU lib is supposed to get that info. I've also tried to depacketize the frames into whole frames but then I get an error nal_ref_idc cannot be null.

Libimxvpuapi Version: 2.2.1
Platform: IMX8MP
vpu_output.txt

imxvpuenc_h264 not working with apple homekit

Hi,
we are implementing an Apple homekit accessory using an imx6solo CPU.

The environment is:

  • yocto rocko
  • kernel 4.9.11
  • latest version of gstreamer1.0-plugins-imx
  • latest version of libimxvpuapi

the pipeline is

imxv4l2videosrc -> imxipuvideotransform (deinterlace + resize) -> imxvpuenc_h264 -> appsink

then buffers coming from appsink are sent to apple API that do RTP packetization and UDP transmission.

The problem is that apple devices can't start video decoding.

We have tried to use fsl plugins instead of imx ones (vpuenc instead of imxvpuenc_h264) and in this case the video decoding (apple side) works well.

We have seen that inside your library there is a comment about SPS, PPS, AUD order that
is no longer guaranteed. Do you think the problem could be related to that frames order? (commit 17f1328)

Thanks in advance,
Angelo

dropping mosaic frame

Hi there,

Love the library, so much cleaner and understandable!
I'm trying to decode an intra-refreshed h264 stream (with only P-frames), and the decoder is returning "trace: dropping mosaic frame" for each frame.

Do you have any ideas on what could be the cause?

Cheers,
Attila

Floating Point exception when Using Jpeg_Decode_example

Hello,

I Tried to use your jpeg decoding example on our ixora imx6 board and it works with some jpegs just fine. But some of our jpegs wont work and the test application throws a floating point exception when it should be decoding. I dont really know if its the filesize or something else, but with jpegs < 2MB it seemed to work just fine.

Here the jpeg it didnt work with:

https://we.tl/t-Zakc2uehDK

Right now all of the image decoding work is done by the software... but doing it with the vpu could give us a pretty good boost of performance so we wanted to try it out. Just to be sure, the jpeg i sent you should work shoudn't it?

greetings Georg

Failed to decode H264 frames received through webrtcbin

The remote video stream received using webrtcbin from GStreamer is only decoded for couple of seconds before the following errors is shown and the whole app crashes.

The Gstreamer pipeline was created in Qt and the decoded stream was being displayed in QML using qmlglsink

The test was conducted on iMX 6 D/L.

0:01:27.712276376  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.713205111  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.714210184  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.723005494  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.734430329  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.735342063  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.742891948  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.743848685  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.752438313  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.758708105  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.759706511  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.760484235  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.764672207  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.765679948  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.767551085  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.785961764  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.787758896  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.788742967  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.794574060  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda_ipu.c:126:imx_vpu_api_imx6_coda_detile_and_copy_frame_with_ipu_vdoa: queuing IPU task failed: Invalid argument (22)
0:01:27.795523463  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2518:imx_vpu_api_dec_get_decoded_frame: could not detile and copy decoded frame pixels
0:01:27.796886896  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:1501:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> could not retrieve decoded frame: error
0:01:27.802210619  1837 0x68ad2890 ERROR              imxvpuapi imxvpuapi2_imx6_coda.c:2346:imx_vpu_api_dec_decode: internal error; not enough output framebuffers were available even though enough were added prior to decoding
0:01:27.803201358  1837 0x68ad2890 ERROR              imxvpudec gstimxvpudec.c:970:gst_imx_vpu_dec_decode_queued_frames:<imxvpudech264-0> decoding frames failed: error
0:01:27.843677318  1837 0x60f2c4e8 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<nicesrc0> error: Internal data stream error.
0:01:27.843810327  1837 0x60f2c4e8 WARN                 basesrc gstbasesrc.c:3127:gst_base_src_loop:<nicesrc0> error: streaming stopped, reason error (-5)
0:01:27.844632054  1837 0x60f2c4e8 WARN                   queue gstqueue.c:992:gst_queue_handle_sink_event:<queue0> error: Internal data stream error.
0:01:27.845280768  1837 0x60f2c4e8 WARN                   queue gstqueue.c:992:gst_queue_handle_sink_event:<queue0> error: streaming stopped, reason error (-5)

Delayed decoding of IDR NAL (slice_type 2) for baseline profile h264 bitstream

I'm trying to decode a h264 bitstream that is baseline profile on an iMX6 VPU decoder, but it seems the decoder is always with a frame behind.

I'm giving to the decoder a SPS and a PPS NAL (both can be found in frame_0.h264 attached here) and then I'm giving it a IDR NAL (which is in frame_1.h264 attached here). The slice_type of this IDR frame is 2 (see the h264_analyze_output.txt). I expect that right after processing the IDR NAL to get a decoded RAW frame. However the decoder doesn't produce anything, giving back a "not enough input data" return code, which seems to come because of the "decodingSuccess" being set to "no data decoded or ready for display" (you can see the attached logs in decoder_logs.txt). I've added some //elisescu: tags in the log to point out the key lines there.

The decoder should be able and decode the IDR NAL to a RAW frame, since it has all the needed information to do so. I've tried doing that with ffmpeg, and ffmpeg can decode it (just concatenated frame_0.h264 and frame_1.h264 and decoded them with ffmpeg).

On top of this, what is more curious is that, if I give again to the decoder the SPS and PPS NALs (the same ones that were fed before the IDR NAL), right after the IDR NAL, then it outputs the decoded picture. So:
SPS, PPS, IDR => no decoded raw frame, but
SPS, PPS, IDR, SPS, PPS => decoded raw frame
This doesn't make much sense to me, since the two NALs don't bring new info for the decoder to be able to decode the previously sent IDR NAL.

Because the iframe is only decoded when the next nal is available, we get a pointless delay in the stream. We use the decoder for live streaming. If there is no motion on the screen, there are no input frames, so the delay to the next frame can be very large. Also, when the decoder finally outputs the decoded I-frame, the pts is incorrect. It is taken from the following frame instead.

I've attached more info about the NALs as dumped with h264_analyzer to the file h264_analyze_output.txt.

I should also mention that this is not the same behaviour I get when I feed the decoder with a different bitstream (encoded with a different h264 encoder, x264 in this case, with main profile - this makes the IDR to have the slice_type 7). In this case, the decoder always outputs the decoded frame right after it was fed with the IDR NAL, as expected.

decoder_logs.txt
h264_analyze_output.txt
frames_0_1_h264.zip

imx_coda_vpu_unload should not be released twice

In the imx_vpu_api_dec_close function, imx_coda_vpu_unload should not be released twice, so that it does not correspond to the number of loads, and the software crashes after multiple creation and release.

Unnecessary mandatory flag --imx-headers

In the branch v2 the above parameter is mandatory, you MUST set the path where the linux/mxcfb.h can be found, otherwise the compilation terminates with error.

There is no such source or include file in the whole repository what uses mxcfb.h
The word mxcfb.h can be found in two files only:
README.md
wscript

I think that flag should be removed, it just makes chaos.

SIGSEG while closing VPU decoder

Hi,

I am not sure this is the correct place for this issue.

When stopping and restarting some times ( > 20times) this pipeline, I get a segfault. I am changing the udport of the source, so I am setting the pipeline to NULL state, update the port and set the pipeline to PLAYING.

The pipeline:
udpsrc port=5001 name=udpsrc caps=\"application/x-rtp,pt=96,encoding-name=H264\" ! rtph264depay ! h264parse ! imxvpudec ! appsink name=sink

Here is the backtrace:

Thread 1 "Program" received signal SIGSEGV, Segmentation fault.
0x2ae33b90 in ?? () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0  0x2ae33b90 in ?? () from /usr/lib/libglib-2.0.so.0
#1  0x2ae34130 in g_slice_free1 () from /usr/lib/libglib-2.0.so.0
#2  0x37915620 in ?? () from /usr/lib/gstreamer-1.0/libgstimxvpu.so
#3  0x3792d268 in imx_vpu_dec_close ()
   from /usr/lib/libimxvpuapi.so.0
#4  0x37912aac in ?? () from /usr/lib/gstreamer-1.0/libgstimxvpu.so
#5  0x37912bfc in ?? () from /usr/lib/gstreamer-1.0/libgstimxvpu.so
#6  0x2af0ea44 in ?? () from /usr/lib/libgstvideo-1.0.so.0
#7  0x37911270 in ?? () from /usr/lib/gstreamer-1.0/libgstimxvpu.so
#8  0x2ace645c in gst_element_change_state ()
   from /usr/lib/libgstreamer-1.0.so.0
#9  0x2ace98b0 in ?? () from /usr/lib/libgstreamer-1.0.so.0
#10 0x2ace57c8 in gst_element_set_state ()
   from /usr/lib/libgstreamer-1.0.so.0
#11 0x2acc6b7c in ?? () from /usr/lib/libgstreamer-1.0.so.0
#12 0x2ad0eff0 in ?? () from /usr/lib/libgstreamer-1.0.so.0
#13 0x2ace645c in gst_element_change_state ()
   from /usr/lib/libgstreamer-1.0.so.0
#14 0x2ace64d8 in gst_element_change_state ()
   from /usr/lib/libgstreamer-1.0.so.0
#15 0x2ace98b0 in ?? () from /usr/lib/libgstreamer-1.0.so.0
#16 0x2ace57c8 in gst_element_set_state ()
   from /usr/lib/libgstreamer-1.0.so.0
#17 0x000550ec in Program::updateVideoMode(unsigned int) ()
#18 0x00058f58 in CommandManager::executeAndFlush(boost::shared_ptr<node>, Program*) ()
#19 0x00054904 in Program::onUpdate(boost::chrono::duration<long long, boost::ratio<1ll, 1000ll> >) ()

Ask me if you need any information.

Regards

Top portion of frame distorted

Working on Accelerated playback in Chromium on the iMX6 and I'm noticing a strange issue (see video). Looks to only appear on videos that are in Portrait mode. Initially, I had been using v1 of the API and never observed this issue.

https://youtu.be/DF8BmeSCNGw

One thing I noticed is the actual_frame_width/height always seems to match aligned_frame_width/height.

[6031:6048:0814/200253.282748:VERBOSE1:imxvpu_video_decode_accelerator.cc(480)] Associating picture buffer 0/17 ID 0 with framebuffer #0 virtual address 0x52d09000 physical address 0x76480000 actual width 640 actual height 368 aligned width 640 aligned height 368 texture id 23
[6031:6048:0814/200253.282843:VERBOSE1:imxvpu_video_decode_accelerator.cc(1021)] Adding output buffer 0 to queue

Video that glitches
[6314:6332:0814/200550.319460:VERBOSE1:imxvpu_video_decode_accelerator.cc(480)] Associating picture buffer 2/17 ID 2 with framebuffer #2 virtual address 0x57003000 physical address 0x76300000 actual width 368 actual height 368 aligned width 368 aligned height 368 texture id 25

I ended up adding code that dumps the raw frame right after a IMX_VPU_API_DEC_OUTPUT_CODE_DECODED_FRAME_AVAILABLE and I see that the image is corrupted.

image

image

-Thanks

libimxvpuapi throws encoded frame is not valid JPEG data

Hi,

I am using gstreamer 1.8 on imx6 platform to show movie preview from gphoto2 library.
I am using following command

gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc ! decodebin name=dec ! queue ! imxeglvivsink

and got following error

pic was forced to be done
0:00:01.644015566 4648 0x1fb0c30 WARN GST_PADS gstpad.c:4081:gst_pad_peer_query:imxvpudecoder0:src could not send sticky events
0:00:01.646049212 4648 0x1fb0c30 WARN GST_PADS gstpad.c:4081:gst_pad_peer_query:imxvpudecoder0:src could not send sticky events
0:00:01.648171524 4648 0x1fb0c30 ERROR imxvpuapi imxvpuapi_vpulib.c:1858:imx_vpu_dec_decode: encoded frame is not valid JPEG data
0:00:01.648716186 4648 0x1fb0c30 ERROR imxvpudecoder decoder.c:560:gst_imx_vpu_decoder_handle_frame: failed to decode: unspecified error
0:00:01.649318846 4648 0x1fb0c30 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: Internal data flow error.
0:00:01.649793175 4648 0x1fb0c30 WARN basesrc gstbasesrc.c:2948:gst_base_src_loop: error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstFdSrc:fdsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstFdSrc:fdsrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...

What can be the reason for this?

Regards,
Marko

VPU MJPEG encode timeout and memory allocation error

Hello,
I'm using the libimxvpuapi library to encode in JPEG a 13MPix image. I'm facing some issues:

  • The iMX6 run out of memory (not everytime), I increased the CMA to 512MB, but I still have allocation errors. Even if I use the __GFP_NOFAIL flag on the kernel for dma_alloc_coherent, I still have allocation errors.
  • Trying to understand the memory allocation, I found that the lib allocates a lot of framebuffers for only 1 picture encoding. I don't understand why. On my 13Mpx image, the first allocation is 26MB (YUV422), after that I have 3*32MB of memory allocated
  • Also, using a pure random frame, make the encoder crash if the JPEG quality is above 90..

Do you have any idea/ way to improve this?

frame / field mode

Hello,

We have a problem with decoding interlaced streams, which were encoded in "field mode"
(with PAFF/MBAFF coding, although it is supported by IMX). VPU cannot properly handle that kind of frames, it works only for a while, then it stops. Everything is fine when we decode streams in "frame mode".
Our platform is based on imx6qp.
We are using:
gst1-imx-0.13.0
libimxvpuapi-0.10.3

Can you help us?

YCbCr 4:4:4

Hi,

VPU documentation from Freescale states that it can encode non-downsampled CC components (4:4:4 mode).

Is the library able t encode such format into JPEG?

Thanks,
Malek

MJPEG quality never changes

Despite changing quality in the encoder parameters, it appears that MJPEG always encodes at the same quality. I am using the simplified JPEG interface.

Streaming h.264 to chrome with hardware acceleration enabled

I'm streaming h.264 video from an i.mx6 device (libimxvpuapi 0.10.3) to a chrome browser using gstreamer and webrtc with the Janus server. The problem is the browser receives the stream, but never displays it and never shows an error. If you wait long enough (10 to 15 minutes), it will sometimes eventually start displaying the video.

The chrome browser has hardware acceleration for h.264 enabled. If I disable it, the issue goes away. Streaming to firefox doesn't show this issue. If I use x264enc instead of imxvpuenc_h264, the issue does not appear. If I force the build to use libimxvpuapi 0.10.1, the issue does not appear, so it is something to do with changes between 0.10.1 and 0.10.3 (probably something to do with NAL order?)

Here is an example pipeline:

gst-launch-1.0 -v \                                                             
videotestsrc pattern=ball is-live=true ! \                                      
"video/x-raw,format=(string)I420,width=640,height=480,framerate=(fraction)30/1" 
! \                                                                             
queue ! \                                                                       
imxvpuenc_h264 gop-size=16 bitrate=2000 idr-interval=4 ! \                      
queue ! \                                                                       
rtph264pay pt=126 ! \                                                           
udpsink host=18.221.129.71 port=5012  

I tried to do some basic decoding of the stream to see if I could spot something. I don't claim to understand what is going on here, but here is what I have.

This is when using 0.10.1 and gstreamer 1.6.0. It doesn't show the problem:

GOOD:
Gstreamer 1.6.0
libimxvpuapi.so.0 -> libimxvpuapi.so.0.10.1
0:00:00.116199828  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 9
0:00:00.116239578  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.117765114  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 9
0:00:00.117816927  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.117840804  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.117856934  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 1426
0:00:00.149773123  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.149808743  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 293
0:00:00.183538995  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.183610212  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 355
0:00:00.216644445  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.216715732  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 337
0:00:00.251115148  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.251184826  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 1339
0:00:00.283100730  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.283168455  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 216
0:00:00.316646349  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.316746349  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 326
0:00:00.349894701  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.349966095  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 349
0:00:00.385143095  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.385219651  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 1413
0:00:00.416633423  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.416703636  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 316
0:00:00.449966430  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.450038815  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 397
0:00:00.483213023  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.483281661  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 323
0:00:00.517834024  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.517902363  3514      0x1c24cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 1333

This is with libimxvpuapi 0.10.3 and gstreamer 1.12.2, and does show the problem:

BAD:
Gstreamer 1.12.2
libimxvpuapi.so.0 -> libimxvpuapi.so.0.10.3
:00:00.414378024  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 9
0:00:00.414487739  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.415277119  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 9
0:00:00.415425703  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.415544918  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 1339
0:00:00.447897240  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.447925047  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 186
0:00:00.481285354  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.481361119  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 322
0:00:00.514751481  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.514822577  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 339
0:00:00.547982970  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.548083973  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 363
0:00:00.581302708  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.581373697  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 342
0:00:00.614581666  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2
0:00:00.614609918  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 215
0:00:00.647903717  4035      0x1934cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 9 AU delimiter, size 2

This is also good (no issue). It is generated by x264enc:

0:00:00.581734237  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 24
0:00:00.581781932  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.582142479  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 7 SPS, size 24
0:00:00.582176517  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 8 PPS, size 4
0:00:00.582203117  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 3232
0:00:00.582246699  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 731
0:00:00.582276757  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 263
0:00:00.582306035  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 5 Slice IDR, size 1303
0:00:00.614860845  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 802
0:00:00.614913653  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 330
0:00:00.614943660  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.614972741  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 38
0:00:00.648169119  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 826
0:00:00.648225740  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 417
0:00:00.648255357  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.648284177  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.681535114  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 720
0:00:00.681600223  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 567
0:00:00.681631064  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.681663329  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.714865743  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 480
0:00:00.714930914  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 595
0:00:00.714959784  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.714988936  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 9
0:00:00.748219173  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 546
0:00:00.748273325  7161       0xaf0cf0 DEBUG              h264parse gsth264parse.c:716:gst_h264_parse_process_nal: processing nal of type 1 Slice, size 654

If you need more information, or access to the janus server sending these streams, I can help.

Encode 8 bit greyscale JPEG

Hi,

I'm trying to encode a JPEG image from a raw 8 bit greyscale image.
I took jpeg-enc-example.c as an example and tried with pixel format IMX_VPU_COLOR_FORMAT_YUV400, but did not succeed.
In the attachments you will find my code+Makefile img.raw is the raw input file with a resolution of 1280*964 (8 bits per pixel). I also attached a png version of that image (input.png). My code creates an output file (out.jpeg), which should be the JPEG compressed raw input image.
I tested my code on a seco SBC-A62-J-QUAD with this linux: https://github.com/UDOOboard/linux_kernel/tree/imx_3.14.28_1.0.0_ga_a62

I run my program with ./main -i img.raw -o out.jpeg -q 90

I think I have to change some of the encodings parameters, but did not succeed, can anyone help?

Regards

data.zip

Failure to decode video when first frame doesn't result in a decoded frame

Found some files in our library that are failing with the 2.x branch. It fails trying to push the second frame, since even though IMX_VPU_API_DEC_OUTPUT_CODE_MORE_INPUT_DATA_NEEDED was returned, staged_encoded_frame_set is still set.

I added a decoder->staged_encoded_frame_set = FALSE; to imx_vpu_api_dec_decode() right after setting *output_code = IMX_VPU_API_DEC_OUTPUT_CODE_MORE_INPUT_DATA_NEEDED; and that seems to work but am not that confident if that's the correct fix. It doesn't seem to be leaking anything, but I'm wondering if it should be more like the VP8 workaround with it skipping an internal frame.

Input #0, avi, from '/mnt/Data/Songs/311900.avi':
  Duration: 00:04:55.24, start: 0.000000, bitrate: 337 kb/s
  Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 136 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
  Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 192 kb/s

gst.log

VPU timeout encoding frame

Hi,
I have a problem encoding a YUV420 frame to MJPEG and I need some help. Each time I try to encode this specific frame VPU hangs, but it works correctly with any other frames. I have found that issue encoding frames 2592x1944 obtained from a ov5640_camera, it works always without any problem but, occasionally, it comes a frame that cause that.

What could be the problem? Could VPU firmware or libvpu have a bug that cause it? I have followed each VPU timeout issue in README file, but all is well configured and VPU works fine

I'm using a imx6q board with VPU firmware 3.1.1 and libvpu 5.4.32.
I have attached YUV420 binary data, could you check it (it appears even with your sample application jpeg-enc-example.c)?

thank you for the attention,
best regards
Andrea Di Chiara

img.zip

VPU/python binding

Hello,

Maybe crazy question :) but I'd like to know is there any library available with python binding, so I can access VPU from within python?

Debian Hantro Library missing

I'm getting Checking for library hantro : not found when doing ./waf configure --prefix=/usr --sysroot-path=/ --imx-platform=imx8mm. I also read in the README that I need imx-vpu-hantro 1.8.0 or newer. Where do I get this and how can I build/install it on Debian?

decoder issue: could not update bitstream buffer with new data: invalid parameters

Hi

I am using v1 of the imxvpuapi lib (version 0.10.3) and have noticed the following errors with gstreamer (the imxvpudec) plugin:

0:00:33.109527337 6702 0x1d06460 ERROR imxvpuapi imxvpuapi_vpulib.c:1744:imx_vpu_dec_push_input_data: could not update bitstream buffer with new data: invalid parameters
0:00:33.109684337 6702 0x1d06460 ERROR imxvpudecoder decoder.c:603:gst_imx_vpu_decoder_handle_frame:<video_decoder> failed to decode: invalid params
gst_video: Error (h.264 dec): 1(Operation not permitted), src:video_dec_source, message=Internal data stream error.
gst_video: Debug: ../../../../gstreamer-1.14.4/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:video-decoder-pipeline/GstAppSrc:video_dec_source:
streaming stopped, reason error (-5).
gst_video: Error (h.264 dec): 1(Operation not permitted), src:video_dec_queue, message=Internal data stream error.
gst_video: Debug: ../../../gstreamer-1.14.4/plugins/elements/gstqueue.c(988): gst_queue_handle_sink_event (): /GstPipeline:video-decoder-pipeline/GstQueue:video_dec_queue:
streaming stopped, reason error (-5).

It doesn't always happen but does always with a video call from a specific SIP client.

Is it the same issue as this one?

If so, presumably I will need to build the v1 branch?

Thanks.

Gary

Access Unit Delimiters are output in an unusual order

The access unit delimiters output by the encoder are output alongside the picture data even if SPS/PPS is present, which leads to an unusual ordering of NAL units. For example x264 outputs:

AUD SPS PPS VCL AUD VCL AUD VCL ...

Whereas imxvpuenc_h264 outputs:

SPS PPS AUD VCL AUD VCL AUD VCL ...

I believe this is the root cause of Freescale/gstreamer-imx#80

libimxvpuapi-0.10.3 waf configure fails

Hi all,

I am facing an issue when trying to install libimxvpuapi 0.10.3.
./waf configure fails with the following message:
using the vpulib backend
Checking for library vpu : not found

My configuration is as follows:
imx6 platform
GStreamer 1.4.4
libimxvpuapi.so.0.10.2 installed under /usr/lib
libvpu.so.4 installed under /usr/lib

Thanks in advance for your help!

Boris

MJPG encode

Hi,

I am trying to use this library to encode a (4416 x 3312) image to JPEG using MJPG encoder.
I used your example given for H.264 and I changed the format to MJPG.
It compiles OK, but when I ran it I got an error saying: "invalid codec format"

By looking at the code, I found out that the library only support MPEG4, H263 and H264 formats for encoding (according to switch statement in libimxvpuapi/imxvpuapi_fslwrapper.c line 1407).

Can you point me on how I can add MJPG encoding to the library?

Thanks,
Malek

imxvpuapi2_imx8_amphion: error decode MJPEG stream

Hello,
I'm currently using this lib for decoding a MJPEG stream from camera.
It seems that the library for the amphion decoder does not initialize the frame height and frame width, which causes a driver error when requesting a buffer:

[VPU Decoder] reqbuf->count = 2
[VPU Decoder] sizeimage isn't initialized, OUTPUT reqbufs failed

This does not affect the H264 stream because that information is already included.

Test on Toradex Apalis iMX8QM board, with linux kernel 5.4.

Valid mp4 file format?

Hello,

EDIT: I've been reading a bit about codecs and containers and please correct me if I am wrong: the libimxvpuapi creates the encoded stream but doesn't generate the container for the encoded stream. Are there any functions in the libimxvpuapi to create the container or should I rely on a 3rd party tool for that?

I'm following the example from encode-example-writecb.c but the mp4 file cannot be played by some players (VLC under Linux/Windows). If I run ffmpeg -i video.mp4 -vcodec copy output.mp4 then everything works fine. I'd like not to depend on ffmpeg though. How could one create a valid mp4 file straight from the example code?

Xplayer in Linux can play the original file but some information is missing such as duration, container and bitrate. How can this information be embedded in the original mp4 file (without ffmpeg or other 3rd party tool)?

Here's some log info from the VPU encoder:

[INFO]: User command received: Start recording.
[INFO]: Turning LED ON.
VPU init instance counter: 0../imxvpuapi/imxvpuapi_vpulib.c:312 (imx_vpu_load)   log: 
libimxvpuapi version 0.10.3 vpulib backend../imxvpuapi/imxvpuapi_vpulib.c:321 (imx_vpu_load)   info: 
loaded VPU../imxvpuapi/imxvpuapi_vpulib.c:325 (imx_vpu_load)   debug: 
allocated 1572864 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x762e7000  aligned: 0x762e7000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15400000  aligned: 0x15400000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
opening encoder, frame size: 720 x 480 pixel../imxvpuapi/imxvpuapi_vpulib.c:3212 (imx_vpu_enc_open)   log: 
[INFO]  ringBufferEnable 0, chromaInterleave 0, mapType 0, linear2TiledEnable 1
successfully opened encoder../imxvpuapi/imxvpuapi_vpulib.c:3231 (imx_vpu_enc_open)   debug: 
[WARN]  VPU iram is less than needed, some parts don't use iram
frame size: 720 x 480 pixel, 40501 macroblocks per second => MPEG-4 user profile level indication = 6../imxvpuapi/imxv
puapi_vpulib.c:2750 (imx_vpu_enc_generate_header_data)   log: 
generated MPEG-4 VOS header with 5 byte../imxvpuapi/imxvpuapi_vpulib.c:2752 (imx_vpu_enc_generate_header_data)   log: 
generated MPEG-4 VIS header with 6 byte../imxvpuapi/imxvpuapi_vpulib.c:2753 (imx_vpu_enc_generate_header_data)   log: 
generated MPEG-4 VOL header with 19 byte../imxvpuapi/imxvpuapi_vpulib.c:2754 (imx_vpu_enc_generate_header_data)   log:
 
[INFO]: VPU number of framebuffers: 4.
[INFO]: Calculated sizes:  frame width&height: 720x480  Y stride: 720  CbCr stride: 360  Y size: 345600  CbCr size: 86
400  MvCol size: 86400  total size: 604801.
allocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x76253000  aligned: 0x76253000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15700000  aligned: 0x15700000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
allocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x761bf000  aligned: 0x761bf000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15000000  aligned: 0x15000000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
allocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x7612b000  aligned: 0x7612b000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15100000  aligned: 0x15100000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
allocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x76097000  aligned: 0x76097000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15200000  aligned: 0x15200000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
allocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:518 (default_dmabufalloc_allocate)   debug: 
retrieved virtual address for physical memory../imxvpuapi/imxvpuapi_vpulib.c:528 (default_dmabufalloc_allocate)   debu
g: 
virtual address:  0x76003000  aligned: 0x76003000../imxvpuapi/imxvpuapi_vpulib.c:533 (default_dmabufalloc_allocate)   
debug: 
physical address: 0x15300000  aligned: 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:534 (default_dmabufalloc_allocate)   
debug: 
attempting to register 2 framebuffers../imxvpuapi/imxvpuapi_vpulib.c:3334 (imx_vpu_enc_register_framebuffers)   debug:
 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 5172  bitstreamWrapAround 0  skipEncoded 0  picType 0 (I)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added MPEG-4 VOS header with 5 byte../imxvpuapi/imxvpuapi_vpulib.c:2855 (imx_vpu_enc_write_header_data)   log: 
added MPEG-4 VIS header with 6 byte../imxvpuapi/imxvpuapi_vpulib.c:2856 (imx_vpu_enc_write_header_data)   log: 
added MPEG-4 VOL header with 19 byte../imxvpuapi/imxvpuapi_vpulib.c:2857 (imx_vpu_enc_write_header_data)   log: 
added main encoded frame data with 5172 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2636  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2636 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2554  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2554 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3566  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3566 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2957  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2957 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3253  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3253 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2792  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2792 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3129  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3129 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3475  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3475 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2909  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2909 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2950  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2950 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2593  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2593 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2808  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2808 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2589  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2589 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2683  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2683 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2755  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2755 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 4907  bitstreamWrapAround 0  skipEncoded 0  picType 0 (I)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added MPEG-4 VOS header with 5 byte../imxvpuapi/imxvpuapi_vpulib.c:2855 (imx_vpu_enc_write_header_data)   log: 
added MPEG-4 VIS header with 6 byte../imxvpuapi/imxvpuapi_vpulib.c:2856 (imx_vpu_enc_write_header_data)   log: 
added MPEG-4 VOL header with 19 byte../imxvpuapi/imxvpuapi_vpulib.c:2857 (imx_vpu_enc_write_header_data)   log: 
added main encoded frame data with 4907 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2477  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2477 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2635  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2635 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2723  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2723 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2769  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2769 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2623  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2623 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2597  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2597 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 2850  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 2850 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3371  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3371 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
encoding raw_frame with physical address 0x15300000../imxvpuapi/imxvpuapi_vpulib.c:3794 (imx_vpu_enc_encode)   log: 
source framebuffer:  Y stride: 720  CbCr stride: 360../imxvpuapi/imxvpuapi_vpulib.c:3814 (imx_vpu_enc_encode)   log: 
waiting for encoding completion../imxvpuapi/imxvpuapi_vpulib.c:3852 (imx_vpu_enc_encode)   log: 
output info:  bitstreamBuffer 0x15400000  bitstreamSize 3146  bitstreamWrapAround 0  skipEncoded 0  picType 1 (P)  num
OfSlices 1../imxvpuapi/imxvpuapi_vpulib.c:3909 (imx_vpu_enc_encode)   log: 
added main encoded frame data with 3146 byte../imxvpuapi/imxvpuapi_vpulib.c:4034 (imx_vpu_enc_encode)   log: 
[INFO]: User command received: Stop recording.
[INFO]: Turning LED OFF.
closing encoder../imxvpuapi/imxvpuapi_vpulib.c:3252 (imx_vpu_enc_close)   debug: 
successfully closed encoder../imxvpuapi/imxvpuapi_vpulib.c:3296 (imx_vpu_enc_close)   debug: 
shut down virtual address for 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc_
deallocate)   debug: 
deallocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   debu
g: 
shut down virtual address for 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc_
deallocate)   debug: 
deallocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   debu
g: 
shut down virtual address for 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc_
deallocate)   debug: 
deallocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   debu
g: 
shut down virtual address for 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc_
deallocate)   debug: 
deallocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   debu
g: 
shut down virtual address for 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc_
deallocate)   debug: 
deallocated 604801 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   debu
g: 
shut down virtual address for 1572864 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:549 (default_dmabufalloc
_deallocate)   debug: 
deallocated 1572864 bytes of physical memory../imxvpuapi/imxvpuapi_vpulib.c:554 (default_dmabufalloc_deallocate)   deb
ug: 
VPU init instance counter: 1../imxvpuapi/imxvpuapi_vpulib.c:341 (imx_vpu_unload)   log: 
unloaded VPU../imxvpuapi/imxvpuapi_vpulib.c:350 (imx_vpu_unload)   debug:

Regards,
Remus.

YUYV format

Hi,

Is it possible to encode a raw picture of format YUYV422 with the libimxvpuapi? (as V4L2-PIX-FMT-YUYV)

Thanks,
Alexis

imxvpudec_h264 fails to initialize DWL instance

I've built libimxdmabuffer with ION allocator support enable and DWL allocator disabled.
I subsequently built libimxvpuapi, gstreamer, and gstreamer-imx successfully.
However, when I attempt to use imxvpudec_h264 it produces:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.099679567 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.099828485 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
0:00:00.104743128 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.104801567 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
0:00:00.109546533 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.109603052 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
0:00:00.114272300 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.114326179 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
0:00:00.119770854 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.119871892 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
0:00:00.124694257 21494 0xaaaac94a04c0 ERROR imxvpuapi imxvpuapi2_imx8m_hantro_decoder.c:1171:imx_vpu_api_dec_open: initializing DWL instance failed
0:00:00.124748016 21494 0xaaaac94a04c0 ERROR imxvpudec gstimxvpudec.c:555:gst_imx_vpu_dec_set_format: could not open decoder: error
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:demux: Internal data stream error.
Additional debug info:
../subprojects/gst-plugins-good/gst/isomp4/qtdemux.c(6545): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:demux:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstQueue:queue1: Internal data stream error.
Additional debug info:
../subprojects/gstreamer/plugins/elements/gstqueue.c(990): gst_queue_handle_sink_event (): /GstPipeline:pipeline0/GstQueue:queue1:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Freeing pipeline ...

swapping in avdec_h264 works just fine--but of course no Hantro VPU hw acceleration.

h264 encoding video distortion

It seems that a green visual effect starts from the top every second, and gets a little worse with each frame until the frame is refreshed. At the default gop-size of 16 it's flashing at approx 1.5-2 hz, on just the top 50 pixels. But if you increase the gop-size to like 100 or so you can see the green spread further down the image over a few seconds before getting the new frame and resetting to a clean image.
screenshot from the start, and another towards the end of a cycle.

Screenshot from 2023-02-06 08-34-05

The visual distortion can be seen at the top left of the image.

Screenshot from 2023-02-06 08-34-32

It seems to be a recent issue, I didn't see this prior to changing the aligned_frame_height for the imx6 vpu encoding issues I was experiencing before, but the previous issue could have been masking this one.

imx6 vpu/ipu elements causing visual distortions

Hello,
I have been attempting to upgrade to versions > 0.10.3, but am running into an issue with visual distortions and a green strip across the bottom 50-100 pixels of the image after encoding. I can take a snapshot of a raw image from the source element prior to being encoded and they look perfect, but after encoding a 1920x1080 image it has bad distortions in it's color, and a green strip across the bottom. This does not happen when scaling the image down prior to encoding to sizes below 1920x1024 (1024 with seems to be special or related to the issue). This occurs on all versions newer then 0.10.3.

Here is the pipeline I have been using for testing
In 0.10.3 I can get 1920x1080 @ 30 fps with perfect image quality
gst-launch-1.0 -v imxv4l2videosrc imx-capture-mode=5 ! video/x-raw,width=1920,height=1080 ! imxipuvideotransform ! video/x-raw,width=1920,height=1080 ! imxvpuenc_h264 bitrate=5000 ! rtph264pay ! queue ! udpsink host=192.168.210.26 port=5004

But after that using this pipeline I get bad visual effects
1920x1080 @ 30 fps with a green strip on the bottom and visual distortions
gst-launch-1.0 -v imxv4l2videosrc ! video/x-raw,width=1920,height=1080,format=I420 ! imxipuvideotransform ! video/x-raw,width=1920,height=1080 ! imxvpuenc_h264 bitrate=5000 ! rtph264pay ! udpsink host=192.168.210.26 port=5004

With newer versions this pipeline doesn't have the bad visual effects
1536 x 1024 @ 25 fps
gst-launch-1.0 -v imxv4l2videosrc ! video/x-raw,width=1920,height=1080,format=NV12 ! imxipuvideotransform ! video/x-raw,width=1536,height=1024 ! imxvpuenc_h264 bitrate=5000 ! rtph264pay ! udpsink host=192.168.210.26 port=5004

many other combinations of resolutions resulted in green strips, and unrecognizable images.

I'm not sure if this issue belongs on here, or on the gst-imx plugin itself as I have not been able to isolate which one is causing it considering they must be updated together

The system I'm working on is an IMX6Q running linux 4.x

Function imx_vpu_dec_get_initial_info return failed

Hi,
When I try to use libimxvpuapi for decode H.264 stream, but i get error when call imx_vpu_dec_decode(), I trace into the vpulib code, find seems error happened in below place.
Could you please give some advice on this error. thanks.
RetCode vpu_DecGetInitialInfo(DecHandle handle, DecInitialInfo * info)

    if (pDecInfo->openParam.bitstreamMode && (val & (1 << 4))) {
        VpuWriteReg(BIT_RUN_INDEX, pCodecInst->instIndex);
        UnlockVpu(vpu_semap);
        return RETCODE_FAILURE;
    }

CPU: Freescale i.MX 6Quad/DualLite/Solo
System: Linux
vpu lib version : major.minor.rel=5.4.16
vpu fw version : major.minor.rel_rcode=2.3.10_r40778

below is debug output.
imxvpuapi_vpulib.c:1811 (imx_vpu_dec_decode) log: input info: 161 byte
imxvpuapi_vpulib.c:1850 (imx_vpu_dec_decode) log: pushing main frame data with 161 byte
imxvpuapi_vpulib.c:1695 (imx_vpu_dec_push_input_data) log: bitstream buffer status: read ptr 0x18800000 write ptr 0x18800000 num free bytes 3143679
[DEBUG] vpu_lib.c:3444 enter vpu_DecGetBitstreamBuffer()
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
imxvpuapi_vpulib.c:1363 (imx_vpu_dec_get_initial_info) log: i.MX6Q
[DEBUG] vpu_lib.c:3525 enter vpu_DecUpdateBitstreamBuffer()
[DEBUG] vpu_lib.c:3526 Update bitstream buffer size 161
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
[DEBUG] vpu_lib.c:2748 enter vpu_DecSetEscSeqInit()
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
imxvpuapi_vpulib.c:1366 (imx_vpu_dec_get_initial_info) log: i.MX6X
imxvpuapi_vpulib.c:1369 (imx_vpu_dec_get_initial_info) log: B errorcode: 0
imxvpuapi_vpulib.c:1372 (imx_vpu_dec_get_initial_info) log: A errorcode: 0
[DEBUG] vpu_lib.c:2794 enter vpu_DecGetInitialInfo()
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_util.c:328 BitIssueCommand 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
imxvpuapi_vpulib.c:1373 (imx_vpu_dec_get_initial_info) log: dec_ret : -1
imxvpuapi_vpulib.c:1379 (imx_vpu_dec_get_initial_info) ERROR: could not retrieve configuration information: failure
[DEBUG] vpu_lib.c:2748 enter vpu_DecSetEscSeqInit()
[DEBUG] vpu_io.c:716 vpu clock gate setting = 1
[DEBUG] vpu_io.c:716 vpu clock gate setting = 0
imxvpuapi_vpulib.c:1936 (imx_vpu_dec_decode) ERROR: Internal error: unspecified error

DQT order

Hi,

The imxvpulib inputs the DQT tables in "natural order" into the imx-vpu library, which emits them in the same order into the DQT marker of the JPEG header. The DQT should be in zig zag order though according to the JPEG spec.

It is not clear to me if the VPU expects another order? There is a table (table 4) with a slightly permuted ordering of a Q Matrix in the VPU API RM. However the imx-vpu lib writes the DQT marker exactly as it is input into the library by imxvpulib.

Checking for library ['hantro_vc8000e', 'm'] not found

Dear @dv1,
I updated the Buildroot based libimxvpuapi-v2 package implemented by Mr. @gibsson of former Boundary Devices to the recent commit that includes the first working version of VC8000E encoder on iMX8M Plus. However, I faced with the following error :

Checking for 'gcc' (C compiler)          : /devel/RT7/SW/rt7-buildroot/output/host/bin/aarch64-none-linux-gnu-gcc 
Checking for compiler switch -D_LARGEFILE_SOURCE : yes 
Checking for compiler switch -D_LARGEFILE64_SOURCE : yes 
Checking for compiler switch -D_FILE_OFFSET_BITS=64 : yes 
Checking for compiler switch -Os                    : yes 
Checking for compiler switch -g0                    : yes 
Checking for compiler switch -D_FORTIFY_SOURCE=1    : yes 
Checking for compiler switch -Wextra                : yes 
Checking for compiler switch -Wall                  : yes 
Checking for compiler switch -pedantic              : yes 
Checking for compiler switch -fPIC                  : yes 
Checking for compiler switch -DPIC                  : yes 
Checking for compiler switch -O2                    : yes 
Checking for compiler switch -std=gnu99             : yes 
Now checking the combination of CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -Wextra -Wall -pedantic -fPIC -DPIC -O2 -std=gnu99 
Checking if this combination works                  : yes 
Checking for compiler switch -std=c99               : yes 
Now checking the combination of CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -Wextra -Wall -pedantic -fPIC -DPIC -O2 -std=c99 
Checking if this combination works                  : yes 
Checking for program 'pkg-config'                   : /devel/RT7/SW/rt7-buildroot/output/host/bin/pkg-config 
Checking for 'libimxdmabuffer >= 1.1.1'             : yes 
Using "/devel/RT7/SW/rt7-buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot" as sysroot path 
Checking for library hantro                         : yes 
Checking for library codec                          : yes 
Checking for header dwl.h                           : yes 
Checking for header codec.h                         : yes 
Checking for library ['hantro_vc8000e', 'm']        : not found 
The configuration failed
(complete log in /devel/RT7/SW/rt7-buildroot/output/build/libimxvpuapi-v2-b79a50a3f2d9e6b383d8bb78c5a4c42cb94a5e67/build/config.log)

Do you have any iead to fix it, please ? Knowing that hantro_vc8000e library seems to be found in the following locations :

build/genimage.tmp/root/usr/lib/libhantro_vc8000e.so.1
build/genimage.tmp/root/usr/lib/libhantro_vc8000e.so
build/linux-DEV_rt7-lf-5.10.72-viper/drivers/mxc/hantro_vc8000e
build/imx-vpu-hantro-vc-1.4.0/usr/lib/libhantro_vc8000e.so.1
build/imx-vpu-hantro-vc-1.4.0/usr/lib/libhantro_vc8000e.so
build/imx-vpu-hantro-vc-1.4.0/usr/include/hantro_VC8000E_enc
target/usr/lib/libhantro_vc8000e.so.1
target/usr/lib/libhantro_vc8000e.so

Perhaps the library would need to be installed into staging folder as well.

Best Regards,
Pascal Le Truong

YUYV format on IMX6

Hi,
I'm actually working on adding libimxvpuapi version 2 to ffmpeg. I'm able to put on the network an encoded camera stream from a IMX6 platform.
Unfortunately, I have an issue concerning the format available in the library for imx6. My camera is streaming in a YUYV422 format and I saw that you have added this format to the library but only for IMX8 platforms. Do you know if I can replace the YUYV format by one supported by IMX6? And which one ? Or is it not possible for IMX6 to encode a YUYV format ?
Thank you,
Kévin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.