1) I can't control ISP parameters except exposure and analogue_gain that are provided for controlling via V4L2 ioctl's to /dev/v4l-subdev2 which is camera controller. Why there is only 2 sensor parameters that i can set? Other ones are not related to sensor parameters or marked as read-only 2) I have no clue how to access hardware h264/h265 encoder. There is magic device called /dev/vcodec in my device tree, but i dont have any information if this is right thing. ffmpeg is trying to seek for encoder device when i provide m2m encoder (which should be bound to hardware), but it is only looking for /dev/video* devices. Using software h264 encoder is highly discouraged as it is very slow for this tiny SoC rv1103. Maybe someone had an experience in using hardware rockchip encoder via driver API or other multimedia frameworks?
this is the output of ffmpeg command to encode raw NV21 video:
Code: Select all
ffmpeg -f rawvideo -c:v hevc_v4l2m2m -pixel_format nv21 -v
ideo_size 480x320 -i out.raw out.mp4 -loglevel debug
Code: Select all
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'hevc_v4l2m2m'.
Reading option '-pixel_format' ... matched as AVOption 'pixel_format' with argument 'nv21'.
Reading option '-video_size' ... matched as AVOption 'video_size' with argument '480x320'.
Reading option '-i' ... matched as input url with argument 'out.raw'.
Reading option 'out.mp4' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url out.raw.
Applying option f (force format) with argument rawvideo.
Applying option c:v (codec name) with argument hevc_v4l2m2m.
Successfully parsed a group of options.
Opening an input file: out.raw.
[rawvideo @ 0x5083d0] Opening 'out.raw' for reading
[file @ 0x508bc0] Setting default whitelist 'file,crypto,data'
[rawvideo @ 0x5083d0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[extract_extradata @ 0x510e40] No start code is found.
[rawvideo @ 0x5083d0] After avformat_find_stream_info() pos: 230400 bytes read:230400 seeks:0 frames:0
out.raw: could not find codec parameters
Input #0, rawvideo, from 'out.raw':
Duration: N/A, bitrate: N/A
Stream #0:0, 0, 1/25: Video: hevc, 1 reference frame, nv21, 480x320 (0x0), 0/1, 46080 kb/s, 25 tbn
Successfully opened the file.
Parsing a group of options: output url out.mp4.
Successfully parsed a group of options.
Opening an output file: out.mp4.
[file @ 0x54cd80] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
[hevc_mp4toannexb @ 0x508210] The input looks like it is Annex B already
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video20
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp-input-params' in unknown mode
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video19
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp-statistics' in unknown mode
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video18
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_rawrd2_s' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video17
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_rawrd0_m' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video16
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_lumapath' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video15
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_bypasspath_4x4sampling' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video14
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_mainpath_4x4sampling' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video13
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_bypasspath' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video12
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_selfpath' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video11
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkisp_v7' on card 'rkisp_mainpath' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video10
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video9
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video8
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video7
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video6
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video5
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video4
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video3
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video2
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video1
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] probing device /dev/video0
[hevc_v4l2m2m @ 0x54a4f0] driver 'rkcif' on card 'rkcif' in mplane mode
[hevc_v4l2m2m @ 0x54a4f0] v4l2 output format not supported
[hevc_v4l2m2m @ 0x54a4f0] Could not find a valid device
[hevc_v4l2m2m @ 0x54a4f0] can't configure decoder
Stream mapping:
Stream #0:0 -> #0:0 (hevc (hevc_v4l2m2m) -> h264 (libx264))
Error while opening decoder for input stream #0:0 : Invalid argument
[AVIOContext @ 0x54cde0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x510d70] Statistics: 230400 bytes read, 0 seeks