Apologies it took me this long to reply, but here's a sample of ffprobe output.
I would guess that the TAG fields are what you're editing with metadata calls in ffmpeg...so I gave it a shot. I don't think you can edit metadata fields in bulk, you have to make multiple calls. I tried to edit two at once and it set a single field to both values (using the standard colon-separated syntax that ff* tools like to use). So here's how I edited the metadata using ffmpeg (which originally took about 60 seconds, the second run took about 10 seconds):
The problem here is that ffmpeg muxes the file as it changes the metadata. MKVToolnix doesn't, so it's the better tool for this job. I'm just less familiar with it. Here's the output from ffprobe after this operation:
I would look at MKVToolnix, specifically mkvpropedit. Brief look seems like there's not a ton on audio track editing with tags, but I didn't do a deep dive. A quick search around might give you more examples to work from. The reason I have the flow above worked out is because it's easy to integrate into my scripting for automated encoding and it's all in the same ecosystem so I know I'm working with the same information (ffprobe will have the same info as ffmpeg to work with). The muxing time is irrelevant when you're already encoding or remuxing a file anyway...
Code:
bitmap@server~: ffprobe -hide_banner -v quiet -show_streams -select_streams a media.mkv
[STREAM]
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
initial_padding=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=192000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
TAG:language=jpn
TAG:title=Stereo
TAG:BPS-eng=192000
TAG:DURATION-eng=01:36:22.912000000
TAG:NUMBER_OF_FRAMES-eng=180716
TAG:NUMBER_OF_BYTES-eng=138789888
TAG:SOURCE_ID-eng=0180BD
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.17.5 linux(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2023-09-30 22:27:21
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[/STREAM]
I would guess that the TAG fields are what you're editing with metadata calls in ffmpeg...so I gave it a shot. I don't think you can edit metadata fields in bulk, you have to make multiple calls. I tried to edit two at once and it set a single field to both values (using the standard colon-separated syntax that ff* tools like to use). So here's how I edited the metadata using ffmpeg (which originally took about 60 seconds, the second run took about 10 seconds):
Code:
bitmap@server:folder$ ffmpeg -y -i media.mkv -c copy -metadata:s:a:0 'language=eng' -metadata:s:a:0 'title=OPUS 5.1' "test.mkv"
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[out#0/matroska @ 0x560f44b98280] video:4226494kB audio:135537kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068291%
frame=173315 fps=3019 q=-1.0 Lsize= 4365010kB time=01:36:22.88 bitrate=6183.5kbits/s speed= 101x
The problem here is that ffmpeg muxes the file as it changes the metadata. MKVToolnix doesn't, so it's the better tool for this job. I'm just less familiar with it. Here's the output from ffprobe after this operation:
Code:
bitmap@server:folder$ ffprobe -hide_banner -v quiet -show_streams -select_streams a -i test.mkv
[STREAM]
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
initial_padding=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/1000
start_pts=0
start_time=0.000000
duration_ts=N/A
duration=N/A
bit_rate=192000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
TAG:language=eng
TAG:title=OPUS 5.1
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
TAG:BPS-eng=192000
TAG:DURATION-eng=01:36:22.912000000
TAG:NUMBER_OF_FRAMES-eng=180716
TAG:NUMBER_OF_BYTES-eng=138789888
TAG:SOURCE_ID-eng=0180BD
TAG:_STATISTICS_WRITING_APP-eng=MakeMKV v1.17.5 linux(x64-release)
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2023-09-30 22:27:21
TAG:DURATION=01:36:22.912000000
[/STREAM]
I would look at MKVToolnix, specifically mkvpropedit. Brief look seems like there's not a ton on audio track editing with tags, but I didn't do a deep dive. A quick search around might give you more examples to work from. The reason I have the flow above worked out is because it's easy to integrate into my scripting for automated encoding and it's all in the same ecosystem so I know I'm working with the same information (ffprobe will have the same info as ffmpeg to work with). The muxing time is irrelevant when you're already encoding or remuxing a file anyway...
Jellyfin 10.10.0 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage