Jump to content

ffmpeg not runnable?


Malmgren

Recommended Posts

Malmgren

Hi.

I've got quite many errors like the following in my log:

2019-11-27 14:13:54.821 Info App: ProcessRun 'extract-image' Execute: /opt/emby-server/bin/ffmpeg -ss 15:08:26.480  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/66fdc849-aa59-4b9d-88de-4de3223c5051.jpg"
2019-11-27 14:13:56.331 Error ImageExtraction: ffmpeg image extraction failed for file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" (output file not found)
2019-11-27 14:13:56.332 Error ImageExtraction: Thumbnail-Filter extraction failed, will attempt standard way. Input: file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi"
2019-11-27 14:13:56.333 Info App: ProcessRun 'extract-image' Execute: /opt/emby-server/bin/ffmpeg -ss 15:08:26.480  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2" -f image2 "/var/lib/emby/cache/temp/15eb7a0c-91ab-4486-8f12-3b2b7ab17f54.jpg"
2019-11-27 14:13:57.849 Error ImageExtraction: ffmpeg image extraction failed for file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" (output file not found)
2019-11-27 14:13:57.855 Error App: Error in Screen Grabber
        *** Error Report ***
        Version: 4.3.0.30
        Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_arm64.deb
        Operating system: Unix 4.4.190.1233
        64-Bit OS: True
        64-Bit Process: True
        User Interactive: True
        Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll
        Processor count: 4
        Program data path: /var/lib/emby
        Application directory: /opt/emby-server/system
        System.Exception: System.Exception: ffmpeg image extraction failed for file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" (output file not found)
           at Emby.Server.MediaEncoding.ImageExtraction.ImageExtractionManager.ExtractImageInternal(ReadOnlyMemory`1 inputPath, ReadOnlyMemory`1 container, MediaStream videoStream, Nullable`1 streamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useThumbNailFilter, CancellationToken cancellationToken)
           at Emby.Server.MediaEncoding.ImageExtraction.ImageExtractionManager.ExtractImage(ReadOnlyMemory`1 inputPath, ReadOnlyMemory`1 container, MediaStream videoStream, Nullable`1 streamIndex, MediaProtocol protocol, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, CancellationToken cancellationToken)
           at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken)
           at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)
        Source: Emby.Server.MediaEncoding
        TargetSite: Void MoveNext()

/opt/emby-server/bin/ffmpeg -ss 15:08:26.480  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/66fdc849-aa59-4b9d-88de-4de3223c5051.jpg"

I started digging and it turns out I can't even run ffmpeg manually:

root@rock64:/opt/emby-server# /opt/emby-server/bin/ffprobe
/opt/emby-server/bin/ffprobe: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory

Don't really know how this works, but there is  a libavdevice.so.58:

root@rock64:/opt/emby-server# file /opt/emby-server/lib/libavdevice.so.58
/opt/emby-server/lib/libavdevice.so.58: symbolic link to libavdevice.so.58.9.100
root@rock64:/opt/emby-server# file /opt/emby-server/lib/libavdevice.so.58.9.100
/opt/emby-server/lib/libavdevice.so.58.9.100: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=8f0dd676c354fa7436821e7094698e36f6f32db7, stripped

Don't really know where to continue digging?

 

This is the official 4.3.0.30 package for arm64, running on Debian 10.02.

Link to comment
Share on other sites

Hi there, you can't run our ffmpeg directly without first setting up things such as environment variables. It's something we can try to document when we have a chance.

 

As for your issue, since you're on arm64 I believe it is probably related to this:

https://emby.media/community/index.php?/topic/79567-server-crash-when-i-try-to-play-a-movie/

 

Strangely the problems are not observed on the beta channel even though they currently have identical code, so we're currently trying to chase down what the difference is. Thanks.

Link to comment
Share on other sites

Malmgren

Yep, I kinda suspected it could be related. Thanks for looking into it! Please tell me if there's anything more I can do to help.

 

/Daniel

Link to comment
Share on other sites

alucryd

@@Malmgren Please run these lines first and try again:

APP_DIR=/opt/emby-server

export AMDGPU_IDS=$APP_DIR/share/libdrm/amdgpu.ids
if [ -z $EMBY_DATA ]; then
if [ -d /var/lib/emby-server ]; then
export EMBY_DATA=/var/lib/emby-server
else
export EMBY_DATA=/var/lib/emby
fi
fi
export FONTCONFIG_PATH=$APP_DIR/etc/fonts
export LD_LIBRARY_PATH=$APP_DIR/lib:$APP_DIR/lib/samba
export LIBVA_DRIVERS_PATH=$APP_DIR/lib/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib64/dri:/usr/lib/dri
if [ -n $LIBVA_DRIVERS_DIR ]; then
export LIBVA_DRIVERS_PATH=$LIBVA_DRIVERS_PATH:$LIBVA_DRIVERS_DIR
fi
export SSL_CERT_FILE=$APP_DIR/etc/ssl/certs/ca-certificates.crt

Then make sure to be in the /opt/emby-server directory before running the ffmpeg binary, as the loader path is relative to make the whole installation more portable.

Link to comment
Share on other sites

Malmgren

Yep, after doing those exports the command runs. I ran the command with the exact same parameters that Emby is doing and got the same result (no output file was created). Not really clear on why though. Here is the output:

root@rock64:/opt/emby-server# /opt/emby-server/bin/ffmpeg -ss 15:08:26.480  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/66fdc849-aa59-4b9d-88de-4de3223c5051.jpg"
ffmpeg version 4.3.0-emby_2019_11_09 Copyright (c) 2000-2019 the FFmpeg developers and softworkz for Emby LLC
  built with gcc 7.4.1 (Linaro GCC 7.4-2019.02) 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4]
Execution Date: 2019-12-01 15:58:21
Input #0, avi, from 'file:/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi':
  Duration: 01:21:15.20, start: 0.000000, bitrate: 1141 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 512x384 [SAR 1:1 DAR 4:3], 999 kb/s, Level 5, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[mpeg4 @ 0x3188a180] Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using the mpeg4_unpack_bframes bitstream filter without encoding but stream copy to fix it.
[swscaler @ 0x319662e0] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/var/lib/emby/cache/temp/66fdc849-aa59-4b9d-88de-4de3223c5051.jpg':
  Metadata:
    encoder         : Lavf58.31.104
    Stream #0:0: Video: mjpeg, yuvj444p(pc), 600x450 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.56.101 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A throttle=off speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

EXIT

Link to comment
Share on other sites

alucryd

Thanks for the feedback. I'm told emby 4.3.0.24 is working fine, could you please check that version? If possible I'd like you to extract the command that is ran from that particular version so that I can compare it to the one in 4.3.0.30. Both ship with the exact same ffmpeg binary, so if anything isn't working it's probably down to the command.

Link to comment
Share on other sites

Malmgren

Yep. I think I've found the culprit, it was there right in our faces all the time.

 

In .24 the command used for this exact episode is

/opt/emby-server/bin/ffmpeg -ss 00:08:07.520  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/96cb9986-a395-400b-a441-e90d4f4950f7.jpg"

...while for .30 it is

/opt/emby-server/bin/ffmpeg -ss 15:08:26.480  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/66fdc849-aa59-4b9d-88de-4de3223c5051.jpg"

The only different seems to be the ss option. So if I understand correctly, in version .24 it seeks eight minutes into the video, while in .30 it seeks over 15 hours. Which is far more than the total length of the video. So it seems someone simply broke how the seek time is calculated between .24 and .30.

Link to comment
Share on other sites

Can you attach the emby server log from that, and the image extraction log, so that we can see context? Thanks.

Link to comment
Share on other sites

Malmgren

Nope, no luck. It still tries to extract the thumbnail from a point in time way after the movie ended:

2019-12-07 09:03:42.559 Info App: ProcessRun 'extract-image' Execute: /opt/emby-server/bin/ffmpeg -ss 15:10:13.902  -f avi -threads 1 -i file:"/mnt/nas/public/Serier/Trigger Happy TV/3x01 - Angry Cyclist.avi" -an -sn -threads 0 -vframes 1 -vf "scale=600:trunc(ow/a/2)*2,thumbnail=24" -f image2 "/var/lib/emby/cache/temp/1645a662-6d32-473f-8f9c-5a7699e6c164.jpg"

 

Link to comment
Share on other sites

  • 2 weeks later...
Malmgren

@@Malmgren - Does it work with the latest beta?

I went for the latest stable (4.3.1.0) instead and it seems to work now. I guess it's the same fix there as in the betas?

 

/Daniel

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