Jump to content

ffmpeg-subtitle_convert error: Invalid loglevel "timing"


Go to solution Solved by yanofsky,

Recommended Posts

Posted

Hi, I am seeing subtitles not show up with Emby 4.8.0.37 and the following error in logs. Emby seems to be calling ffmpeg with an invalid command line:

2023-06-10 17:05:07.494 Info SubtitleEncoder: ProcessRun 'ffmpeg-subtitle_convert' Execute: /nix/store/jg6267ihx1hww4mqiambbnirymrfd37b-ffmpeg-4.4.2-bin/bin/ffmpeg -loglevel +timing -y -sub_charenc:s:0 windows-1252 -i "/var/lib/emby/metadata/library/XX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/X.en.srt" -map 0:0 -vn -an -c:s:0 subrip "/var/lib/emby/cache/temp/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX.srt"
2023-06-10 17:05:07.802 Info SubtitleEncoder: ProcessRun 'ffmpeg-subtitle_convert' Process exited with code 1 - Failed
2023-06-10 17:05:07.802 Error SubtitleEncoder: ffmpeg subtitle conversion failed for /var/lib/emby/metadata/library/XX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/X.en.srt
2023-06-10 17:05:07.816 Error SubtitleEncoder: ProcessRun 'ffmpeg-subtitle_convert' Output:

2023-06-10 17:05:07.816 Error SubtitleEncoder: ProcessRun 'ffmpeg-subtitle_convert' Error Output:
        Invalid loglevel "timing". Possible levels are numbers or:
        "quiet"
        "panic"
        "fatal"
        "error"
        "warning"
        "info"
        "verbose"
        "debug"
        "trace"

2023-06-10 17:05:07.818 Error App: Error getting subtitles
        *** Error Report ***
        Version: 4.8.0.37
        Command line: /nix/store/k0r7zr4qfm1jivhqd1kgwkgpj8xv954f-emby-4.8.0.37/opt/emby-server/EmbyServer.dll -ffmpeg /nix/store/jg6267ihx1hww4mqiambbnirymrfd37b-ffmpeg-4.4.2-bin/bin/ffmpeg -ffprobe /nix/store/jg6267ihx1hww4mqiambbnirymrfd37b-ffmpeg-4.4.2-bin/bin/ffprobe -programdata /var/lib/emby
        Operating system: Linux version 5.15.74 (nixbld@localhost) (gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.39) #1-NixOS SMP Sat Oct 15 05:59:05 UTC 2022
        Framework: .NET 6.0.10
        OS/Process: x64/x64
        Runtime: nix/store/xzcrqns22fn9sb92dmnqyl1rjg5qgf9d-dotnet-sdk-6.0.402/shared/Microsoft.NETCore.App/6.0.10/System.Private.CoreLib.dll
        Processor count: 1
        Data path: /var/lib/emby
        Application path: /nix/store/k0r7zr4qfm1jivhqd1kgwkgpj8xv954f-emby-4.8.0.37/opt/emby-server
        System.Exception: System.Exception: ffmpeg subtitle conversion failed for /var/lib/emby/metadata/library/37/379478cc9cc709232b47da21eaef4f67/Man on Fire (2004).en.srt
           at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ConvertExternalSubtitleInternal(MediaStream subtitleStream, IDictionary`2 requestHeaders, String outputPath, SubtitleMediaTypes outputCodec, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
           at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ConvertExternalSubtitle(MediaStream subtitleStream, IDictionary`2 requestHeaders, String outputPath, SubtitleMediaTypes outputCodec, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
           at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetReadableFile(String mediaPath, MediaProtocol mediaSourceProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)
           at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetSubtitles(String inputPath, MediaProtocol inputProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)
           at Emby.Api.Subtitles.SubtitleService.GetSubtitles(GetSubtitle request, CancellationToken cancellationToken)
           at Emby.Api.Subtitles.SubtitleService.Get(GetSubtitle request)
        Source: Emby.Server.MediaEncoding
        TargetSite: Void MoveNext()

 

Posted

Hi there, how did you install Emby server?

Posted

I'm using a nixos package based on:

https://github.com/NixOS/nixpkgs/blob/ebbeae56bdce0226ca66414160345ccdf457284b/pkgs/servers/emby/default.nix

https://github.com/NixOS/nixpkgs/blob/ebbeae56bdce0226ca66414160345ccdf457284b/nixos/modules/services/misc/emby.nix

I think my problem is probably not specific to NixOS, though. I am guessing it might be a just be an incompatibility between emby-4.8.0.3 and ffmpeg-4.4.2. You can see from the log the emby is invoking ffmpeg with

ffmpeg -loglevel +timing -y -sub_charenc:s:0 windows-1252 -i [...]

And ffmpeg is failing with:

Invalid loglevel "timing". Possible levels are numbers or [...]

So ffmpeg is interpreting the +timing argument as a loglevel value instead of as a separate option. I'm guessing there is a missing log level value between the "-loglevel" and "+timing" arguments?

This problem started happening after I updated packages on my system, so maybe something changed in newer versions of emby that caused it to no longer pass a log level value. Or maybe something changed in newer versions of ffmpeg that caused it to parse the command line differently. I can try to dig in more and mix and match different versions, but I thought I'd report the issue here first in case someone might have more insight into the problem.

Posted

OK, is it not possible to use one of our official packages instead of this one? 

Like for example could you just use our debian package, or Docker container?

Posted

Hmm, I looked into this more and it seems emby relies on a custom version of ffmpeg that does not have source code posted currently (current links lead to 404s if I am understanding this thread correctly):

I should be able to easily fix my installation whenever the ffmpeg source code which emby relies on becomes available again.

I hope that the forked source code will be posted soon. I also think it would be helpful in the future if the forked version of ffmpeg were posted at a stable or predictable URL, or if it were pushed to a public git repository.

I could switch to another package or container system to use emby, but I like the flexibility of nixos packaging and build systems and would prefer to keep using them.

Thanks for your help, and I hope ffmpeg source code will be available soon.

 

 

Posted
22 minutes ago, yanofsky said:

Hmm, I looked into this more and it seems emby relies on a custom version of ffmpeg that does not have source code posted currently (current links lead to 404s if I am understanding this thread correctly):

I should be able to easily fix my installation whenever the ffmpeg source code which emby relies on becomes available again.

I hope that the forked source code will be posted soon. I also think it would be helpful in the future if the forked version of ffmpeg were posted at a stable or predictable URL, or if it were pushed to a public git repository.

I could switch to another package or container system to use emby, but I like the flexibility of nixos packaging and build systems and would prefer to keep using them.

Thanks for your help, and I hope ffmpeg source code will be available soon.

 

 

Hi, what links are 404's?

Posted

From the thread, https://mediabrowser.github.io/embytools/ffmpeg-2022_11_29.tar.gz appears to be a 404

Although I just tried https://mediabrowser.github.io/embytools/ffmpeg-2022_05_27-u1.tar.gz and it seems to work, so I can check and see if I'm able to build that and report back.

Would appreciate if you can recommend a way to find latest url, too since the thread is a little obscure, and possibly out of date. Thanks.

 

Posted

Where did you get the link from? The best place would be the license file of one of our packages.

Posted

Thanks, but I'm just using the links mentioned in that forum thread, and I'm not sure where to find the license file. If I look in the embyserver-netcore_4.8.0.39.zip file from https://github.com/MediaBrowser/Emby.Releases/releases/ which I am downloading to install emby, it does not appear to contain a license file.

Is there is a different package I can download which includes a license file? Or a different place to find a license file?

 

 

  • Solution
Posted

Update: I was able to successfully build ffmpeg-2022_05_27-u1.tar.gz, and now subtitles are working perfectly with emby-4.8.0.37. The "ffmpeg -loglevel +timing -y ..." command lines I see in the log file show ffmpeg running successfully and no longer failing.

I was also able to find a link to the forked ffmpeg sources by downloading a debian package (emby-server-deb_4.7.13.0_amd64.deb) and manually extracting it. The source URL was on the last line of the "opt/emby-server/licenses/licenses" file inside the debian package:

Source code for the included ffmpeg and ffprobe binaries can be downloaded at https://mediabrowser.github.io/embytools/ffmpeg-2022_05_27-u1.tar.gz.

The license file also included a link to a "git@github.com:MediaBrowser/ffmpeg.git" repository, but unfortunately I could not clone that repository. When I tried to clone it, output was "ERROR: Repository not found." so perhaps the repository no longer exists, or is a private rather than a public repository.

It would definitely be more convenient for me if the link to forked ffmpeg source code were posted in a more accessible place. Or if forked ffmpeg source code were available in a public git repository.

But I appreciate your help on this issue and your work developing emby, and everything is working well for me now!

  • Thanks 1

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...