This is a small helper that uses ffmpeg to record h264 video from openFrameworks.
It starts ffmpeg in a subprocess, so ffmpeg should be available on your system. Tested on Linux but probably works on macOS too.
| from collections import OrderedDict | |
| import os | |
| import json | |
| import genmsg | |
| import rosmsg | |
| import rospkg | |
| def load_specs(context, search_path, msg): |
| import threading | |
| import rospy | |
| def get_single_msg(topic, type_, timeout=None): | |
| """ Utility function that gets a single message from a ROS topic. | |
| Args: | |
| topic: ROS topic (string). |
| from pydrake.symbolic import Variable | |
| from pydrake.systems.analysis import Simulator | |
| from pydrake.systems.controllers import PidController | |
| from pydrake.systems.framework import DiagramBuilder | |
| from pydrake.systems.primitives import SymbolicVectorSystem | |
| x, xd = Variable('x'), Variable('xdot') | |
| f = Variable('f') | |
| state = [x, xd] | |
| k = 1 |
| from pydrake.symbolic import Variable | |
| from pydrake.systems.analysis import Simulator | |
| from pydrake.systems.controllers import PidController | |
| from pydrake.systems.framework import BasicVector, DiagramBuilder, LeafSystem | |
| from pydrake.systems.primitives import SymbolicVectorSystem | |
| k = 1 | |
| s = 1 | |
| m = 1 |
| """ Simple solution for streaming audio from Gqrx to Firefox. | |
| Requires the opusenc command line tool. | |
| This program uses the fact that Opus files can be concatenated to form a valid | |
| stream and that Firefox can play these streams natively. The drawback is the | |
| overhead created by repeatedly inserting containers and metadata into the | |
| stream. | |
| - Check https://fastapi.tiangolo.com/tutorial/ to see how to run the server. |