Rust port of ffmpeg's native AAC encoder

Overview

raash 🪇

An attempt at RIIR-ing the native AAC encoder from ffmpeg.

First, I used c2rust to translate all relevant C code into Rust, and I'm in the process of re-writing it in a more Rust-y way, bit-by-bit.

State

The resultant library can be used in lieu of the native ffmpeg AAC encoder, and produces reasonable (to my ears) AAC-encoded audio.

Most of the code is still the C code translated verbatim into Rust, and I'm pretty certain I introduced bugs and mistakes in the code I did translate (I don't really know anything about audio encoding 😳).

Usage

First:

cargo build

In order to build ffmpeg with this library instead of the native one, after cloning the ffmpeg repo the following changes must be changed to the configuration and build files:

  • Comment out building the C obj files for the native encoder in libavcodec/Makefile:

    # OBJS-$(CONFIG_AAC_ENCODER)             += aacenc.o aaccoder.o aacenctab.o    \
    #                                           aacpsy.o aactab.o      \
    #                                           aacenc_is.o \
    #                                           aacenc_tns.o \
    #                                           aacenc_ltp.o \
    #                                           aacenc_pred.o \
    #                                           psymodel.o kbdwin.o \
    #                                           mpeg4audio_sample_rates.o
  • Run ./configure and then alter the resultant ffbuild/config.mak in order to link the ffmpeg binary against raash. Change the following line:

    EXTRALIBS-avcodec=-pthread -lm -latomic
    

    to:

    EXTRALIBS-avcodec=-pthread -lm -latomic -L/path/to/raash/target/debug -l:libraash.a
    

Now you can run make and then try to encode a file to AAC using your newly built ffmpeg:

./ffmpeg -i my_audio_file.wav -f adts my_audio_file.aac
You might also like...
Simple utility to ping a TCP port.

TcpPing Simple utility to ping a TCP port. Example tcpping 1.1.1.1 53 -b en0 -i 1 -t 4 Connected to 1.1.1.1:53 in 21 ms Connected to 1.1.1.1:53 in 3

A cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

Cross-platform, user-space WireGuard port-forwarder that requires no system network configurations.

A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption
A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

A fast, stable, efficient, and lightweight intranet penetration, port forwarding tool supports multiple connections, cascading proxy, and transmission encryption

A simple, single threaded and minimalistic port checker

A simple, single threaded and minimalistic port checker

A tcp port forwarding system like ngrok.

Pruxy A tcp port forwarding system like ngrok. Todo http request handler agent - server connection agent How to use Generate cert files mkdir ssl_ce

Simple port-forwarding utility
Simple port-forwarding utility

fport Simple port-forwarding utility using the NAT-PMP protocol. Installation Install the Rust lang toolchain from here. Then run the following comman

A open port scanner.
A open port scanner.

opscan A open port scanner. Install With cargo cargo install --force opscan With docker docker run --rm -it sigoden/opscan opscan.nmap.org Binaries

Convert TeleInfo frames from a Linky meter's serial port to Home Assistant-compatible MQTT messages.
Convert TeleInfo frames from a Linky meter's serial port to Home Assistant-compatible MQTT messages.

teleinfo2mqtt-rs Convert TeleInfo frames from a Linky meter's serial port to Home Assistant-compatible MQTT messages. Overview sequenceDiagram par

Grow Rust is a Growtopia Private Server made in Rust

Grow Rust is a Growtopia Private Server made in Rust

Owner
Yotam Ofek
Yotam Ofek
An app which reads data from a serial port and serves it on a TCP port.

serial-to-tcp An app which reads data from a serial port and serves it on a TCP port. How to use Clone this repo and build the app as outlined below (

Mr. E 3 Oct 21, 2022
A DHCP parser and encoder for DHCPv4/DHCPv6

dhcproto A DHCP parser and encoder for DHCPv4/DHCPv6. dhcproto aims to be a functionally complete DHCP implementation. Many common option types are im

BlueCat Engineering 80 Dec 11, 2022
Rust client for NATS, the cloud native messaging system.

A Rust client for the NATS messaging system. Status Motivation Rust may be the most interesting new language the NATS ecosystem has seen. We believe t

NATS - The Cloud Native Messaging System 651 Jan 3, 2023
Rust-native IPC broker

elbus - Rust-native IPC broker Note: the project is under development and in alpha stage https://elbus.bma.ai/ What is elbus elbus is a rust-native IP

Altertech 66 Dec 31, 2022
A library-first, lightweight, high-performance, cloud-native supported API gateway🪐 by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
Rust port of stb_image_write.h

Overview stb_image_write_rust is Rust port of stb_image_write.h, which is library to save images in BMP, JPG, PNG and TGA formats. The porting was don

null 1 Jan 6, 2022
A simple tool in Rust to split urls in their protocol, host, port, path and query parts.

rexturl A simple tool to split urls in their protocol, host, port, path and query parts. Install cargo install rexturl or clone the source code and r

Volker Schwaberow 3 Oct 22, 2022
Rust port of maaslalani/confetty

confetty_rs Particle System written in rust and rendered in the terminal via ratatui. Mostly a rust port of confetty. Homebrew Particle System Also ma

null 17 Feb 10, 2024
Cloud Native high performance security and privacy SQL proxy.

Fern proxy With the advent of Cloud Native applications, architecture patterns evolved and emerged to take advantage of cloud computing, and build mor

Fern 12 Nov 7, 2022
A high performance TCP SYN port scanner.

Armada A High-Performance TCP SYN scanner What is Armada? Armada is a high performance TCP SYN scanner. This is equivalent to the type of scanning tha

resync 259 Dec 19, 2022