Jump to content

divis1969

Members
  • Posts

    67
  • Joined

  • Last visited

Reputation Activity

  1. Like
    divis1969 got a reaction from Igor in Recommended way to upgrade Armbian Bionic to Focal   
    Banana PI. A20. Initially this topic was posted in the appropriate forum.
     
    The question was: why do I need to freeze it from technical POV.
    I do understand your team have limitations on support. The device I'm going to play with is mostly used for testing purposes, so if I completely fail with upgrade, I will do a clean install.
    And thanks for the great job.
     
    Do you mean do-release-upgrade or manual source list change?
    I see there is some way to enable the 3rd party update along with the system upgrade (https://ubuntu.com/blog/how-to-upgrade-from-ubuntu-18-04-lts-to-20-04-lts-today , see Advanced options & third-party software).
    Maybe I could try this and enable armbian repositories.
  2. Like
    divis1969 got a reaction from gounthar in Cedrus on Armbian   
    I have reverted the following commits:
     
    341772b82a3b media: cedrus: Specify H264 startcode and decoding mode 8cae93e09011 media: uapi: h264: Add the concept of start code 5604be66a568 media: uapi: h264: Add the concept of decoding mode Now I can run decoding of H264:
    $ export LIBVA_DRIVER_NAME=v4l2_request $ time ffmpeg -hwaccel vaapi -hwaccel_device /dev/video0 -hwaccel_output_format vaapi -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -f null /dev/null ... real 0m15.255s user 0m5.651s sys 0m1.693s Average speed is ~5.3x, fps ~130
    There are some errors at the end though:
     
    [AVHWFramesContext @ 0xae54cfe0] Failed to destroy surface 0x400000b: 6 (invalid VASurfaceID). Here is the test of decoding without hardware:
    $ time ffmpeg -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -f null /dev/null real 0m37.776s user 0m57.906s sys 0m1.983s Average speed is ~2.0x, fps ~50
    I also tried to decode in software and encode in hardware. This causes crash of ffmpeg (I was not able to get a stack with gdb yet):
    ffmpeg -vaapi_device /dev/video0 -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -vf 'format=nv12,hwupload' -c:v h264_vaapi -an stream.mp4 ... Segmentation fault  
  3. Like
    divis1969 got a reaction from gounthar in Cedrus on Armbian   
    I've found that the issue with h264 codec is caused by the size of the struct v4l2_ctrl_h264_slice_params defined in include/media/h264-ctrls.h (kernel) and include/h264-ctrls.h (libva-v4l2-request).
    Kernel's version adds one more field start_byte_offset with commit
    commit 5604be66a56867a784e162299a48c214921ffa1b Author: Boris Brezillon <boris.brezillon@collabora.com> Date: Fri Aug 16 13:01:24 2019 -0300 media: uapi: h264: Add the concept of decoding mode I did not find any changes in libva-v4l2-request that match this change in kernel.
    I'm going to revert the above commit to test whether this can fix the issue.
  4. Like
    divis1969 got a reaction from gounthar in Cedrus on Armbian   
    Yes, I did. If was long time ago and I found kerberosio more attractive. There was also a performace issue with ZM on bananapi that time.
    I've tested ZM recently again (on bananapi m3) and it seems using less CPU than kerberosio while movement detection. So, I would switch to ZM if it will be able to handle >1 cameras.
    But I decided to first play with HW decoding on bananapi prior to migrating to ZM.
     
    -----
    Here are the results of my attempt to use cedrus.
    - I've built libva-v4l2-request. There were few issues with it. It requires libva-dev and libdrm-dev, I've installed it with apt.
    Version release-2019.03 of libva-v4l2-request failed on build due to libva-dev version mismatch (this package seems declared incorrect verion for pkg-config).
    I've switched to a tip of the master branch was built successfully (but with small change in the /usr/include/linux/videodev2.h - I've added v4l2_timeval_to_ns which
    is missing. BTW, I've also installed linux headers with apt, these headers contain v4l2_timeval_to_ns but libva-v4l2-request does not use these)
    This lib is installed by default to /usr/lib/dri/, but libVA will search it under /usr/lib/arm-linux-gnueabihf/dri/ and I've just create a symbolic link. Maybe --prefic should be specified to autoconf instead.

    - I've tried to use this lib with ffmpeg (default, installed with apt):
    export LIBVA_DRIVER_NAME=v4l2_request ffmpeg -v verbose -hwaccel vaapi -hwaccel_device /dev/video0 -hwaccel_output_format vaapi -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -r 5 -an stream.mp4
    It produces the following error:
     
    [AVHWDeviceContext @ 0x1d7a820] libva: VA-API version 1.1.0 [AVHWDeviceContext @ 0x1d7a820] libva: va_getDriverName() returns -1 [AVHWDeviceContext @ 0x1d7a820] libva: User requested driver 'v4l2_request' [AVHWDeviceContext @ 0x1d7a820] libva: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so [AVHWDeviceContext @ 0x1d7a820] libva: Found init function __vaDriverInit_1_1 [AVHWDeviceContext @ 0x1d7a820] libva: va_openDriver() returns 0 [AVHWDeviceContext @ 0x1d7a820] Initialised VAAPI connection: version 1.1 [AVHWDeviceContext @ 0x1d7a820] Unknown driver "v4l2-request", assuming standard behaviour. Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [h264 @ 0x1d77fc0] Reinit context to 1280x720, pix_fmt: vaapi_vld v4l2-request: Unable to set control: Bad address v4l2-request: Unable to queue media request: No such file or directory [h264 @ 0x1d77fc0] Failed to end picture decode issue: 1 (operation failed). [h264 @ 0x1d77fc0] hardware accelerator failed to decode picture Kernel log also contains errors:
     
    [94838.781065] cedrus 1c0e000.video-codec: Missing required codec control [94838.785428] cedrus 1c0e000.video-codec: Missing required codec control [94838.791230] cedrus 1c0e000.video-codec: Missing required codec control [94838.794613] cedrus 1c0e000.video-codec: Missing required codec control - I've built v4l2-request-test and play with it. Initially it complains "Unable to start display engine" so, I've commented this functionality (so it can decode, but does not try to display frames).
    This suite contains several test packages (frames). MPEG2 tests works perfectly (decoding only, as I said).
    H265 tests fail with error Processing frame 1/50 Loaded 145064 bytes of video slice data Unable to set control: Bad address There was no kernel errors.
    H264 tests are disabled because of absence of V4L2_PIX_FMT_H264_SLICE in the system headers (linux headers contain it but autoconf does not see those).
     
    Any suggestions how to enable H264? Should I also rebuild the kernel? What's wrong with H265?
  5. Like
    divis1969 got a reaction from Sash0k in Cedrus on Armbian   
    I've found that the issue with h264 codec is caused by the size of the struct v4l2_ctrl_h264_slice_params defined in include/media/h264-ctrls.h (kernel) and include/h264-ctrls.h (libva-v4l2-request).
    Kernel's version adds one more field start_byte_offset with commit
    commit 5604be66a56867a784e162299a48c214921ffa1b Author: Boris Brezillon <boris.brezillon@collabora.com> Date: Fri Aug 16 13:01:24 2019 -0300 media: uapi: h264: Add the concept of decoding mode I did not find any changes in libva-v4l2-request that match this change in kernel.
    I'm going to revert the above commit to test whether this can fix the issue.
  6. Like
    divis1969 got a reaction from ubobrov in HW accelerated video decoding/encoding on BPI M?   
    I have reworked ffmpeg's cedrus264 encoder to use libcedrus and modified libcedrus to allow few clients to use VE (in the same process).
    How it is possible to use both vdpau-sunxi decoder and cedrus264 encoder to transcode the video.
    The results for
    ./ffmpeg -hwaccel vdpau -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -pix_fmt nv12 -r 5 -an -b:v 64k -c:v cedrus264 stream.mp4 are the following:
    Video is viewable, CPU usage is ~80-90%, FPS while encoding ~6.7, time real 0m56.523s, user 0m28.210s, sys 0m15.720s
    It is not as good as I was expecting though. Perhaps, copying data in memory is a bottleneck.
    Not sure it could be improved
     
    The code is located at https://github.com/divis1969/libcedrus (branch master) and https://github.com/divis1969/FFmpeg (branch 2.8-cedrus)
  7. Like
    divis1969 got a reaction from Nasko in HW accelerated video decoding/encoding on BPI M?   
    I have reworked ffmpeg's cedrus264 encoder to use libcedrus and modified libcedrus to allow few clients to use VE (in the same process).
    How it is possible to use both vdpau-sunxi decoder and cedrus264 encoder to transcode the video.
    The results for
    ./ffmpeg -hwaccel vdpau -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -pix_fmt nv12 -r 5 -an -b:v 64k -c:v cedrus264 stream.mp4 are the following:
    Video is viewable, CPU usage is ~80-90%, FPS while encoding ~6.7, time real 0m56.523s, user 0m28.210s, sys 0m15.720s
    It is not as good as I was expecting though. Perhaps, copying data in memory is a bottleneck.
    Not sure it could be improved
     
    The code is located at https://github.com/divis1969/libcedrus (branch master) and https://github.com/divis1969/FFmpeg (branch 2.8-cedrus)
  8. Like
    divis1969 got a reaction from RagnerBG in HW accelerated video decoding/encoding on BPI M?   
    I have reworked ffmpeg's cedrus264 encoder to use libcedrus and modified libcedrus to allow few clients to use VE (in the same process).
    How it is possible to use both vdpau-sunxi decoder and cedrus264 encoder to transcode the video.
    The results for
    ./ffmpeg -hwaccel vdpau -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -pix_fmt nv12 -r 5 -an -b:v 64k -c:v cedrus264 stream.mp4 are the following:
    Video is viewable, CPU usage is ~80-90%, FPS while encoding ~6.7, time real 0m56.523s, user 0m28.210s, sys 0m15.720s
    It is not as good as I was expecting though. Perhaps, copying data in memory is a bottleneck.
    Not sure it could be improved
     
    The code is located at https://github.com/divis1969/libcedrus (branch master) and https://github.com/divis1969/FFmpeg (branch 2.8-cedrus)
  9. Like
    divis1969 got a reaction from jernej in HW accelerated video decoding/encoding on BPI M?   
    I have reworked ffmpeg's cedrus264 encoder to use libcedrus and modified libcedrus to allow few clients to use VE (in the same process).
    How it is possible to use both vdpau-sunxi decoder and cedrus264 encoder to transcode the video.
    The results for
    ./ffmpeg -hwaccel vdpau -i big_buck_bunny_720p_H264_AAC_25fps_3400K.MP4 -pix_fmt nv12 -r 5 -an -b:v 64k -c:v cedrus264 stream.mp4 are the following:
    Video is viewable, CPU usage is ~80-90%, FPS while encoding ~6.7, time real 0m56.523s, user 0m28.210s, sys 0m15.720s
    It is not as good as I was expecting though. Perhaps, copying data in memory is a bottleneck.
    Not sure it could be improved
     
    The code is located at https://github.com/divis1969/libcedrus (branch master) and https://github.com/divis1969/FFmpeg (branch 2.8-cedrus)
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines