edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBca831ceTahinli6 days ago3966 commits
| 1 | #!/usr/bin/env bash |
| 2 | # aac-encode-score.sh: encode reference clips with ffmpeg's native AAC encoder and with ec-aac, |
| 3 | # decode both with ffmpeg, and print objective metrics (scripts/aac_score.py). |
| 4 | # |
| 5 | # Usage: |
| 6 | # scripts/aac-encode-score.sh clips <dir> <src>... # make 10 s, 48 kHz stereo f32le clips |
| 7 | # scripts/aac-encode-score.sh encode <dir> # encode + decode every clip (runs on a server) |
| 8 | # scripts/aac-encode-score.sh score <dir> # print the metrics table (local, numpy) |
| 9 | # |
| 10 | # Clip files are <dir>/clips/<name>.f32le (stereo) and <dir>/clips/<name>-51.f32le (5.1). |
| 11 | # Outputs go to <dir>/out/. Configs: stereo 64, 128 and 256 kbps; 5.1 at 384 kbps. |
| 12 | |
| 13 | |
| 14 | here= |
| 15 | cmd= |
| 16 | dir= |
| 17 | |
| 18 | |
| 19 | case in |
| 20 | clips) |
| 21 | |
| 22 | i=0 |
| 23 | for; do |
| 24 | i= |
| 25 | name=clip |
| 26 | |
| 27 | # Synthetic 5.1 from the stereo clip: front L/R, centre, LFE from the mix, rears from L/R. |
| 28 | |
| 29 | |
| 30 | |
| 31 | done |
| 32 | ;; |
| 33 | encode) |
| 34 | # Runs on the server through remote-run; needs ffmpeg and cargo, not numpy. |
| 35 | |
| 36 | |
| 37 | bin=/release/examples/aacenc_file |
| 38 | for; do |
| 39 | base= |
| 40 | case in *-51) ch=6; configs="384" ;; *) ch=2; configs="64 128 256" ;; esac |
| 41 | for; do |
| 42 | tag=- |
| 43 | |
| 44 | |
| 45 | for; do |
| 46 | |
| 47 | done |
| 48 | |
| 49 | done |
| 50 | done |
| 51 | ;; |
| 52 | score) |
| 53 | for; do |
| 54 | base= |
| 55 | case in *-51) ch=6; configs="384" ;; *) ch=2; configs="64 128 256" ;; esac |
| 56 | for; do |
| 57 | tag=- |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | done |
| 63 | done |
| 64 | ;; |
| 65 | *) |
| 66 | |
| 67 | |
| 68 | ;; |
| 69 | esac |