-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Scaling MMAL opaque images #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Resize is there and works - the PiCamera python library makes use of it for one. A quick check says it won't work with MMAL_ENCODING_OPAQUE at the moment, but could be made to work on the input side as it appears to only be some plumbing missing. OPAQUE on the output is not supported, and wouldn't provide much benefit anyway as video_encode has to do a format conversion and subsample. It's VPU code only, not using a dedicated hardware block. In theory the ISP hardware could do the resize purely in hardware, but there's no support code for it at present. |
Thanks, I'll take a look at it. Having opaque input might be a great improvement if it's easy to fix anyway. |
@6by9 @popcornmix Any chance that one of you guys finds some time to enable opaque input? |
Not me as yet. |
@popcornmix would need to give me access to the code and a compiler. If that's possible I guess I could have a go. |
Thinking about it this morning I had reservations as to whether resize would handle the proprietary image format that video decode spits out when in opaque mode. Checking the code it looks like it does, and then I found I had a commit on my local tree dated 17th June "resize: add support for opaque images on the input. Not tested as yet." |
@6by9 Did you happen to have a chance to look into that code? I'd be happy to test it :) |
Code done, but not done even a basic test. Compounded by swapping to a new PC for firmware development. |
@6by9 Great, I should be able to test in at the end of the week then |
raspberrypi/firmware#440 Also adds an option to add SPS timing option into H264 headers. raspberrypi/firmware#245 Both features untested but believed correct.
Test firmware image pushed to https://github.com/6by9/RPiTest/blob/master/resize_opaque/start.elf |
firmware: Camera: Set AWB mode on starting encode See: raspberrypi/linux#1196 firmware: video_encode: option to add timing data to SPS header See: #245 firmware: resize: add support for opaque images on the input See: #440 firmware: Add IL ISP component firmware: Add option to disable touchscreen on Pi display firmware: hdmi: Accept EDID even if checksum is wrong on final read pt 2 See: http://openelec.tv/forum/124-raspberry-pi/74408-problems-with-hdmi-audio-on-openelec-5-0 firmware: dt-blob: Don't assign i2c0 to p28 and p29 on a Pi Zero See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=127292 firmware: platform: Bump default sdram to 450 on Pi0 firmware: mailbox: Add support for enabling/disabling v3d
firmware: Camera: Set AWB mode on starting encode See: raspberrypi/linux#1196 firmware: video_encode: option to add timing data to SPS header See: raspberrypi/firmware#245 firmware: resize: add support for opaque images on the input See: raspberrypi/firmware#440 firmware: Add IL ISP component firmware: Add option to disable touchscreen on Pi display firmware: hdmi: Accept EDID even if checksum is wrong on final read pt 2 See: http://openelec.tv/forum/124-raspberry-pi/74408-problems-with-hdmi-audio-on-openelec-5-0 firmware: dt-blob: Don't assign i2c0 to p28 and p29 on a Pi Zero See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=127292 firmware: platform: Bump default sdram to 450 on Pi0 firmware: mailbox: Add support for enabling/disabling v3d
popcornmix has tagged the latest commit as including my commit, so hopefully it should address this issue - resize should now accept opaque buffers at least on the input. Sorry it's taken so long. I haven't been as thorough on the testing as I could have been, so please report back if you do find anything funny. Something else you might want to try - there's a new component "vc.ril.isp". It's a wrapper around the ISP hardware, so it can do resize and format conversion with minimal VPU overhead. Currently RGB888, BGR888, or various YUV flavours on the input (not opaque at the moment), and I420 on the output. This is my current spare time project, so please let me know if you find problems. |
Thanks for the update. Unfortunately last weeks got unexpectedly troublesome so I was unable to test it yet. But it's quite on the top of my agenda. |
Yes, with vc.ril.isp the scaling is done by hardware block normally used by the camera. There's a small setup phase, and then the VPU just has to give the hardware a pointer to the new buffer for each frame :-) |
@julianscheel is this still an issue? |
@popcornmix Unfortunately I never came to down to really implement this. But I still have at least one project pending where I'll need it. It's just not really clear at what point in time it will happen. |
Yes. I'll close for now as we believe the issue is resolved. |
firmware: Camera: Set AWB mode on starting encode See: raspberrypi/linux#1196 firmware: video_encode: option to add timing data to SPS header See: raspberrypi#245 firmware: resize: add support for opaque images on the input See: raspberrypi#440 firmware: Add IL ISP component firmware: Add option to disable touchscreen on Pi display firmware: hdmi: Accept EDID even if checksum is wrong on final read pt 2 See: http://openelec.tv/forum/124-raspberry-pi/74408-problems-with-hdmi-audio-on-openelec-5-0 firmware: dt-blob: Don't assign i2c0 to p28 and p29 on a Pi Zero See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=127292 firmware: platform: Bump default sdram to 450 on Pi0 firmware: mailbox: Add support for enabling/disabling v3d
Is there any option to scale an MMAL opaque images on the GPU? I am thinking about a transcoding usecase where a pipeline video_decode->imagefx(deinterlace)->scale->video_encode would be required. But so far the only hw accelerated scaling options I am aware of are dispmanx and GLES. Where I don't see an option for both of them to be used as part of an opaque/zerocopy chain.
The text was updated successfully, but these errors were encountered: