{"id":19699484,"url":"https://github.com/darkmoonlite/ros-image-stream-encoder","last_synced_at":"2026-01-30T07:13:12.828Z","repository":{"id":256137004,"uuid":"853151370","full_name":"DARKMOONlite/ros-image-stream-encoder","owner":"DARKMOONlite","description":"a simple ros1 package that allows you to convert an image stream to an mp4 file using ffmpeg","archived":false,"fork":false,"pushed_at":"2024-11-11T00:09:48.000Z","size":104,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T10:34:32.926Z","etag":null,"topics":["ffmpeg","image","image-encoding","jetson","jetson-nano","ros","ros-noetic"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DARKMOONlite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-06T05:00:13.000Z","updated_at":"2024-11-19T04:55:35.000Z","dependencies_parsed_at":"2024-09-18T06:07:09.992Z","dependency_job_id":"e2e74277-7b7b-43a4-905b-37b904013bf0","html_url":"https://github.com/DARKMOONlite/ros-image-stream-encoder","commit_stats":null,"previous_names":["darkmoonlite/image-stream-to-mp4-ros1","darkmoonlite/ros-noetic-image-stream-encoder","darkmoonlite/ros-image-stream-encoder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DARKMOONlite%2Fros-image-stream-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DARKMOONlite%2Fros-image-stream-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DARKMOONlite%2Fros-image-stream-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DARKMOONlite%2Fros-image-stream-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DARKMOONlite","download_url":"https://codeload.github.com/DARKMOONlite/ros-image-stream-encoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241014146,"owners_count":19894201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","image","image-encoding","jetson","jetson-nano","ros","ros-noetic"],"created_at":"2024-11-11T21:00:46.018Z","updated_at":"2026-01-30T07:13:12.821Z","avatar_url":"https://github.com/DARKMOONlite.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ros-image-stream-encoder\na simple ros Noetic package that allows you to convert an image topic to various media files/outputs using the `ffmpeg` library and hardware acceleration. This was designed for use on a jetson nano for storing multiple image streams to the disk.\n\n### Tested on:\n- `Ubuntu: 20.04`\n- `ROS: Noetic`\n- `GPU: 1070ti \u0026 Jetson Nano `\n\n\u003e [!note]\n\u003e  *it should work on other ros 1 versions and other linux distros without issue.*\n\n\n# Install FFmpeg\n\n## Without Hardware Acceleration\n\n```bash\nsudo apt install ffmpeg\n```\n\n\n## With NVidea hardware Acceleration on Jetson\n\nThis Section uses a patched version of FFMpeg created by [jocover](https://github.com/jocover/jetson-ffmpeg) and extended by LinusCDE and can be found [here](https://github.com/LinusCDE/mad-jetson-ffmpeg). Theoretically the installation of ffmpeg should result in the same across the two packages, however I only found success with LinusCDE's package and thus I use it here despite its larger build time.\n1. Ensure that ffmpeg is uninstalled \n```bash\n    sudo apt remove ffmpeg\n```\n1. Install dependencies:\n```bash\n    sudo apt install build-essential cmake pkg-config bzip2 fontconfig libfribidi{0,-dev} gmpc{,-dev} gnutls-bin lame libass{9,-dev} libavc1394-{0,dev} libbluray{2,-dev} libdrm{2,-dev} libfreetype6{,-dev} libmodplug{1,-dev} libraw1394-{11,dev} librsvg2{-2,-dev} libsoxr{0,-dev} libtheora{0,-dev} libva{2,-dev} libva-drm2 libva-x11-2 libvdpau{1,-dev} libvorbisenc2 libvorbis{0a,-dev} libvpx{6,-dev} libwebp{6,-dev} libx11{-6,-dev} libx264-{155,dev} libx265-{179,dev} libxcb1{,-dev} libxext{6,-dev} libxml2{,-dev} libxv{1,-dev} libxvidcore{4,-dev} libopencore-amr{nb0,nb-dev,wb0,wb-dev} opus-tools libsdl2-dev speex v4l-utils zlib1g{,-dev} libopenjp2-7{,-dev} libssh-{4,dev} libspeex{1,-dev} libgmp-dev libgnutls28-dev libladspa-ocaml-dev libmp3lame{0,-dev} libopus{0,-dev} libv4l-{0,dev}\n```\n2. Build library\n```bash\n    git clone https://github.com/LinusCDE/mad-jetson-ffmpeg.git -b release/6.0\n    cd mad-jetson-ffmpeg\n    ./configure \\\n  --prefix=/usr/local \\\n  --extra-cflags=\"-I/usr/local/include\" \\\n  --extra-ldflags=\"-L/usr/local/lib\" \\\n  --disable-debug \\\n  --disable-stripping \\\n  --enable-lto \\\n  --enable-fontconfig \\\n  --enable-gmp \\\n  --enable-gnutls \\\n  --enable-gpl \\\n  --enable-ladspa \\\n  --enable-libass \\\n  --enable-libbluray \\\n  --enable-libdrm \\\n  --enable-libfreetype \\\n  --enable-libfribidi \\\n  --enable-libmodplug \\\n  --enable-libmp3lame \\\n  --enable-libopencore_amrnb \\\n  --enable-libopencore_amrwb \\\n  --enable-libopenjpeg \\\n  --enable-libopus \\\n  --enable-libpulse \\\n  --enable-librsvg \\\n  --enable-libsoxr \\\n  --enable-libspeex \\\n  --enable-libssh \\\n  --enable-libtheora \\\n  --enable-libv4l2 \\\n  --enable-libvorbis \\\n  --enable-libvpx \\\n  --enable-libwebp \\\n  --enable-libx264 \\\n  --enable-libx265 \\\n  --enable-libxcb \\\n  --enable-libxml2 \\\n  --enable-libxvid \\\n  --enable-version3 \\\n  --enable-nonfree \\\n  --enable-nvmpi \\\n  --enable-nvv4l2dec \\\n  --extra-libs=\"-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils\" \\\n  --extra-cflags=\"-I /usr/src/jetson_multimedia_api/include/\" \\\n  --enable-shared\n\n    # build\n    make -j$(nproc)\n```\n2. Install\n```bash\n    sudo make install\n```\n\n\n## With hardware Acceleration on x86_64 (Hasn't been tested fully yet)\n\nto improve encoding speed on a device with a dedicated nvidia gpu, you can build the FFMpeg library with the nvidia codecies\n1. clone and build `ffnvcodec`\n```bash\n    git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git\n    cd nv-codec-headers \u0026\u0026 sudo make install \u0026\u0026 cd -\n```\n2. clone and build the `FFMpeg` public git repo with `cuda-nvcc` (NVENC/NVDEC) enabled \n```bash\ngit clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/\n\nsudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev\n\n./configure --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared\n\nmake -j 4\n```\n\n```bash\nsudo make install\n```\n\n\n# Build and run the package\n\n1. install the package\n```bash\nmkdir ~/catkin_ws/src -p \u0026\u0026 cd ~/catkin_ws/src\n\ngit clone {this package} \ncd ..\n```\n\n2. install dependencies with [rosdep](http://wiki.ros.org/rosdep)\n```bash\nrosdep install --from-paths src --ignore-src -r -y\n```\n3. build \u0026 source the package\n```\ncatkin_make \u0026\u0026 . devel/setup.bash\n```\n\n\n\n## Example\n\nThe current example uses the `usb_cam` package to quickly create an image feed, it can be run via the following lines\n\n```bash\n    roslaunch image_stream_encoder example.launch\n```\n- note: *you will have to have a usb webcam attached and install the usb-cam package via the following line `sudo apt install ros-${ROS_DISTRO}-usb-cam ros-${ROS_DISTRO}-image-view`*\n\n## Supported Codecies / Encoders\n- Node defaults to `h264_nvenc`  which utilises the `NVENC` cores on the jetson's GPU.\n- By default, all are available to work with, you can find a list of them by running `ffmpeg -codecs` or `ffmpeg -encoders`\n\n\n## Common Errors:\n\n#### FFMPEG Relocation Against Symbol\n```bash\n/usr/bin/ld: /usr/local/lib/libavutil.a(tx_float_neon.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ff_tx_tab_2048_float' which may bind externally can not be used when making a shared object; recompile with -fPIC\n\n```\n[Solution](https://stackoverflow.com/questions/13812185/how-to-recompile-with-fpic):\n- Disable assembler optimisations (add --disable-asm to the configure line)\n- Compile dynamic libraries\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmoonlite%2Fros-image-stream-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkmoonlite%2Fros-image-stream-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkmoonlite%2Fros-image-stream-encoder/lists"}