LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Raspberry Pi Model B Rev 2 with camera module; HowTo setup in motion? (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/raspberry-pi-model-b-rev-2-with-camera-module%3B-howto-setup-in-motion-4175687661/)

floppy_stuttgart 12-29-2020 05:34 AM

Raspberry Pi Model B Rev 2 with camera module; HowTo setup in motion?
 
Hello,
I have a running Raspi with camera module, booted with raspbian buster.
And installed it via the helpfull link https://tutorials-raspberrypi.de/ras...am-einrichten/
I would like to increase the 256x192 setup. How to do this?

here below are few system data and logs.

Quote:

dmesg
Code:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.3+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1386 Sun Dec 27 13:58:20 GMT 2020
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Model B Rev 2
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Reserved memory: created CMA memory pool at 0x13c00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]  Normal  [mem 0x0000000000000000-0x0000000017ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]  node  0: [mem 0x0000000000000000-0x0000000017ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000017ffffff]
[    0.000000] On node 0 totalpages: 98304
[    0.000000]  Normal zone: 864 pages used for memmap
[    0.000000]  Normal zone: 0 pages reserved
[    0.000000]  Normal zone: 98304 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 97440
[    0.000000] Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  console=ttyAMA0,115200 console=tty1 root=PARTUUID=6c586e13-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait


Quote:

v4l2-ctl -V
Code:

Format Video Capture:
        Width/Height      : 1024/768
        Pixel Format      : 'JPEG' (JFIF JPEG)
        Field            : None
        Bytes per Line    : 0
        Size Image        : 786432
        Colorspace        : JPEG
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Full Range)
        Flags            :

If I use 1024x768 in motion.conf , it dont stream the camera; 256x192 is fine.
Can somebody inform how to increase 256x192? (since v4l2-ctl -V show Format Video Capture: Width/Height : 1024/768; but perhaps this is misleading and not achievable, except connecting an expensive webcam via usb?)

motion log showing an issue when the size is given higher than 256x192.
Quote:

/var/log/motion/motion.log
Code:

[5101192:motion] [NTC] [ALL] [Dec 29 11:06:44] motion_startup: Using log type (ALL) log level (NTC)
[5101192:motion] [NTC] [ALL] [Dec 29 11:06:44] become_daemon: Motion going to daemon mode
[5101192:motion] [NTC] [ALL] [Dec 29 11:06:44] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 652
[5101192:motion] [NTC] [ALL] [Dec 29 11:06:44] motion_startup: Motion running as daemon process
[5101192:motion] [NTC] [ENC] [Dec 29 11:06:44] ffmpeg_global_init: ffmpeg libavcodec version 58.35.100 libavformat version 58.20.100
[0:motion] [NTC] [ALL] [Dec 29 11:06:45] main: Camera ID: 0 is from /etc/motion/motion.conf
[0:motion] [NTC] [ALL] [Dec 29 11:06:45] main: Camera ID: 0 Camera Name: (null) Device: /dev/video0
[0:motion] [NTC] [ALL] [Dec 29 11:06:45] main: Waiting for threads to finish, pid: 652
[0:wc0] [NTC] [STR] [Dec 29 11:06:45] http_bindsock: listening on 127.0.0.1 port 8080
[0:wc0] [NTC] [STR] [Dec 29 11:06:45] httpd_run: Started motion-httpd server on port 8080 (auth Disabled)
[1:ml1] [NTC] [ALL] [Dec 29 11:06:45] motion_init: Camera 0 started: motion detection Enabled
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] vid_start: Opening V4L2 device
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_start: Using videodevice /dev/video0 and input -1
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_get_capability:
------------------------
cap.driver: "bm2835 mmal"
cap.card: "mmal service 16.1"
cap.bus_info: "platform:bcm2835-v4l2-0"
cap.capabilities=0x85200005
------------------------
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_get_capability: - VIDEO_OVERLAY
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_get_capability: - READWRITE
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_select_input: name = "Camera 0", type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_select_input: - CAMERA
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_select_input: Device does not support specifying PAL/NTSC norm
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_do_set_pix_format: Testing palette JPEG (1024x768)
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_do_set_pix_format: Using palette JPEG (1024x768) bytesperlines 0 sizeimage 786432 colorspace 00000007
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,100
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Brightness", default 50, current 50
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x00980901, "Contrast", range -100,100
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Contrast", default 0, current 0
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x00980902, "Saturation", range -100,100
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Saturation", default 0, current 0
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x00980918, "Power Line Frequency", range 0,3
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Power Line Frequency", default 1, current 1
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x0098090e, "Red Balance", range 1,7999
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Red Balance", default 1000, current 1000
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls: found control 0x0098090f, "Blue Balance", range 1,7999
[1:ml1] [NTC] [VID] [Dec 29 11:06:45] v4l2_scan_controls:      "Blue Balance", default 1000, current 1000
[1:ml1] [NTC] [ALL] [Dec 29 11:06:45] image_ring_resize: Resizing pre_capture buffer to 1 items
[1:ml1] [WRN] [VID] [Dec 29 11:06:45] jpgutl_decode_jpeg: JPEG image size 1024x768, JPEG was 256x192
[1:ml1] [CRT] [VID] [Dec 29 11:06:45] vid_mjpegtoyuv420p: Corrupt image ... continue
[1:ml1] [WRN] [VID] [Dec 29 11:06:47] jpgutl_decode_jpeg: JPEG image size 1024x768, JPEG was 256x192
[1:ml1] [CRT] [VID] [Dec 29 11:06:47] vid_mjpegtoyuv420p: Corrupt image ... continue
[1:ml1] [WRN] [VID] [Dec 29 11:06:49] jpgutl_decode_jpeg: JPEG image size 1024x768, JPEG was 256x192
[1:ml1] [CRT] [VID] [Dec 29 11:06:49] vid_mjpegtoyuv420p: Corrupt image ... continue


UPDATE/CLOSURE:
following gave an advise https://raspberrypi.stackexchange.co...esolution-only
"setting the v4l2_palette to 17 (Y12) results in successful captures with a original NoIR camera."

Conclusion: 1024x768 works with "v4l2_palette 17 (Y12)". It dont work with "v4l2_palette 9 (JPEG)" https://www.lavrsen.dk/foswiki/bin/v...onV4L2Palette; despite the command
Quote:

v4l2-ctl -V
gave it.

business_kid 12-31-2020 10:05 AM

RazPi WHAT?

There's RazPi 0-4, each with different cpus. Yess, better than 256x192 is possible. You usually set the video in /boot/config.txt, but back up before you start fiddling - they can be very unforgiving if you mess up the boot. It should respond to video mode changes, but there can be battles.


All times are GMT -5. The time now is 10:24 AM.