PNM, PNG, TIFF in Gstreamer

1. Gstreamer to PNM to Tiff

Gstreamer PNM Script

 /opt/gst-installed/bin/gst-launch-1.0 -e v4l2src num-buffers=8000 io-mode=1 blocksize=512 \
 ! video/x-raw, format=GRAY16_LE, width=640, height=512 , framerate=7/1 ! queue \
 ! videorate ! video/x-raw, framerate=1/1 ! pnmenc \
 ! multifilesink async=1 location=${RECORD_DIR}/tau2pipe_${TIMESUBFIX}/tau_%05d.pnm

Netpbm – Pnm to tiff

To manimulate pnm, install netpbm package

> sudo apt-get install netpbm

Then for itirating every pnm file in the folder and convert to tiff in a subfolder, using the command below:

> find . -name "tau_*.pnm" -print0 | while read -d $'\0' f; do pnmtotiff -lzw "$f" > ./outtiff/${f%.pnm}.tiff ; done

 

2. Gstreamer to PNG

Gstreamer PNG Script

 log sudo ionice -c 1 -n 0 nice -20 \
 /opt/gst-installed/bin/gst-launch-1.0 -e v4l2src num-buffers=8000 io-mode=1 blocksize=512 \
 ! video/x-raw, format=GRAY16_LE, width=640, height=512 , framerate=7/1 ! queue \
 ! videorate ! videoconvert! video/x-raw, format=GRAY16_BE, framerate=1/1 ! pngenc \
 ! multifilesink async=1 location=${RECORD_DIR}/tau2pipe_${TIMESUBFIX}/tau_%05d.png

 

3. Gstreamer to PNG and UDP

Gstreamer PNG & UDP Script

TODO

 

[Debian Bug] FAT32 Timestamp Offset Issue

FAT32 should be saved using localtime instead of UTC, designed by microsoft. However, FAT32 in Raspbian Version of Linux is saving timestamp with UTC time even without

tz=UTC

option in the /etc/fstab file.

In particular case, the Raspberry Pi records time that shows a 2 hour lags on Windows, which is the time difference between localtime and UTC.

This is an known bug, and developers are generally not actively fixing the bug, unfortunately.

Methods that doest work…

Continue reading

[USB] Auto Mounting of Thumb Drive

Hard Coded Method – fstab file

Files to modify:
/etc/fstab

Template:

# device-spec   mount-point     fs-type      options     dump pass
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
UUID=BCF3-B0C0 /media/pi/TRANSCEND vfat defaults 0 0

Remarks:

Continue reading

Gstreamer 1.10 Cross Compiling

This guide is intended for Raspberry Pi 3B.

0. The Motive

Gstreamer on the package list of Rasbian is 1.4.4 currently, and does not support GRAY16 for some reason. It works fine on Ubuntu based version where the packaged is updated to 1.10.0.

Therefore, building from source is required to support GRAY16 on Raspberry Pi.

1. Set Up Directories

Firstly we need gstreamer source codes, Raspbian root directories (can be simply copy paste) as well as gcc cross compile toolchains.

Continue reading