Freescale / libimxvpuapi

i.MX VPU API Library
GNU Lesser General Public License v2.1
88 stars 54 forks source link

Valid mp4 file format? #23

Closed remusmp closed 4 years ago

remusmp commented 6 years ago

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.

dv1 commented 4 years ago

libimxvpuapi deals with elementary streams (which is what codecs actually can process), not with containers. So its output cannot directly be played with VLC. One exception to this is h.264 bitstream output. The Annex-B bitstream acts as a lightweight container that can be played, but only in a very limited fashion.

In any case, libimxvpuapi does not and will not ever directly support MP4, as it is not its task to do so.