-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparacoder_commands_OPUS.yml
More file actions
57 lines (45 loc) · 3.77 KB
/
paracoder_commands_OPUS.yml
File metadata and controls
57 lines (45 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
defaults:
# https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.external-config.files.property-placeholders
bitrate: "192"
# https://wiki.hydrogenaud.io/index.php?title=Bitrate#Equivalent_bitrate_estimates_for_multichannel_audio
# The following function gives you a weight w for each cc, where cc is the channel configuration written as a decimal number (1.0 for mono, 2.0 for stereo, 5.1 for surround, etc.):
# w(cc) = cc^0.75
# For 5.1 multichannel audio equivalent bitrate is 192 * w(5.1)/w(2.0) = 192 * (5.1/2.0)^0.75 = 387 kbps (~384 kbps)
ffmpeg: "\"c:\\Rip\\ffmpeg\\bin\\ffmpeg.exe\" -hide_banner -loglevel error -nostats -nostdin"
ffmpeg_Librempeg: "\"c:\\Rip\\FFMPEG (Librempeg)\\ffmpeg.exe\" -hide_banner -loglevel error -nostats -nostdin"
opus: "\"c:\\Rip\\opus-tools\\opusenc.exe\" --quiet --music --vbr"
pattern:
fileExtensions:
- flac
- m4a
- wav
- ape
- dts
- wv
- w64
- aiff
- cue
commandTemplate:
flac: >-
${defaults.opus} --bitrate ${defaults.bitrate:192} "{{F}}" "{{D}}{{P}}{{N}}.opus"
wav: >-
${defaults.opus} --bitrate ${defaults.bitrate:192} "{{F}}" "{{D}}{{P}}{{N}}.opus"
# FFMPEG can't write attached pictures into OPUS. Therefore, we can try to extract it to external file.
# -f lavfi -i nullsrc=s=128x128 --- Creates an additional dummy video stream
# -map 0:v? --- Use first input video stream if exists. When this stream is not exists then second dummy video stream will be used.
# -c:v png -update 1 -frames:v 1 -y --- Extract video stream to file using PNG codec. Update file on every new frame. Use only first frame. Overwrite file if it already exists.
# ${defaults.ffmpeg} -i "{{F}}" -f lavfi -i nullsrc=s=128x128 -map 0:v? -c:v png -update 1 -frames:v 1 -y "{{D}}{{P}}Cover_ffmpeg.png" -map 0:a -c:a copy -map_metadata 0:s:0 -ss {{CUE_ST}} -to {{CUE_ET}} {{CUE_METADATA}} "{{D}}{{P}}{{CUE_NUM}}. {{CUE_TITLE}}.opus"
#
# using -map_metadata 0:s:a:0, which copies metadata from the first input file (0:), first audio stream (s:a:0) (where the metadata is) to all output files (global metadata).
cue_opus: >-
${defaults.ffmpeg} -i "{{F}}" -c:a copy -map_chapters -1 -map_metadata 0:s:a -ss {{CUE_ST}} -to {{CUE_ET}} {{CUE_METADATA}} "{{D}}{{P}}{{CUE_NUM}}. {{CUE_TITLE}}.opus"
cue_mp3: >-
${defaults.ffmpeg} -i "{{F}}" -c copy -ss {{CUE_ST}} -to {{CUE_ET}} {{CUE_METADATA}} "{{D}}{{P}}{{CUE_NUM}}. {{CUE_ARTIST}} - {{CUE_TITLE}}.mp3"
cue_m2ts: >-
${defaults.ffmpeg} -i "{{F}}" -vn -map 0:a:0 -af "channelmap=channel_layout=5.1, aresample=48000:resampler=soxr:precision=30" -c:a libopus -b:a 384k -mapping_family 1 -ss {{CUE_ST}} -to {{CUE_ET}} {{CUE_METADATA}} "{{D}}{{P}}{{CUE_NUM}}. {{CUE_TITLE}}.opus"
# cue_m2ts: >-
# ${defaults.ffmpeg} -i "{{F}}" -vn -map 0:a:0 -c:a flac -ss {{CUE_ST}} -to {{CUE_ET}} {{CUE_METADATA}} -f flac - | ${defaults.opus} --bitrate 384 - "{{D}}{{P}}{{CUE_NUM}}. {{CUE_TITLE}}.opus"
cue_any: >-
${defaults.ffmpeg_Librempeg} -ss {{CUE_ST}} -to {{CUE_ET}} -i "{{F}}" -c:v copy -af "asf2sf=dblp, ardftsrc=48000:quality=65536:bandwidth=0.95" -c:a flac -sample_fmt s32 -compression_level 3 -map_metadata 0:s:a -map_metadata 0 {{CUE_METADATA}} -metadata "ENCODER_OPTIONS=ARDFTSRC=48000:quality=65536:bandwidth=0.95" -f flac - | ${defaults.opus} --bitrate ${defaults.bitrate:192} - "{{D}}{{P}}{{CUE_NUM}}. {{CUE_TITLE}}.opus"
any: >-
${defaults.ffmpeg_Librempeg} -i "{{F}}" -c:v copy -af "asf2sf=dblp, ardftsrc=48000:quality=65536:bandwidth=0.95" -c:a flac -sample_fmt s32 -compression_level 3 -map_metadata 0:s:a -map_metadata 0 -metadata "ENCODER_OPTIONS=ARDFTSRC=48000:quality=65536:bandwidth=0.95" -f flac - | ${defaults.opus} --bitrate ${defaults.bitrate:192} - "{{D}}{{P}}{{N}}.opus"