Page 1 of 1

AMC: External AC3 and DTS files

Posted: 20 Nov 2017, 11:12
by thielj
FileBot is treating external audio (.dts .ac3) as movie files. For example, I have:

Code: Select all

Redacted (1996).eng.dts
Redacted (1996).mkv
Observations:
  • FileBot tries to get subtitles for both (with a subtitles=xx parameter)
  • When it comes to the renaming phase, each of them is processed individually as if both were the inferred movie. Of course, this fails horrible as the DTS track doesn't have video information etc.
Suggested solution: Don't treat accompanying files containing only audio as movies.

May be related to: source/net/filebot/MediaTypes.properties seeting a mime type of 'video/audio-stream' for .ac3 and .dts files.

Re: AMC: External AC3 and DTS files

Posted: 20 Nov 2017, 12:04
by rednoah
Makes sense. I'll remove ac3/dts from the list of video extensions.

Re: AMC: External AC3 and DTS files

Posted: 20 Nov 2017, 15:00
by thielj
There should be an additional sanity check that a 'video file' contains at the minimum one video stream

Re: AMC: External AC3 and DTS files

Posted: 20 Nov 2017, 17:13
by rednoah
That might not be such a good idea. The file extension usually does a good job at identifying video files, and can be understood by users. Inspecting files is slower by a few magnitudes and slower by a few more magnitudes if the files happen to be on a network share.

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 03:57
by thielj
I've tried this with the latest jar, but judging from the file date (Nov 15), it's not updated yet and AC3 or DTS files are still processed as movies.

Strangely enough, mp3 or m4a files are not grouped or processed as companion files at all, even if the source files have the perfect naming. Do I miss a switch/option for that?

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 12:51
by rednoah
What are the filenames? A companion file must begin with the video file name. The extension is irrelevant in this case and could be anything (xml, txt, dat, etc).

e.g.

Code: Select all

$ filebot -rename *.mp4 *.mp3 -non-strict --db TheMovieDB --log INFO --action TEST
[TEST] from [Avatar.2009.mp4] to [Avatar (2009).mp4]
[TEST] from [Avatar.2009.eng.mp3] to [Avatar (2009).mp3]

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 14:24
by thielj
It's not -rename, but -script fn:amc inside your filebot-watcher container.

Files have the proper naming.

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 15:05
by rednoah
I see. Looks like the amc script doesn't support companion files at all.

Normal audio files would be especially problematic, because --def music=y would simply funnel all audio files into music mode, which is not what you want for external audio streams for your movies.

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 15:25
by thielj
Yeah, maybe I need to consider rolling my own amc.groovy, moving the if (music && forceAudio(f)) check to the button, and creating Movies/TV Shows/Music top level input folders.

ut_label=movie might work on a movies-only input folder.

and I will need to do some experiments with -rename as well...

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 15:54
by rednoah
You probably do have enough special use cases to warrant your own fork. The amc script is kept simple, so it shouldn't be too hard. :D

-rename / rename(...) is used internally by the amc script in various ways after grouping files that might / should belong together. If you know that you will only process movies, and if you know that your movies are all in movie folders and that all files in the same folder belong together, then things can be simplified quite a bit, to the point where you might not even want or need the amc script.

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 17:56
by thielj
I just have a wide selection of samples and know how to pick my test cases ;)

The idea of using FileBot as a library that can help with the discovery, processing and enrichment of media files isn't that unattractive. I wonder how far this would be supported, in terms of API stability etc?

Re: AMC: External AC3 and DTS files

Posted: 22 Nov 2017, 18:26
by rednoah
The filebot command-line tools are very stable, as are the scripting interfaces. I wouldn't expect any breaking changes here.