[libcamera-devel] Video recording on PinePhone Re: libcamera on pinephone

Rafael Diniz rafael at riseup.net
Tue Jul 5 22:39:01 CEST 2022


Backtrack shows me lines are in src/gstreamer/gstlibcamerasrc.cpp:408

406.	/* Fixate caps and configure the stream. */
407.	caps = gst_caps_make_writable(caps);
408.	gst_libcamera_configure_stream_from_caps(stream_cfg, caps);
409. }

which calls... src/gstreamer/gstlibcamera-utils.cpp:300

246.	GstVideoFormat gst_format = 		   			
		pixel_format_to_gst_format(stream_cfg.pixelFormat);
...
299.	if (gst_structure_has_name(s, "video/x-raw")) {
300.	  const gchar *format = gst_video_format_to_string(gst_format);
301.	  gst_structure_fixate_field_string(s, "format", format);
302.	}


(gdb) bt
#0  0x0000007ff7ca2384 in raise (sig=5) at 
../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000007ff7d1586c in g_logv () at 
/usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#2  0x0000007ff7d15a40 in g_log () at 
/usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#3  0x0000007ff5fd6cf8 in gst_video_format_to_string () at 
/usr/lib/aarch64-linux-gnu/libgstvideo-1.0.so.0
#4  0x0000007ff6238c44 in 
gst_libcamera_configure_stream_from_caps(libcamera::StreamConfiguration&, _GstCaps*) 
(stream_cfg=..., caps=caps at entry=0x7fd40016d0) at 
../src/gstreamer/gstlibcamera-utils.cpp:300
#5  0x0000007ff623f03c in gst_libcamera_src_task_enter(GstTask*, 
GThread*, gpointer) (task=0x555581e050, thread=<optimized out>, 
user_data=0x555581d000) at ../src/gstreamer/gstlibcamerasrc.cpp:408
#6  0x0000007ff7f0d6a4 in  () at 
/usr/lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#7  0x0000007ff7d37cf8 in  () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#8  0x0000007ff7d3725c in  () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#9  0x0000007ff7c977e4 in start_thread (arg=0x7fffffe41f) at 
pthread_create.c:486
#10 0x0000007ff7bed59c in thread_start () at 
../sysdeps/unix/sysv/linux/aarch64/clone.S:78

and indeed, reading stuff like this (in gstlibcamera-utils.cpp):

	} else if (gst_structure_has_name(s, "image/jpeg")) {
		stream_cfg.pixelFormat = formats::MJPEG;
	} else {

makes me think twice if adding "JPEG" near "MJPEG" everywhere is a good 
idea. Many hardcoded stuff which needs to be fixed I think.

Any hint is appreciated.

Rafael



On 7/5/22 14:10, Nicolas Dufresne wrote:
> Le mardi 05 juillet 2022 à 18:14 +0300, Rafael Diniz via libcamera-devel a
> écrit :
>> Tested. I still get:
>>
>> gst-launch-1.0 libcamerasrc camera-name="/base/i2c-csi/rear-camera at 4c" !
>> videoconvert ! glimagesink
>> (...)
>> Pipeline is live and does not need PREROLL ...
>> Got context from element 'sink': gst.gl.GLDisplay=context,
>> gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
>> Setting pipeline to PLAYING ...
>> New clock: GstSystemClock
>>
>> ** (gst-launch-1.0:3168): CRITICAL **: 18:07:44.336:
>> gst_video_format_to_string: assertion 'format !=
>> GST_VIDEO_FORMAT_UNKNOWN' failed
> 
> This is a programming error clearly. You can help by capturing this assert in a debugger and sharing the backtrace:
> 
> G_DEBUG=fatal_criticals gdb --args gst-launch-1.0 libcamerasrc camera-name="/base/i2c-csi/rear-camera at 4c" !
>> videoconvert ! glimagesink
> gdb) r
> gdb) thread apply backtrace all
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220705/0d3a41a9/attachment.sig>


More information about the libcamera-devel mailing list