'잡동사니'에 해당되는 글 14100건
- 2021.11.20 병원 투어 2주차
- 2021.11.19 nc -k 옵션
- 2021.11.18 mp4 container
- 2021.11.18 wayland / weston
- 2021.11.18 구조체 타입과 변수명은 구분된다?
- 2021.11.17 rpi 3b 2초 부팅 이미지 테스트
- 2021.11.17 wayland weston
- 2021.11.16 라즈베리 피코 USB HID 키코드
- 2021.11.16 라즈베리 파이 피코 한글 키 입력?
- 2021.11.15 병원 투어
nc를 이용해 udp 소켓을 테스트 하고 있는데
UDP 서버(?)
| $ nc -ul 0.0.0.0 6000 |
UDP 클라이언트
| $ nc -u 0.0.0.0 6000 |
로 설정하고 클라이언트에서 1번 메시지를 보낸 후, ctrl-c를 눌러 종료하고
다시 전송하려고 nc -u 옵션을 통해 실행하면 전송되지 않고 종료된다.
혹시나 해서 옵션을 찾아보니 forces nc to stay listening for another connection 이라는게 보이네..
아무튼 udp 커넥션(?)이 이뤄지면 netstat -unl 에서도 사라지는데 멀까...?
| -k' Forces nc to stay listening for another connection after its current connection is completed. It is an error to use this option without the -l option. -l' Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host. It is an error to use this option in conjunction with the -p, -s, or -z options. Additionally, any timeouts specified with the -w option are ignored. |
'프로그램 사용 > nc' 카테고리의 다른 글
| nc 엔터 없이 보내기 (0) | 2024.01.17 |
|---|---|
| shell과 nc를 이용하여 주기적으로 데이터 보내기 (0) | 2023.06.23 |
Structure of MP4 FilesMP4 is an extensible container file, meaning that it does not define a strict structure and allows custom structure and hierarchy for each media type. The data in the MP4 file is divided into two sections, the first containing the media-related data and the second containing metadata. The media data contains audio or video and metadata indicate flags for random access, timestamps, etc. The structures in MP4 are typically referred to as atoms or boxes. The minimum size of an atom is 8 bytes(the first 4 bytes specify size and the next 4 bytes specify type). Here is a list of the root level atoms contained in MP files:
|
[링크 : https://docs.fileformat.com/video/mp4/]
[링크 : http://www.ftyps.com/]
[링크 : https://m.blog.naver.com/yesing1/70096278829]
+
22.01.24
[링크 : https://whitesnake1004.tistory.com/710]
+
팟 플레이어 메타 정보
| General Complete name : C:\file_example_MP4_480_1_5MG.mp4 Format : MPEG-4 Format profile : Base Media / Version 2 Codec ID : mp42 (mp42/mp41/isom/avc1) File size : 1.50 MiB Duration : 30 s 527 ms Overall bit rate : 411 kb/s Encoded date : UTC 2015-08-07 09:13:02 Tagged date : UTC 2015-08-07 09:13:02 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Baseline@L3 Format settings : 3 Ref Frames Format settings, CABAC : No Format settings, Reference fra : 3 frames Format settings, GOP : M=1, N=90 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 30 s 33 ms Bit rate : 300 kb/s Width : 480 pixels Height : 270 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 30.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.077 Stream size : 1.08 MiB (72%) Writing library : x264 core 146 r11M 121396c Encoding settings : cabac=0 / ref=3 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=48 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / stitchable=1 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=infinite / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=300 / ratetol=1.0 / qcomp=0.60 / qpmin=5 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=330 / vbv_bufsize=360 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Encoded date : UTC 2015-08-07 09:13:02 Tagged date : UTC 2015-08-07 09:13:02 Codec configuration box : avcC Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 30 s 527 ms Bit rate mode : Constant Bit rate : 112 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 417 KiB (27%) Encoded date : UTC 2015-08-07 09:13:02 Tagged date : UTC 2015-08-07 09:13:02 |
size(4byte) + fourcc?(4byte) + data 라는 구조로 보면

ftyp 구획은 0x20 =32byte이고 이건 size의 4바이트 포함하여, 포맷의 종류를 적어두는 느낌? mp42 mp41 isom avc1
팟 플레이어 파일 정보 에서는 아래와 같이 나온다.
Codec ID : mp42 (mp42/mp41/isom/avc1)

moov 구획 0x2E30 길이(11824)
인코더의 메타정보 같기도 하고.. L-SMASH Video Handler, L-SMASH Audio Handler 이런 문구가 나온다.

free 구획 8 바이트 길이(내용 없음)

mdat 구획 0x17c690 (1,558,160 바이트)

일단은 mdat 로 끝나도 파일 재생에는 문제 없다.

[링크 : https://file-examples.com/index.php/sample-video-files/sample-mp4-files/]
+
| moov 는 비디오 데이터의 인덱스 역할을 합니다. 플레이어가 이 인덱스에 접근할때까지 영상은 재생되지 않습니다. 보통 moov는 파일을 설명하는 모든 정보가 생성된 뒤에 파일의 끝에 저장됩니다. |
[링크 : https://duzi077.tistory.com/118]
| moov : 미디어의 모든 메타 데이타를 저장하는 무비 박스 (movie box) mvhd: 무비 헤더 박스 (movie header box) trak : 무비 안의 단일 트랙을 정의하는 박스 (track box) ------------ 반복 가능 tkhd : 트랙의 특성을 기술 (track header box) edts : (edit box) elst : (edit list box) mdia : 트랙의 미디어 타입과 샘플 데이타 (media box) mdhd : 미디어의 특성을 기술 (media header box) hdlr : (handler reference box) minf : (media information box) hdlr : (handler reference box) stbl : (sample table box) stsd : 트랙의 디코딩에 필요한 코덱의 정보 (sample description box) stts : 샘플의 시간 (time-to-sample box) stsz : 청크 내 샘플의 크기 (sample size box) stsc : 청크 내 샘플의 수 (sample to chunk box) stco : 청크의 위치 (chunk offset box) |
'이론 관련 > 컴퓨터 관련' 카테고리의 다른 글
| SLP - Superword Level Parallelism (0) | 2022.06.02 |
|---|---|
| digital twin (0) | 2022.04.13 |
| current loop to rs232 (0) | 2021.10.22 |
| usb dwc (0) | 2021.09.23 |
| fp16 (0) | 2021.05.10 |
| static const struct android_wlegl_handle_interface server_handle_impl = { add_fd, destroy }; server_wlegl_handle * server_wlegl_handle_create(uint32_t id) { server_wlegl_handle *handle = new server_wlegl_handle; memset(handle, 0, sizeof(*handle)); handle->resource.object.id = id; handle->resource.object.interface = &android_wlegl_handle_interface; handle->resource.object.implementation = (void (**)(void))&server_handle_impl; handle->resource.destroy = server_wlegl_handle_dtor; handle->resource.data = handle; wl_array_init(&handle->ints); wl_array_init(&handle->fds); return handle; } |
| extern const struct wl_interface android_wlegl_handle_interface; |
[링크 : https://github.com/groleo/simple-yuv/blob/master/wayland-android-client-protocol.h]
'프로그램 사용 > wayland' 카테고리의 다른 글
| weston shell (0) | 2021.11.26 |
|---|---|
| weston_log() (0) | 2021.11.25 |
| wayland weston 구조 (0) | 2021.11.24 |
| wayland weston flow (0) | 2021.11.22 |
| wayland weston (0) | 2021.11.17 |
gcc에서 해보는데 헐.. 이게 되네?
변수명과 구조체 타입명은 다른 영역으로 구분되나?
identifier로 동일하게 취급될줄 알았는데 아니라니?
| $ cat t.c #include <stdio.h> struct help { int a; int b; int c;}; struct help a; int help = 1; void main() { a.a = 5; a.b = 7; a.c = 9; printf("%d %d %d %d\n",help, a.a, a.b, a.c); } |
| $ gcc t.c $ ./a.out 1 5 7 9 |
다만, 함수와 변수명의 식별자 영역은 동일한지 에러가 발생한다.
| $ cat t.c #include <stdio.h> void help() { printf("%s\n",__func__); } struct help { int a; int b; int c;}; struct help a; int help = 1; void main() { a.a = 5; a.b = 7; a.c = 9; printf("%d %d %d %d\n",help, a.a, a.b, a.c); help(); } |
| $ gcc t.c t.c:11:5: error: ‘help’ redeclared as different kind of symbol int help = 1; ^~~~ t.c:3:6: note: previous definition of ‘help’ was here void help() ^~~~ t.c: In function ‘main’: t.c:19:2: error: called object ‘help’ is not a function or function pointer help(); ^~~~ t.c:11:5: note: declared here int help = 1; ^~~~ |
'프로그램 사용 > gcc' 카테고리의 다른 글
| gcc / 문자열 선언 (0) | 2022.03.17 |
|---|---|
| static link (0) | 2022.02.07 |
| gcc unsigned to signed upcast 테스트 (0) | 2021.07.08 |
| gcc vectorized loop (0) | 2021.06.30 |
| gcc unsigned to signed cast (0) | 2021.06.22 |
빠르긴 한데
터미널도 없어진건가?!
| $ sudo fdisk /dev/sda -l Disk /dev/sda: 1.9 GiB, 1977614336 bytes, 3862528 sectors Disk model: SD Transcend Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xdd604128 Device Boot Start End Sectors Size Id Type /dev/sda1 * 1 32768 32768 16M c W95 FAT32 (LBA) /dev/sda2 32769 163840 131072 64M 83 Linux |
| $ ls -al /mnt total 5462 drwxr-xr-x 3 root root 16384 Jan 1 1970 . drwxr-xr-x 21 root root 4096 Aug 20 2020 .. -rwxr-xr-x 1 root root 52296 Nov 16 17:32 bootcode.bin -rwxr-xr-x 1 root root 65 Nov 16 17:32 cmdline.txt -rwxr-xr-x 1 root root 199 Nov 16 17:32 config.txt -rwxr-xr-x 1 root root 2869636 Nov 16 17:32 start.elf drwxr-xr-x 2 root root 2048 Nov 17 2021 'System Volume Information' -rwxr-xr-x 1 root root 2641736 Nov 16 17:32 zImagen $ cat /mnt/config.txt #---> Boot kernel=zImagen disable_overscan=1 boot_delay=0 enable_uart=1 disable_splash=1 #--> OverClock #sdram_freq=700 #initial_turbo=1 #force_turbo=1 #over_voltage=6 #arm_freq=1400 #core_freq=600 $ cat /mnt/cmdline.txt root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200 |
| /mnt/etc $ cat inittab # /etc/inittab # # Copyright (C) 2001 Erik Andersen <andersen@codepoet.org> # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: <id>:<runlevels>:<action>:<process> # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # Startup the system ::sysinit:/bin/mount -t proc proc /proc ::sysinit:/bin/mount -o remount,rw / ::sysinit:/bin/mkdir -p /dev/pts /dev/shm ::sysinit:/bin/mount -a ::sysinit:/sbin/swapon -a null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr ::sysinit:/bin/hostname -F /etc/hostname # now run any rc scripts ::sysinit:/etc/init.d/rcS # Put a getty on the serial port console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL # Stuff to do for the 3-finger salute #::ctrlaltdel:/sbin/reboot # Stuff to do before rebooting ::shutdown:/etc/init.d/rcK ::shutdown:/sbin/swapoff -a ::shutdown:/bin/umount -a -r /mnt/etc/init.d $ ls -al total 9 drwxr-xr-x 2 root root 1024 Nov 16 08:01 . drwxr-xr-x 5 root root 1024 Jan 1 1970 .. -rwxr-xr-x 1 root root 423 Nov 16 08:26 rcK -rwxr-xr-x 1 root root 408 Nov 16 08:26 rcS -rwxr-xr-x 1 root root 1012 Nov 16 08:26 S01syslogd -rwxr-xr-x 1 root root 1004 Nov 16 08:26 S02klogd -rwxr-xr-x 1 root root 1272 Nov 16 08:26 S20urandom -rwxr-xr-x 1 root root 54 Nov 16 08:01 S21ftDev /mnt/etc/init.d $ cat rcS #!/bin/sh # Start all init scripts in /etc/init.d # executing them in numerical order. # for i in /etc/init.d/S??* ;do # Ignore dangling symlinks (if any). [ ! -f "$i" ] && continue case "$i" in *.sh) # Source shell script for speed. ( trap - INT QUIT TSTP set start . $i ) ;; *) # No sh extension, so fork subprocess. $i start ;; esac done pi@raspberrypi:/mnt/etc/init.d $ cat S21ftDev #! /bin/sh /root/QmlTestApplication --platform eglfs /mnt $ sudo ls -al root total 17151 drwx------ 2 root root 1024 Nov 16 08:01 . drwxr-xr-x 19 root root 1024 Jan 1 1970 .. -rwxr-xr-x 1 root root 17710284 Nov 16 08:01 QmlTestApplication /mnt $ sudo file root/QmlTestApplication root/QmlTestApplication: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 4.14.0, stripped |
'embeded > raspberry pi' 카테고리의 다른 글
| rpi 3b 2초 부팅 fs (0) | 2021.11.20 |
|---|---|
| img 파일 마운트 하기 (0) | 2021.11.20 |
| 라즈베리 피코 USB HID 키코드 (0) | 2021.11.16 |
| 라즈베리 파이 피코 한글 키 입력? (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
'프로그램 사용 > wayland' 카테고리의 다른 글
| weston shell (0) | 2021.11.26 |
|---|---|
| weston_log() (0) | 2021.11.25 |
| wayland weston 구조 (0) | 2021.11.24 |
| wayland weston flow (0) | 2021.11.22 |
| wayland / weston (0) | 2021.11.18 |
일단 테스트 해보니.. Keycode.LEFT_ARROW 하니 ctrl+shift+left_arrow 하듯 작동한다.
ascii 문자열로 출력하는 거라 방향키를 넣을 방법은 라이브러리를 수정하기 전에는 불가능 할 듯.
| PRINT_SCREEN = 0x46 """Print Screen (SysRq)""" SCROLL_LOCK = 0x47 """Scroll Lock""" PAUSE = 0x48 """Pause (Break)""" INSERT = 0x49 """Insert""" HOME = 0x4A """Home (often moves to beginning of line)""" PAGE_UP = 0x4B """Go back one page""" DELETE = 0x4C """Delete forward""" END = 0x4D """End (often moves to end of line)""" PAGE_DOWN = 0x4E """Go forward one page""" RIGHT_ARROW = 0x4F """Move the cursor right""" LEFT_ARROW = 0x50 """Move the cursor left""" DOWN_ARROW = 0x51 """Move the cursor down""" UP_ARROW = 0x52 """Move the cursor up""" |
[링크 : https://circuitpython.readthedocs.io/projects/hid/en/latest/_modules/adafruit_hid/keycode.html]
'embeded > raspberry pi' 카테고리의 다른 글
| img 파일 마운트 하기 (0) | 2021.11.20 |
|---|---|
| rpi 3b 2초 부팅 이미지 테스트 (0) | 2021.11.17 |
| 라즈베리 파이 피코 한글 키 입력? (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
| rpi 4는 USB to Ethernet이 아닌가? (0) | 2021.09.29 |
예제 코드를 보다보니 layout 어쩌구 나와서
| from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS |
소스를 뒤져보는데 흐음...
| b"\x04" # a b"\x05" # b b"\x06" # c b"\x07" # d b"\x08" # e |
[링크 : https://github.com/adafruit/Adafruit_CircuitPython_HID/blob/main/adafruit_hid/keyboard_layout_us.py]
걍 한영키 눌러 놓고 아래와 같이 입력하도록 해두니 잘 된다.
"동해물과 백두산이 마르고 딿도록" (딿은 의도적으로 쌍디귿 나오게 하려고 입력한 값)
| keys_pressed = ["ehdgoanfrhk qorentksdl akfmrh Ekfgehfhr"] |
한글 키보드라고 해도.. 키코드는 별개의 문제였구나..
'embeded > raspberry pi' 카테고리의 다른 글
| rpi 3b 2초 부팅 이미지 테스트 (0) | 2021.11.17 |
|---|---|
| 라즈베리 피코 USB HID 키코드 (0) | 2021.11.16 |
| rpi3 2초만에 부팅하기 (0) | 2021.10.30 |
| rpi 4는 USB to Ethernet이 아닌가? (0) | 2021.09.29 |
| rpi zero otg (0) | 2021.09.27 |
