Jump to content

Support for External Audio tracks?


TFO2020
Go to solution Solved by Luke,

Recommended Posts

TFO2020

Hello all;

 

Does Emby support external audio tracks?

 

Say for example I have a video in MKV format that has a few audio streams in it, and I also have an external audio stream in AC3 format for the same video file. Is there a way to configure Emby to expose the external audio track to the cleints and allow it to be selected instead of one of the intenral audio streams in the MKV file?

 

Thanks!

 

 

Link to comment
Share on other sites

TFO2020

Here are the media details from the Emby Web Client for one example.

 

Video Codec H264
AVC Yes
Profile High
Level 41
Resolution 1920x800
Aspect ratio 2.40:1
Anamorphic No
Interlaced No
Framerate 23.97602
Bitrate 6009 kbps
Bit depth 8 bit
Pixel format yuv420p
Ref frames 5
NAL 4
 
Audio Language eng
Codec DCA
Profile DTS
Layout 5.1
Channels 6 ch
Bitrate 1536 kbps
Sample rate 48000 Hz
Bit depth24 bit
Default Yes
Title Eng Surround Sound
 
Subtitle Language eng
Codec SRT
Default No
Forced No
External Yes
Title Eng
 
Subtitle Language fre
Codec SRT
Default No
Forced No
External Yes
Title Fre
 
Subtitle Language spa
Codec SRT
Default No
Forced No
External Yes
Title Spa
 
Subtitle Language Spanish
Codec SRT
Default No
Forced No
External Yes
Title Spanish
Container mkv
 
​So this is a MKV video with a 6 channel DTS audio track, and Spanish sub titles in the MKV, Then there are English, French, and Spanish external SRT subtitles.
 
​I have a AC3 audio track that is external with the .AC3 extension.  I would like for the Server to identify the .AC3 external audio track and list it here just like the external subtitles.
 
​During playback I would like to be able click the music note icon in the top right corner to select from the MKV internal audio track, or the external .AC3 audio track just like I can for the subtitles where I can select from the internal Spanish subtitles or the external .SRT subtitle files.
 
​My goal is to be able to provide external multi-channel audio tracks for some videos that only have stereo audio tracks internal to the container.
 
​I hope this makes more sense.
 
Thanks!
Edited by TFO2020
Link to comment
Share on other sites

  • Solution

It's in an .ac3 file so that would be a whole new paradigm for us. If there's adequate demand then it's definitely possible.

 

Keep in mind this sort of thing will almost always require the server to convert the media on the fly as most players will not be able to support external audio, even if they already support ac3. If you don't care about this then it's not really a problem, but if you're interested in efficiency then you'll want to just embed the audio into the track.

  • Like 1
Link to comment
Share on other sites

TFO2020

Thank you for the feedback.  For my purposes I don't think transcoding would be an issue.  I would assume the default audio track would be the internal stereo track, so unless a user explicitly selects the external audio track no transcoding would be required.  It would be nice to have the option to use the external  multi-channel audio if desired.

 

The does however answer my question.  It would be awesome to see this feature implimented, but for now I will explore other alternatives.

 

Thank you for all the work you do and for creating an amazing projuct. I'm proud to be a Premiere supporter.

Link to comment
Share on other sites

Happy2Play

Why don't you just add the track to the mkv with mkvmerge?  It can be done is seconds.

  • Like 2
Link to comment
Share on other sites

  • 2 years later...
shrouski

Hi All

 

Did this get any further?

 

There are many reasons for not wanting to touch the MKV/MP4 files for seeding. An on the fly Remux using an external .mka for example should ideally be possible. I've just tried and it seems it's not currently possible.

 

Thanks

Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...
arianx999

it is possible to add external audio to file by using mkvtoolnix  but if you have a large library of these files it takes time for ever

please add this feature

tnx

Link to comment
Share on other sites

How/where do these external audio tracks come from?

In the couple of decades of using media servers I've never come across this before.

I think many of us are trying to understand the use case for this.

Link to comment
Share on other sites

rbjtech
11 hours ago, arianx999 said:

it is possible to add external audio to file by using mkvtoolnix  but if you have a large library of these files it takes time for ever

please add this feature

tnx

A quick batch script to add via mkvtoolnix CLI will automate this operation or you can use ffmpeg to demux, add the track and remux if that suits you better.

I'm with the other though, unless you are converting an existing track to a different format for compatibility reasons (say adding an AAC track from an existing DTS track), then I've never seen audio only tracks being available to 'append' to existing AV media. 

Is there an 'Audio' version of the subtitle providers that we are unaware of ?

 

  • Like 1
Link to comment
Share on other sites

  • 7 months later...
On 4/19/2021 at 5:03 AM, cayars said:

How/where do these external audio tracks come from?

In the couple of decades of using media servers I've never come across this before.

I think many of us are trying to understand the use case for this.

This could be useful when you want to have the original 5.1 7.1 mkv with all the original stuff.
And you want to add more friendly audio streams (2.0_fdk) without touching the original mkv.

I googled the feature just to check if it was a thing, and find this thread.

Edited by dolpsdw
Link to comment
Share on other sites

While it might be a thing, it obviously has never gained any popularity.
It's just to easy to remux the original file to add any additional tracks you might need.  Then it should be 100% compatible with any software you use.

Link to comment
Share on other sites

rbjtech

As a technical exercise - this works just fine as ffmpeg can accept multiple input files - you just need to map them accordingly.

This is working just fine in emby using an EXTERNAL AC3 file .. (see below for a stripped down ffmpeg transcode log with all the important bits highlighted)

But while technically it's easy to do - to accommodate this into Emby as a supported function is a totally different challenge...

Quote

>>>>>>  DIAGNOSTIC OPTIONS ACTIVE !!!
Warning CommandLineOptions.SearchText: Original:  Actual: -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -map 0:0 -map 0:1
Warning CommandLineOptions.ReplaceText: Original:  Actual: -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.AC3" -map 0:v -map 1

!!!WARNING!!!
Applied Diagnostic Command Line Change: '-i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -map 0:0 -map 0:1' >> '-i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.AC3" -map 0:v -map 1'

Original:
-y -print_graphs_file "D:\Emby-Server-Beta\programdata\logs\ffmpeg-transcode-c7de82dd-dab8-4ced-a51d-a95d10f46154_1graph.txt" -copyts -start_at_zero -init_hw_device "qsv=qd0:hw,child_device=0,qsv_use_dx11=1" -f matroska,webm -c:v:0 h264_qsv -hwaccel:v:0 qsv -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -map 0:0 -map 0:1 -sn -c:v:0 h264_qsv -b:v:0 4808001 -g:v:0 72 -maxrate:v:0 4808001 -bufsize:v:0 9616002 -sc_threshold:v:0 0 -level:v:0 40 -keyint_min:v:0 72 -r:v:0 23.976024627685547 -profile:v:0 high -c:a:0 libmp3lame -ab:a:0 192000 -ac:a:0 2 -metadata:s:a:0 language=eng -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "d:\Emby\transcoding-temp\48C21C.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "d:\Emby\transcoding-temp\48C21C_%d.ts"

Modified:
-y -print_graphs_file "D:\Emby-Server-Beta\programdata\logs\ffmpeg-transcode-c7de82dd-dab8-4ced-a51d-a95d10f46154_1graph.txt" -copyts -start_at_zero -init_hw_device "qsv=qd0:hw,child_device=0,qsv_use_dx11=1" -f matroska,webm -c:v:0 h264_qsv -hwaccel:v:0 qsv -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.AC3" -map 0:v -map 1 -sn -c:v:0 h264_qsv -b:v:0 4808001 -g:v:0 72 -maxrate:v:0 4808001 -bufsize:v:0 9616002 -sc_threshold:v:0 0 -level:v:0 40 -keyint_min:v:0 72 -r:v:0 23.976024627685547 -profile:v:0 high -c:a:0 libmp3lame -ab:a:0 192000 -ac:a:0 2 -metadata:s:a:0 language=eng -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "d:\Emby\transcoding-temp\48C21C.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "d:\Emby\transcoding-temp\48C21C_%d.ts"

D:\Emby-Server-Beta\system\ffmpeg.exe -loglevel +timing -y -print_graphs_file "D:\Emby-Server-Beta\programdata\logs\ffmpeg-transcode-c7de82dd-dab8-4ced-a51d-a95d10f46154_1graph.txt" -copyts -start_at_zero -init_hw_device "qsv=qd0:hw,child_device=0,qsv_use_dx11=1" -f matroska,webm -c:v:0 h264_qsv -hwaccel:v:0 qsv -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv" -i "\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.AC3" -map 0:v -map 1 -sn -c:v:0 h264_qsv -b:v:0 4808001 -g:v:0 72 -maxrate:v:0 4808001 -bufsize:v:0 9616002 -sc_threshold:v:0 0 -level:v:0 40 -keyint_min:v:0 72 -r:v:0 23.976024627685547 -profile:v:0 high -c:a:0 libmp3lame -ab:a:0 192000 -ac:a:0 2 -metadata:s:a:0 language=eng -disposition:a:0 default -max_delay 5000000 -avoid_negative_ts disabled -f segment -map_metadata -1 -map_chapters -1 -segment_format mpegts -segment_list "d:\Emby\transcoding-temp\48C21C.m3u8" -segment_list_type m3u8 -segment_time 00:00:03.000 -segment_start_number 0 -individual_header_trailer 0 -write_header_trailer 0 -segment_write_temp 1 "d:\Emby\transcoding-temp\48C21C_%d.ts"


12:22:00.101 Input #0, matroska,webm, from '\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.mkv':
12:22:00.123 Input #1, ac3, from '\\media\Films\Air Force One (1997)\Air Force One (1997) - 1080p x264 AC3.AC3':

12:22:00.123 Stream mapping:
12:22:00.123   Stream #0:0 -> #0:0 (h264 (h264_qsv) -> h264 (h264_qsv))
12:22:00.123   Stream #1:0 -> #0:1 (ac3 (native) -> mp3 (libmp3lame))

12:22:00.409   Stream #0:1(eng): Audio: mp3, 48000 Hz, stereo, fltp, 192 kb/s (default)
12:22:00.409     Metadata:
12:22:00.409       encoder         : Lavc59.12.100 libmp3lame
12:22:00.409 elapsed=00:00:00.28 frame=    1 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A throttle=off speed=   0x    
12:22:00.633 [segment @ 00000283c0300cc0] Opening 'd:\Emby\transcoding-temp\48C21C.m3u8.tmp' for writing
12:22:00.634 SegmentComplete=video:0 Index=0 Start=0.000000 End=3.003000 Duration=3.003000 offset_pts=0 start_pts=0 Frames=72 filename=48C21C_0.ts
12:22:00.634 [segment @ 00000283c0300cc0] Opening 'd:\Emby\transcoding-temp\48C21C_1.ts.tmp' for writing
12:22:00.862 [segment @ 00000283c0300cc0] Opening 'd:\Emby\transcoding-temp\48C21C.m3u8.tmp' for writing

 

  • Like 1
  • Agree 1
Link to comment
Share on other sites

  • 5 months later...
semioniy

For those who don't see the point in this functionality, you may have not consumed a lot of media with fan-dubs 😁
Here's a use-case I have:

  • Movies/series with english audio track embedded in .mkv / .mpg / .mp4 / whatever else
  • Anime with original japanese dub in .mkv / .avi / .mp4 / whatnot

+

  • external audio tracks in a subfolder with naming scheme like "./<language> sound/<particular dub>", e.g. "./Rus sound/[Anilibria]/", mostly in .mka format

Merging these files would certainly be possible, but then I wouldn't be able to seed through torrents (only legal stuff, of course). I'd totally benefit from emby being able to do that, and so would do a bunch more people that watch media not recorded/produced/licensed in their native language.

Link to comment
Share on other sites

The disc format needed for seeding files is quite different from the recommended guide lines used for Emby or other media servers.

Regardless of the source of the media, best practices used for streaming servers will use common formats that work optimally for clients you support.
That could be standardizing on H.264 or H.265 video, making sure a 2 channel AAC or AC3 audio track is present. Removing audio & subtitle tracks that aren't needed or wanted. Adding missing subtitles that are needed for your users. Making sure all codecs and formats used are compatible with client apps your server streams to, etc.

There are many tools built into Emby server to convert/manipulate your media for optimal streaming to many different clients as well as lower resource uses when streaming. These tools can rename files, add files as well as change or replace files. Some people use a pipeline outside of Emby to standardize their media before adding it to Emby.  In either case the resulting file sets can be quite different than what they started as.

Emby should not be bound nor use files as typically found in unpacked seeds as is, since they are often not optimal for streaming.  If this is something you or others want to do, that's your business but you should allocate separate storage for these two drastically different purposes so each can be optimized for it's specific purpose. Trying to use shared storage to accommodate both purposes is a poor design choice that can never be optimal for either purpose and put artificial limitations on what you can and can't do causing you to start making compromises in how you handle things since your first priority is what's on disc instead of how your system streams content.

Some of the formats used for specific genres typically found in seeds do not follow streaming standards, they use codecs that shouldn't be used with the container they are found in often using bitrates that shouldn't be used. These types of files used as is can cause all kinds of grief for streaming servers as they won't be supported by most clients. If lucky the Emby Server may be able to transcode files on the fly to make them compatible with industry standards and the different devices Emby Supports.

These kinds of compromises further box you in, ultimately requiring special handling for processes that otherwise are simple to accomplish.  Adding an additional audio track is a perfect example. The correct way to handle this and have files that meet industry standards and be playable by different clients is to add the track directly to the media where it can by properly synced to the video. Trying to find or create an alternate solution for a self created problem that goes against standard practices and not supported by any media standards is self defeating.

Separate your storage for each purpose, so never the two shall meet and then optimize each for it's intended purpose. That could mean you need to expand your storage or even double  it but comes with the territory. While not a true backup (1 to 1 files) it might help to think about the alternate source of files your version of media backup (that needs reprocessing).

Edited by cayars
  • Thanks 1
Link to comment
Share on other sites

semioniy

Can't say this wasn't a bit passive-aggressive, but definitely insightful, so thank you for the response. 

Link to comment
Share on other sites

Please note that doesn't determine whether we'll support it or not. In fact I think it's a reasonable request .

But when we might actually do it depends on how many people want it compared to other things.

Link to comment
Share on other sites

19 hours ago, semioniy said:

Can't say this wasn't a bit passive-aggressive, but definitely insightful, so thank you for the response. 

I had just got done helping someone who was rather demanding and adamant we change our software so he didn't have to follow our naming guide and could keep his crazy layout /genre/year/director/movie or show.  Besides, there's quite a difference between that and a polite feature request so I'm sorry for tone, but know it wasn't really directed at you.

PS removed the top line so it's a bit less snarky. :)

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...