Skip to content

Instantly share code, notes, and snippets.

@sonkm3
sonkm3 / Untitled.ipynb
Created July 3, 2022 06:59
mokupi #31
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sonkm3
sonkm3 / README.md
Last active September 5, 2021 07:41
ffmpegでmpegdash配信するコマンドライン

第29回Raspberry Piもくもく回

Raspberry Piを使って映像と音声の配信をしてみる(ソフトウェア的にはできるだけ高品質に送りたい)

  • ステレオの音声を送信できるようにする
    • HLS or MpegDASH
  • FFmpegをつかう
    • もしくはGStreamer
  • MpegDASHをつかう
  • もしくはHLS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Docker multi platformでraspberrypi osを実行する

Dockerのmultiarch機能を使うとホストとは別のアーキテクチャのコンテナを実行できます

ここではarmhf用のraspberrypi osをDockerコンテナにすることでx86_64などのシステム上で実行してみます
Leverage multi-CPU architecture support

  • システム全体のエミュレーションとは違い、この仕組みではCPUとメモリ、ファイルシステムまでが提供されます。Raspberry Pi特有の機能(GPUやGPIO、Wifi、Bluetoothなど)は提供されません。
@sonkm3
sonkm3 / Dockerfile
Created February 12, 2021 08:27
Raspberry Pi pico用のMicroPythonを手元でビルドするメモ
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake \
build-essential \
binutils-arm-none-eabi \
gcc-arm-none-eabi \
libnewlib-dev \
@sonkm3
sonkm3 / my_first_raspberry_pi_pico.md
Last active February 14, 2021 01:02
Raspberry Pi pico、MicroPythonでLチカするまでのメモ

Raspberry Pi pico、MicroPythonでLチカするまでのメモ

MicroPythonを使えるように準備する

https://www.raspberrypi.org/documentation/pico/getting-started/

  • 「Getting started with MicroPython」のところから「Download UF2 file」をダウンロード
  • Raspberry Pi picoのボタンを押しながらUSBケーブルを接続する(PCに接続する)
  • ダウンロードしたUF2ファイルをマウントされた「RPI-RP2」にコピー
  • 自動でアンマウントされ、再起動したら完了
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#include <Preferences.h>
#include <esp_camera.h>
#include <img_converters.h>
#define APP_NAME "esp32camera"
# -*- coding: utf-8 -*-
import sys
from urllib.request import Request, urlopen
from urllib.parse import urlencode
# todo: logging
def send_notify(key, message, media_url=''):
url = 'https://notify-api.line.me/api/notify'
payload = {'message': message}
headers = {'Authorization': 'Bearer %s' % key}
@sonkm3
sonkm3 / Portfile
Created September 10, 2016 11:08
macports Portfile for phantomjs 2.1.1
# -*- coding:utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$
PortSystem 1.0
PortGroup github 1.0
github.setup ariya phantomjs 2.1.1
name phantomjs
revision 1
@sonkm3
sonkm3 / gist:753acf16d6c10f7fcea5
Created January 8, 2015 06:09
2014 my last.fm daily ranking. (tsv)
2014-01-01 1 Purple Rain Niacin 4
2014-01-01 2 A Change of Seasons Dream Theater 1
2014-01-01 3 A Cool New Way Joe Satriani 1
2014-01-01 4 A Door into Summer Joe Satriani 1
2014-01-01 5 A Love Eternal Joe Satriani 1
2014-01-01 6 Best Laid Plans Niacin 1
2014-01-01 7 Best Of Times Richie Kotzen 1
2014-01-01 8 Blue Mondo Niacin 1
2014-01-01 9 Bluesion Niacin 1
2014-01-01 10 Bootleg Jeans Niacin 1