-
Notifications
You must be signed in to change notification settings - Fork 171
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
mpp encoding YUYV to H264 / H265 (RK3568 / RK3588) #253
Comments
I found out if i encode only one frame I don't get broken horizontal lines. |
Which chip are you using? |
Chip: RK3568 PS: Decoding H264 to I420 works, encoding has the limitation, works always for the first 4 frames. |
@HermanChen On rk3568 encoding and decoding is really stable and a joy. I don't have a camera with NV12 to test and see what would happen during encoding. Any idea? |
@HermanChen |
I tested the kernel 4.19.161 (rockchip developers) on rk3399 which detects my ov4689 and throws a lot of kernel messages and put the kernel in a halt state sensor ov4689 with NV12
|
I would like to add this info to not confuse you (there are two different issues):
Obs: kernel used is rock solid, i can compile kernels on the board and heavy stuff, not a single problem so far. |
Please, note that the size 1920x1080 is the reason for the kernel crash! Works: Kernel crash: |
We can not help much on the camera or sensor part... |
@HermanChen mpp_serivce: mpp_service_cmd_poll ioctl MPP_IOC_CFG_V1 failed ret -1 errno 110 Connection timed out is there any restriction to use the encoder that would limit its use? |
Closing it for now, until the camera code is fixed somehow. Please, if you can comment about the mpp_service_cmd_poll ioctl MPP_IOC_CFG_V1 error I would appreciate it. |
@HermanChen Line 217 in 6cc2ef5
The only sample available with DRM allocator: Line 254 in 6cc2ef5
is with this cam source, and this takes down the kernel when buffer size is 1920x1080. I synced my kernel with @JeffyCN s kernel which seems to have mpp driver updated. I increased CMA and dma buf to 4M, just in case. The memory size allocated by mpp is 1920x1080*2 , what about the alignment? |
the buffer size is for decoder or encoder? |
For the encoder. Decoder is working 100% for any size. |
@HermanChen Why is this buffer (size= 0xa2800) small? Who is setting this value? It comes from: 0x1fe00 = 1920 x 1088
|
Hi @avafinger, Hi @HermanChen Any help appreciated |
Can you share your command? I will check if i can reproduce here. |
I can only speculate, i think the problem is with RGA conversion with dmabuf. If not using dmabuf you face this error:
Unfortunately, i can't do anything about it. Maybe Rockchip ( @HermanChen ) can.. |
You should try with different window sizes, i know there is/are problems with alignment / stride with RGA. |
hi thanks for the input, i used something among this line, without setting strides. i tested with a Microsoft lifecam 720p@30fps, same behavior with an logitech brio and a logitech c920. btw i did not come along the rga error ...
best p |
btw, the artefacts appear across all resolutions ... |
I'll leave it open. |
You should use https://www.kernel.org/doc/html/v5.9/driver-api/dma-buf.html#cpu-access-to-dma-buffer-objects |
The odd thing it only happens with YUYV, NV12 is fine... |
is this shown within the mpi_enc_test examples? |
Nope, but it's a part of the librga sample. IMHO mpi_enc_test should not be responsible for this. It assumes that the user's input is a normal file rather than a device file. |
This error seems a cache issue. Any cpu copy on the image? |
Most likely there is. The issue with YUYV happens on mpi_enc_test,
gstreamer ***@***.***), ffplay (rendering), SDL (rendering with texture).
gstreamer has DMA_BUF_IOCTL_SYNC, maybe not used when YUYV.
Any possible explanation for not happening with NV12?
BTW, i quit github, so not sure this reply can reach the destination....
But i can still follow the conversation.
Please, feel free to close this issue here if completed.
…On Fri, Oct 6, 2023 at 11:03 PM Herman Chen ***@***.***> wrote:
This error seems a cache issue. Any cpu copy on the image?
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LP2DHPXVHFXB5EVBPMLX6CZ7HAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZVGE2TKOJUGAZA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Check the stream from mpi_enc_test first, if there is the lines on the stream then it is an error on copying frame before mpi_enc_test. If there is no lines in the steam then it is the decoding and render issue. |
How to reach you by email? @avafinger |
alex dot mobigo dot gmail dot com
Thanks!
…On Sat, Oct 7, 2023 at 12:10 AM Herman Chen ***@***.***> wrote:
How to reach you by email? @avafinger <https://github.com/avafinger>
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LP67HIC5LUXWLW735SLX6DBZHAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZVGE2TOOJYGE2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You can reproduce it:
Rendering only is fine :
GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0 v4l2src
device=/dev/video22 io-mode=2 !
'video/x-raw,format=YUY2,width=640,height=480' ! glimagesink
render-rectangle='<0,120,640,480>'
Rendering only has artifacts (with dma-buf):
GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0 v4l2src
device=/dev/video22 ! 'video/x-raw,format=YUY2,width=640,height=480' !
glimagesink render-rectangle='<0,120,640,480>'
Rendering only is fine (no dma-buf):
DISPLAY=:0.0 ffplay -f v4l2 -framerate 30 -pixel_format yuyv422 -video_size
640x480 -i /dev/video22 -top 0 -left 1920 -noborder
Recording with mpp and playing back on X86 has artifacts:
(mpp demo) mpi_enc_test -i /dev/video22 -f 8 -w 640 -h 480 -o
out_640x480.h264 -t 7 -n 850 -d 1
(gstreamer) GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0
v4l2src device=/dev/video22 !
'video/x-raw,format=YUY2,width=640,height=480' ! mpph264enc ! filesink
location=test_640x480_30fps_h264.mp4
'
v4l2-ctl --all -d /dev/video22
Driver Info:
Driver name : uvcvideo
Card type : Microsoft LifeCam VX-800: Micro
Bus info : usb-fc880000.usb-1
Driver version : 5.10.110
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : Microsoft LifeCam VX-800: Micro
Serial :
Bus info : usb-fc880000.usb-1
Media version : 5.10.110
Hardware revision: 0x00000101 (257)
Driver version : 5.10.110
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : Microsoft LifeCam VX-800: Micro
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x02000010: from remote pad 0x100000a of entity 'Processing 2' (Video
Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 1280
Size Image : 614400
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height
480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height 480,
Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-10 max=10 step=1
default=2 value=2
contrast 0x00980901 (int) : min=0 max=20 step=1
default=10 value=10
saturation 0x00980902 (int) : min=0 max=10 step=1
default=4 value=4
hue 0x00980903 (int) : min=-5 max=5 step=1
default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=200
step=1 default=130 value=130
gain 0x00980913 (int) : min=32 max=48 step=1
default=34 value=34
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2
value=2 (60 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2800 max=6500
step=1 default=6500 value=6500 flags=inactive
sharpness 0x0098091b (int) : min=0 max=10 step=1
default=4 value=4
backlight_compensation 0x0098091c (int) : min=0 max=1 step=1
default=1 value=1
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3
value=3 (Aperture Priority Mode)
1: Manual Mode
3: Aperture Priority Mode
exposure_absolute 0x009a0902 (int) : min=8 max=16384
step=1 default=512 value=512 flags=inactive
'
…On Sat, Oct 7, 2023 at 9:14 AM Alexander ***@***.***> wrote:
alex dot mobigo dot gmail dot com
Thanks!
On Sat, Oct 7, 2023 at 12:10 AM Herman Chen ***@***.***>
wrote:
> How to reach you by email? @avafinger <https://github.com/avafinger>
>
> —
> Reply to this email directly, view it on GitHub
> <#253 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD62LP67HIC5LUXWLW735SLX6DBZHAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZVGE2TOOJYGE2A>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Forgot to mention mpv, just rendering the camera output is fine with my
setup (most likely no dma-buf):
DISPLAY=:0.0 mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl --opengl-es=yes
--gpu-context=x11egl --drm-draw-plane=overlay
--drm-drmprime-video-plane=primary --drm-device=/dev/dri/card0
--demuxer-lavf-format=video4linux2
--demuxer-lavf-o-set=input_format=yuyv422 av://v4l2:/dev/video22
--loop-file=inf --no-border --audio-device=alsa:device=rockchip-hdmi0 -v
…On Sat, Oct 7, 2023 at 9:59 AM Alexander ***@***.***> wrote:
You can reproduce it:
Rendering only is fine :
GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0 v4l2src
device=/dev/video22 io-mode=2 !
'video/x-raw,format=YUY2,width=640,height=480' ! glimagesink
render-rectangle='<0,120,640,480>'
Rendering only has artifacts (with dma-buf):
GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0 v4l2src
device=/dev/video22 ! 'video/x-raw,format=YUY2,width=640,height=480' !
glimagesink render-rectangle='<0,120,640,480>'
Rendering only is fine (no dma-buf):
DISPLAY=:0.0 ffplay -f v4l2 -framerate 30 -pixel_format yuyv422
-video_size 640x480 -i /dev/video22 -top 0 -left 1920 -noborder
Recording with mpp and playing back on X86 has artifacts:
(mpp demo) mpi_enc_test -i /dev/video22 -f 8 -w 640 -h 480 -o
out_640x480.h264 -t 7 -n 850 -d 1
(gstreamer) GST_GL_X11_NO_DECORATIONS=1 DISPLAY=:0.0 gst-launch-1.0
v4l2src device=/dev/video22 !
'video/x-raw,format=YUY2,width=640,height=480' ! mpph264enc ! filesink
location=test_640x480_30fps_h264.mp4
'
v4l2-ctl --all -d /dev/video22
Driver Info:
Driver name : uvcvideo
Card type : Microsoft LifeCam VX-800: Micro
Bus info : usb-fc880000.usb-1
Driver version : 5.10.110
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : Microsoft LifeCam VX-800: Micro
Serial :
Bus info : usb-fc880000.usb-1
Media version : 5.10.110
Hardware revision: 0x00000101 (257)
Driver version : 5.10.110
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : Microsoft LifeCam VX-800: Micro
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x02000010: from remote pad 0x100000a of entity 'Processing 2'
(Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 1280
Size Image : 614400
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 640, Height 480
Default : Left 0, Top 0, Width 640, Height 480
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 640, Height
480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 640, Height
480, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-10 max=10
step=1 default=2 value=2
contrast 0x00980901 (int) : min=0 max=20 step=1
default=10 value=10
saturation 0x00980902 (int) : min=0 max=10 step=1
default=4 value=4
hue 0x00980903 (int) : min=-5 max=5 step=1
default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=200
step=1 default=130 value=130
gain 0x00980913 (int) : min=32 max=48 step=1
default=34 value=34
power_line_frequency 0x00980918 (menu) : min=0 max=2
default=2 value=2 (60 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature 0x0098091a (int) : min=2800 max=6500
step=1 default=6500 value=6500 flags=inactive
sharpness 0x0098091b (int) : min=0 max=10 step=1
default=4 value=4
backlight_compensation 0x0098091c (int) : min=0 max=1 step=1
default=1 value=1
exposure_auto 0x009a0901 (menu) : min=0 max=3
default=3 value=3 (Aperture Priority Mode)
1: Manual Mode
3: Aperture Priority Mode
exposure_absolute 0x009a0902 (int) : min=8 max=16384
step=1 default=512 value=512 flags=inactive
'
On Sat, Oct 7, 2023 at 9:14 AM Alexander ***@***.***> wrote:
> alex dot mobigo dot gmail dot com
> Thanks!
>
> On Sat, Oct 7, 2023 at 12:10 AM Herman Chen ***@***.***>
> wrote:
>
>> How to reach you by email? @avafinger <https://github.com/avafinger>
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#253 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AD62LP67HIC5LUXWLW735SLX6DBZHAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZVGE2TOOJYGE2A>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
|
now i have the same issue, i have not investigated fully but here are my observations with rk3588
I also have a feeling it is some form of synronization issue somewhere i will dig into it. |
In all situations, i described reproducing the issue *rga* was involved (
*fd* - dma32-buf), it is interesting you one without rga.
Do you have a command line example to reproduce your item 3.?
…On Wed, Nov 15, 2023 at 6:40 AM Hüseyin BIYIK ***@***.***> wrote:
now i have the same issue, i have not investigated fully but here are my
observations with rk3588
1. it happens when using decoder with TIMEOUT_NON_BLOCKING with
external dma32 buffers, i have a different architecture where there is
TIMOUT_BLOCKING with internal buffers is used when decoding, it does not
happen there. (i do not know which is relevant)
2. in my case it also happen when i do not use rga as well, so pure
decoder output
3. it happens with mpeg1/2 or AV1 decoders does not happen with h264
or hevc decoder. (at least in my code)
I also have a feeling it is some form of synronization issue somewhere i
will dig into it.
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LPYYK2HKJN6IZXXK3F3YESE2LAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGIYTCMJVHEYA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
always happens when i play this file: https://github.com/hbiyik/FFmpeg/files/13342554/video_green.mkv.zip typically with ffplay. i really think it is a dmabuf sync issue. |
I don't think it is exactly the same problem for this specific issue but it
is related to sync.
I can play video_green.mkv with Jeffy's ffplay (with rga ioctl) and Nyam's
modified jellyfin ffplay, but not with your branch FFmpeg-exp_refactor_all
and FFmpeg-encoder (the old one).
The ffplay modification is just to render with SDL2 (x11 and bsp) and the
rga call with ioctl and not librga.
What i have noticed is your old branch FFmpeg-encoder displayed a still
image after a while (only one frame i think the last), suggesting the sync
issue.
I used -loop 0 command line parameter for an infinite loop.
[image: ffmpeg.png]
…On Thu, Nov 16, 2023 at 7:12 PM Hüseyin BIYIK ***@***.***> wrote:
always happens when i play this file:
https://github.com/hbiyik/FFmpeg/files/13342554/video_green.mkv.zip
typically with ffplay. i really think it is a dmabuf sync issue.
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LPYC77JQ7ZJRTZTHPP3YE2FVTAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGUZTSNRWGE2A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Looks like the ones that worked were soft-decoded.
…On Thu, Nov 16, 2023 at 8:34 PM Alexander ***@***.***> wrote:
I don't think it is exactly the same problem for this specific issue but
it is related to sync.
I can play video_green.mkv with Jeffy's ffplay (with rga ioctl) and Nyam's
modified jellyfin ffplay, but not with your branch FFmpeg-exp_refactor_all
and FFmpeg-encoder (the old one).
The ffplay modification is just to render with SDL2 (x11 and bsp) and
the rga call with ioctl and not librga.
What i have noticed is your old branch FFmpeg-encoder displayed a still
image after a while (only one frame i think the last), suggesting the sync
issue.
I used -loop 0 command line parameter for an infinite loop.
[image: ffmpeg.png]
On Thu, Nov 16, 2023 at 7:12 PM Hüseyin BIYIK ***@***.***>
wrote:
> always happens when i play this file:
> https://github.com/hbiyik/FFmpeg/files/13342554/video_green.mkv.zip
>
> typically with ffplay. i really think it is a dmabuf sync issue.
>
> —
> Reply to this email directly, view it on GitHub
> <#253 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD62LPYC77JQ7ZJRTZTHPP3YE2FVTAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGUZTSNRWGE2A>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Yeah, this was a bad example due to another bug, ffplay gets stuck after 4th frame in this file. I remembered now running But you are right, even mpv uses drmprime to render in this case ffmpeg decoder is using rga to convert 16byte aligned strides to 64, to satisfy panforks egl |
That's right, mpv worked here.
…On Thu, Nov 16, 2023 at 8:51 PM Hüseyin BIYIK ***@***.***> wrote:
Yeah, this was a bad example dye to another bug
<hbiyik/FFmpeg#35>, ffplay gets stuck after 4th
frame in this file.
I remembered now running mpv --hwdec=rkmpp video_green.mkv should
reproduce it, like expkained here
<hbiyik/FFmpeg#37>
But you are right, even mpv uses drmprime to render in this case ffmpeg
decoder is using rga to convert 16byte aligned strides to 64, to satisfy
panforks egl <hbiyik/FFmpeg#37>.
So you are right in my case it is also rga.
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LP25BSLYGMBTIOMKE43YE2RGVAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGU2TCMBRHE4A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Testing HD 720P camera and mpv.
Would anyone know how to force an hw conversion (mpv yuyv422 -> yuv422p)
and prove my point?
Below is the command line that works but is soft conversion.
***@***.***:~$ DISPLAY=:0.0 mpv --hwdec=rkmpp --vo=gpu --gpu-api=opengl
--opengl-es=yes --gpu-context=x11egl --drm-draw-plane=overlay
--drm-drmprime-video-plane=primary --drm-device=/dev/dri/card0
--demuxer-lavf-format=video4linux2
--demuxer-lavf-o-set=input_format=yuyv422 av://v4l2:/dev/video22
--loop-file=inf --no-border --audio-device=alsa:device=rockchip-hdmi0 -v
[cplayer] Command line options: '--hwdec=rkmpp' '--vo=gpu'
'--gpu-api=opengl' '--opengl-es=yes' '--gpu-context=x11egl'
'--drm-draw-plane=overlay' '--drm-drmprime-video-plane=primary'
'--drm-device=/dev/dri/card0' '--demuxer-lavf-format=video4linux2'
'--demuxer-lavf-o-set=input_format=yuyv422' 'av://v4l2:/dev/video22'
'--loop-file=inf' '--no-border' '--audio-device=alsa:device=rockchip-hdmi0'
'-v'
[cplayer] mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
[cplayer] built on UNKNOWN
[cplayer] FFmpeg library versions:
[cplayer] libavutil 56.70.100
[cplayer] libavcodec 58.134.100
[cplayer] libavformat 58.76.100
[cplayer] libswscale 5.9.100
[cplayer] libavfilter 7.110.100
[cplayer] libswresample 3.9.100
[cplayer] FFmpeg version: 4.4.2-0ubuntu0.22.04.1
[cplayer]
[cplayer] Configuration: ./waf configure --prefix=/usr
--libdir=/usr/lib/aarch64-linux-gnu --confdir=/etc/mpv
--zshdir=/usr/share/zsh/vendor-completions --enable-cdda --enable-dvdnav
--enable-libmpv-shared --enable-sdl2 --disable-build-date --enable-dvbin
[cplayer] List of enabled features: alsa asm caca cdda cplayer cplugins
cuda-hwaccel cuda-interop debug-build drm dvbin dvdnav egl egl-drm
egl-helpers egl-x11 ffmpeg ffmpeg-aviocontext-bytes-read ffnvcodec gbm
gbm.h gl gl-wayland glibc-thread-name glob glob-posix gpl iconv jack
javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libm
libmpv-shared libplacebo librt linux-fstatfs linux-input-event-codes lua
lua52 memfd_create optimize plain-gl posix posix-or-mingw pthreads pulse
rubberband sdl2 sdl2-audio sdl2-gamepad sdl2-video sixel spirv-cross
spirv-cross-shared stdatomic uchardet vaapi vaapi-drm vaapi-egl
vaapi-vulkan vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vector vt.h vulkan
wayland wayland-protocols x11 xv zimg zlib
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /etc/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'hwdec' = 'rkmpp' (flags = 4)
[cplayer] Setting option 'vo' = 'gpu' (flags = 4)
[cplayer] Setting option 'gpu-context' = 'drm' (flags = 4)
[cplayer] Setting option 'drm-draw-plane' = 'overlay' (flags = 4)
[cplayer] Setting option 'drm-drmprime-video-plane' = 'primary' (flags = 4)
[cplayer] Setting option 'hwdec' = 'rkmpp' (flags = 8)
[cplayer] Setting option 'vo' = 'gpu' (flags = 8)
[cplayer] Setting option 'gpu-api' = 'opengl' (flags = 8)
[cplayer] Setting option 'opengl-es' = 'yes' (flags = 8)
[cplayer] Setting option 'gpu-context' = 'x11egl' (flags = 8)
[cplayer] Setting option 'drm-draw-plane' = 'overlay' (flags = 8)
[cplayer] Setting option 'drm-drmprime-video-plane' = 'primary' (flags = 8)
[cplayer] Setting option 'drm-device' = '/dev/dri/card0' (flags = 8)
[cplayer] Setting option 'demuxer-lavf-format' = 'video4linux2' (flags = 8)
[cplayer] Setting option 'demuxer-lavf-o-set' = 'input_format=yuyv422'
(flags = 8)
[cplayer] Setting option 'loop-file' = 'inf' (flags = 8)
[cplayer] Setting option 'border' = 'no' (flags = 8)
[cplayer] Setting option 'audio-device' = 'alsa:device=rockchip-hdmi0'
(flags = 8)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Waiting for scripts...
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook
[ytdl_hook] not a ytdl:// url
[avdevice] Opening av://v4l2:/dev/video22
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
[osd/libass] Shaper: FriBidi 1.0.8 (SIMPLE) HarfBuzz-ng 2.7.4 (COMPLEX)
[osd/libass] Setting up fonts...
[demux] Trying demuxers for level=request.
[lavf] Found 'video4linux2,v4l2' at score=100 size=0 (forced).
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[lavf] Could not set AVOption user_agent='libmpv'
[lavf] Could not set AVOption tls_verify='0'
[lavf] Could not set AVOption icy='1'
[lavf] Could not set AVOption timeout='60000000'
[lavf] avformat_find_stream_info() finished after 0 bytes.
[demux] Detected file format: video4linux2,v4l2 (libavformat)
[demux] Stream is not seekable.
[cplayer] Opening done: av://v4l2:/dev/video22
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[cplayer] (+) Video --vid=1 (rawvideo 1280x720 10.000fps)
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0.0
[vo/gpu/x11] Display 0 (HDMI-1): [0, 0, 1920, 1080] @ 60.000000 FPS
[vo/gpu/x11] Display 1 (HDMI-2): [1920, 0, 3840, 1080] @ 60.000000 FPS
[vo/gpu/x11] Current display FPS: 60.000000
arm_release_ver: g13p0-01eac0, rk_so_ver: 9
[vo/gpu/opengl] EGL_VERSION=1.4 Valhall-"g13p0-01eac0"
[vo/gpu/opengl] EGL_VENDOR=ARM
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL_ES
[vo/gpu/opengl] Trying to create GLES 2.x + context.
[vo/gpu/opengl] Choosing visual EGL config 0x9, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='OpenGL ES 3.2
v1.g13p0-01eac0.68603db295fbf2c59ac6b927fdfb1c32'
[vo/gpu/opengl] Detected GLES 3.2.
[vo/gpu/opengl] GL_VENDOR='ARM'
[vo/gpu/opengl] GL_RENDERER='Mali-G610'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='OpenGL ES GLSL ES 3.20'
[vo/gpu/opengl] Loaded extension GL_EXT_disjoint_timer_query.
[vo/gpu/opengl] 16 bit UNORM textures not available.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Disabling HDR peak computation (one or more of the following is
not supported: compute shaders=0, SSBO=0).
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 60.000000 FPS for display sync.
[vd] Container reported FPS: 10.000000
[vd] Codec list:
[vd] rawvideo - raw video
[vd] Opening decoder rawvideo
[vd] Not trying to use hardware decoding: codec rawvideo is not on
whitelist.
[vd] Using software decoding.
[vd] Detected 8 logical cores.
[vd] Requesting 9 threads for decoding.
[vd] Selected codec: rawvideo (raw video)
[vf] User filter list:
[vf] (empty)
[cplayer] Starting playback...
[vd] Using software decoding.
[vd] Decoder format: 1280x720 [0:1] yuyv422 auto/auto/auto/auto/auto
CL=unknown
[vf] [in] 1280x720 yuyv422 bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 1280x720 yuyv422 bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 1280x720 yuyv422 bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 1280x720 yuyv422 bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[autoconvert] Converting yuyv422 -> yuv422p
[swscale] using 5 threads for scaling
[swscale] Using zimg.
[vf] [out] 1280x720 yuv422p bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[cplayer] Set property: shared-script-properties -> 1
[cplayer] VO: [gpu] 1280x720 yuv422p
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 1280x720 yuv422p bt.709/bt.709/bt.1886/limited/display
SP=1.000000 CL=mpeg2/4/h264
[vo/gpu] Resize: 1280x720
[vo/gpu] Window size: 1280x720 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1280x720
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Texture for plane 0: 1280x720
[vo/gpu] Texture for plane 1: 640x720
[vo/gpu] Texture for plane 2: 640x720
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[cplayer] first video frame after restart shown
[cplayer] playback restart complete @ 0.000000, audio=eof, video=playing
[vo/gpu/x11] Disabling screensaver.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
…On Thu, Nov 16, 2023 at 9:02 PM Alexander ***@***.***> wrote:
That's right, mpv worked here.
On Thu, Nov 16, 2023 at 8:51 PM Hüseyin BIYIK ***@***.***>
wrote:
> Yeah, this was a bad example dye to another bug
> <hbiyik/FFmpeg#35>, ffplay gets stuck after
> 4th frame in this file.
>
> I remembered now running mpv --hwdec=rkmpp video_green.mkv should
> reproduce it, like expkained here
> <hbiyik/FFmpeg#37>
>
> But you are right, even mpv uses drmprime to render in this case ffmpeg
> decoder is using rga to convert 16byte aligned strides to 64, to satisfy
> panforks egl <hbiyik/FFmpeg#37>.
>
> So you are right in my case it is also rga.
>
> —
> Reply to this email directly, view it on GitHub
> <#253 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD62LP25BSLYGMBTIOMKE43YE2RGVAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGU2TCMBRHE4A>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
in drm prime ( how ever you can do
this will force the output to yuv422p, still i am not sure how the mpp will output yuyv422, i assume it should output NV16 then yuv422p if size is below <4k, else you will have libyuv conversion. You can see the decoder flow in log if you do |
@avafinger |
now the similar inferface is implemented in mpp e15972e |
i tested again with the latest mpp using the enc demo and YUYV on RK3568
platform (kernel 5.10.160): the same results, mpp, and gstreamer. NV12
works.
I have yet to test your ffmpeg.
v4l2-ctl --all -d /dev/video9
Driver Info:
Driver name : uvcvideo
Card type : USB 2.0 Camera: HD 720P Webcam
Bus info : usb-xhci-hcd.1.auto-1
Driver version : 5.10.160
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : USB 2.0 Camera: HD 720P Webcam
Serial :
Bus info : usb-xhci-hcd.1.auto-1
Media version : 5.10.160
Hardware revision: 0x00000000 (0)
Driver version : 5.10.160
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : USB 2.0 Camera: HD 720P Webcam
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x02000010: from remote pad 0x100000a of entity 'Extension 4' (Video
Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 2560
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height
720, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height
720, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 10.000 (10/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64 step=1
default=0 value=0
contrast 0x00980901 (int) : min=0 max=64 step=1
default=32 value=32
saturation 0x00980902 (int) : min=1 max=128 step=1
default=64 value=64
hue 0x00980903 (int) : min=-40 max=40 step=1
default=0 value=0
gamma 0x00980910 (int) : min=72 max=500 step=1
default=100 value=100
gain 0x00980913 (int) : min=0 max=100 step=1
default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1
value=1 (50 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
sharpness 0x0098091b (int) : min=1 max=10 step=1
default=3 value=3
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1
default=1 value=1
…On Fri, Dec 1, 2023 at 11:19 AM Hüseyin BIYIK ***@***.***> wrote:
now the similar inferface is implemented in mpp e15972e
<e15972e>
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD62LP6BWODDSVDZ3Y4FS2LYHHROZAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGYYTSNJQGQZA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
FYI, i tested the 1.0.3 (2023-12-08) which added dmabuf sync support on my
kernel 5.10.110 (RK3588), unfortunately, the problem persists.
Can someone confirm the problem is not on my side, if you can run on
5.10.160 would also be interesting to check if my kernel is synced with the
latest rga driver.
…On Sat, Dec 2, 2023 at 9:34 AM Alexander ***@***.***> wrote:
i tested again with the latest mpp using the enc demo and YUYV on RK3568
platform (kernel 5.10.160): the same results, mpp, and gstreamer. NV12
works.
I have yet to test your ffmpeg.
v4l2-ctl --all -d /dev/video9
Driver Info:
Driver name : uvcvideo
Card type : USB 2.0 Camera: HD 720P Webcam
Bus info : usb-xhci-hcd.1.auto-1
Driver version : 5.10.160
Capabilities : 0x84a00001
Video Capture
Metadata Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Media Driver Info:
Driver name : uvcvideo
Model : USB 2.0 Camera: HD 720P Webcam
Serial :
Bus info : usb-xhci-hcd.1.auto-1
Media version : 5.10.160
Hardware revision: 0x00000000 (0)
Driver version : 5.10.160
Interface Info:
ID : 0x03000002
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : USB 2.0 Camera: HD 720P Webcam
Function : V4L2 I/O
Flags : default
Pad 0x01000007 : 0: Sink
Link 0x02000010: from remote pad 0x100000a of entity 'Extension 4' (Video
Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 2560
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: ITU-R 601
Quantization : Default (maps to Limited Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 1280, Height
720, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1280, Height
720, Flags:
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 10.000 (10/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64
step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=64 step=1
default=32 value=32
saturation 0x00980902 (int) : min=1 max=128 step=1
default=64 value=64
hue 0x00980903 (int) : min=-40 max=40
step=1 default=0 value=0
gamma 0x00980910 (int) : min=72 max=500
step=1 default=100 value=100
gain 0x00980913 (int) : min=0 max=100 step=1
default=0 value=0
power_line_frequency 0x00980918 (menu) : min=0 max=2
default=1 value=1 (50 Hz)
0: Disabled
1: 50 Hz
2: 60 Hz
sharpness 0x0098091b (int) : min=1 max=10 step=1
default=3 value=3
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1
default=1 value=1
On Fri, Dec 1, 2023 at 11:19 AM Hüseyin BIYIK ***@***.***>
wrote:
> now the similar inferface is implemented in mpp e15972e
> <e15972e>
>
> —
> Reply to this email directly, view it on GitHub
> <#253 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AD62LP6BWODDSVDZ3Y4FS2LYHHROZAVCNFSM5FVWAHOKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGYYTSNJQGQZA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Any progress to resolve? UPD: |
好东西,问题解决了 |
Encoding a camera output /dev/video0 (YUYV) to H264 or H265 get lots of horizontal trashed lines as in the frame sample.
How can i get rid of the noise?
testing with:
mpi_enc_test -i /dev/video0 -f 8 -w 1280 -h 720 -o out_1280x720.h264 -t 7 -n 150 -d 1
Info:
The text was updated successfully, but these errors were encountered: