Jump to content

Video transcoding because ContainerBitrateExceedsLimit


fygonzalo

Recommended Posts

fygonzalo

Hello, new emby user here!

 

I am having problems with emby transcoding a video. I am running the server on a Raspberry Pi 3B so transcoding is not an option.

 

I am testing with a movie (Interstellar) and a tv show (Mr Robot), both Bluray quality 720p, x264. The movie size is bigger, bitrate is almost the same (~7500), but for some reason the tv show tries to transcode while the movie can direct play properly. Obviously I can't even play the episode, the player keeps waiting.

 

According to logs, the transcoding is because: TranscodeReasons=ContainerBitrateExceedsLimit

 

I have checked the file info using mediainfo (because emby doesn't show any media detailed info for the mr robot episodes, don't know why) and both are mkv@x264 level 4.1. The difference is on ReFrames (4 vs 9)

 

I attached both mediainfos (movie and tv show) and the transcoding log. I want to know the problem to avoid those files on the future.

 

 

I haven't changed anything on the quality at plex apps. This also happens on the web player (didn't tried Theater)

Interstellar.mediainfo.txt

MrRobotS01E07.mediainfo.txt

MrRobotS01E07.transcodelog.txt

Link to comment
Share on other sites

This is happening because there's no media info for the item. Try refreshing it from the detail screen. It would appear you haven't setup your ffmpeg build therefore ffprobe was unable to run at the time it was initially imported into the library.

Link to comment
Share on other sites

fygonzalo

This is happening because there's no media info for the item. Try refreshing it from the detail screen. It would appear you haven't setup your ffmpeg build therefore ffprobe was unable to run at the time it was initially imported into the library.

 

Its rare because it works on Interstellar but you are correct, at server log there is a ffprobe exception. I have installed emby server using docker so this rare. I am looking to fix other problems tat I have and then will look more about this. If you have any advice I will be grateful.

Link to comment
Share on other sites

fygonzalo

Can you attach the emby server log? thanks.

 

Oh sorry, I was going to do that but forgot.

 

I have looked at log but can't understand the reason of error. Maybe I messed with permissions, is my first time using docker and I am not that confortable with linux.

 

Today I am going to reinstall everything from scratch (including os) and will make sure I dont break anything.

serverlog.txt

Link to comment
Share on other sites

fygonzalo

Nope, reinstall everything from scratch didn't helped.

 

Should I try this? https://emby.media/community/index.php?/topic/26397-videos-mediainfo-stream-details-missing/ . My biggest problem is I cant run apt-get on the container. The command isn't on the image.

 

I really don't know the problem, both ffmpeg and ffprobe have appropiate permission rights. Both them are in /usr/bin/

 

 

serverlog.txt

Edited by fygonzalo
Link to comment
Share on other sites

fygonzalo

I am doing multiple posts to gain view of developers after updates. Sorry if you don't like it.

 

Ok, as you see I am not a linux expert user, even medium. Obviously apt-get wont work, docker armv7 image is based on opensuse, there exists zypper.

 

I ran this on the embyserver container:

#zypper addrepo http://download.opensuse.org/repositories/multimedia:libs/openSUSE_Tumbleweed/multimedia:libs.repo
#zypper refresh
zypper install ffmpeg

Now I don't have the ffmpeg/ffprobe error. All content has the media info.

 

 

Is there any reason of docker version of armv7 failing? Is there a bug? Its ok what I am doing? Is any difference with the ffmpeg that comes on the image or just outdated?

 

 

Thanks, I hope you can fix the image!

---

No need to add repo and refresh

Edited by fygonzalo
Link to comment
Share on other sites

fygonzalo

Sorry for all those posts. Found a new problem, installing ffmpeg from zypper breaks other thing, now the logs says "Error starting ffmpeg" .

 

The info of all movies is there but ffmpeg doesn't work, so transcode doesn't work. Now I can play the videos on clients which supports those formats but fails when needs transcode audio nor video.

 

Tried a lot of things, nothing works.

 

errorstartingffmpeg.txt

Link to comment
Share on other sites

fygonzalo

@@Luke I want to give an update

 

I have been testing and I think there is a problem with the armhf version of ffmpeg from john's page. First of all, replacing ffmpeg with the armel version on the emby armv7 image solves this problem, but you lose the hard float capability so there is a noticeable lost in performance.
 
So after that, I thought the problem could be because running dpkg --print-architecture on the emby container (based on emby/embyserver:armv7) returns "armel", so I tried to create my own images using debian and ubuntu (resin/rpi-raspbian:stretch & lsiobase/xenial.armhf -- using emby-server from ubuntu 14 repo) and got it working using the ffmpeg from package manager. Using the armhf version from john's page on those builds still gave problems.
 
Then tried again using the emby original armv7 image and install ffmpeg from zypper but still got problems.
 
I would be happy if u can test this on a raspberry pi 3 (armv7). If that matters, I am running HypriotOS (os based on raspbian meant to be used with docker).
 
 
Aside of that, I am curious because running "docker image inspect emby/embyserver:armv7" return this: (Look Architecture param)
$ docker image inspect emby/embyserver:armv7
[
    {
        "Id": "sha256:335c55d53dea549d1a8b19f2b5fd2af5ed2bd7ea032d6f566bbaae7fd0a2dadb",
        "RepoTags": [
            "emby/embyserver:armv7"
        ],
        "RepoDigests": [
            "emby/embyserver@sha256:4a5525e74d48f5617622fc6b740042a6709a219ab10d30ccc1d1756c838b3ab9"
        ],
        "Parent": "",
        "Comment": "",
        "Created": "2017-10-24T06:08:08.071464154Z",
        "Container": "b3855e054e02c96d929a0f284f7f8b52af7c412de4f6ba33731523ef65efa00e",
        "ContainerConfig": {
            "Hostname": "f1e33135b4d3",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "1900/udp": {},
                "7359/udp": {},
                "8096/tcp": {},
                "8920/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LC_ALL=C.utf8",
                "APP_NAME=emby-server",
                "IMG_NAME=embyserver",
                "TAG_NAME=armv7",
                "EDGE=0",
                "UMASK=002"
            ],
            "Cmd": [
                "/bin/sh",
                "-c",
                "#(nop) ",
                "ENTRYPOINT [\"/init\"]"
            ],
            "ArgsEscaped": true,
            "Image": "sha256:47b598520e35586695e195e879c59f3f9754221bd616bb4fdd548ece03577b07",
            "Volumes": {
                "/config": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/init"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "DockerVersion": "17.05.0-ce",
        "Author": "",
        "Config": {
            "Hostname": "f1e33135b4d3",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "1900/udp": {},
                "7359/udp": {},
                "8096/tcp": {},
                "8920/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "LC_ALL=C.utf8",
                "APP_NAME=emby-server",
                "IMG_NAME=embyserver",
                "TAG_NAME=armv7",
                "EDGE=0",
                "UMASK=002"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "sha256:47b598520e35586695e195e879c59f3f9754221bd616bb4fdd548ece03577b07",
            "Volumes": {
                "/config": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/init"
            ],
            "OnBuild": [],
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 331083115,
        "VirtualSize": 331083115,
        "GraphDriver": {
            "Data": {
                "DeviceId": "36",
                "DeviceName": "docker-0:16-1232-b4cc9c21ee82018d466bd9cd19c283b7ad49d3a1b1598c2bfaba034d155753d5",
                "DeviceSize": "10737418240"
            },
            "Name": "devicemapper"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:9526fea0d6820a2219ca83a93fe41e6b8f16f704abac09385e95a2e14479dede",
                "sha256:6c241d95aac19e0e6d2681c0dddac63d29c435ca2784f99f21f262d4475c9a73",
                "sha256:7de13745d1b1bc128c7f05e3c88071ccd91bda67d1994a86286ff1e5e759bdae",
                "sha256:85ff8c1071efd0a1e342e880151593dd2007f71d970b760398b5d78989d3dfb6",
                "sha256:2fae62fd8463b659c26e712d8933f268a8e4820ef50c95a6b6802aad2baceb62"
            ]
        }
    }
]

While running the same command on images that I got working (all from lsioarmhf - linuxserver.io) the architecture says arm.

 

 

Update:

Forgot to add, AFAIK there isn't armv7 version of opensuse tumbleweed, only aarch64. Maybe the problem comes because I am running a armv7 32bits os? Still doesn't makes sense why ffmpeg from jonh's don't work for me.

 

Update 2:

This is the image I am using right now: Gist

Build it executing: docker build -t myname/embyserver .

Run it executing: docker run -d -p 8096:8096 -v /media/mydrive/embycfg:/config -v /media/mydrive/movies:/movies -v /vmedia/mydrive/tvshows:/tvshows -e PUID={USER_ID} -e PGID={GROUP_ID} --name embyserver myname/embyserver

Edited by fygonzalo
Link to comment
Share on other sites

Thanks for the info. We will soon be reworking our arm and docker packages soon for .net core. We will look at these items then. Thanks.

Link to comment
Share on other sites

As far as ffmpeg goes:

to get ffmpeg i use: git clone https://github.com/FFmpeg/FFmpeg.git

 

the config i last used with ffmpeg for the rpi was:   configuration: --arch=armhf --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree --enable-libfdk-aac --enable-libvpx --enable-libopus --enable-librtmp --enable-libmp3lame --enable-gpl --enable-omx --enable-omx-rpi --enable-version3 --enable-decoder=mpeg2_mmal --enable-mmal

 

This enables mpeg2 hardware acceleration ( if you have bought the license from rasberie pi org )

 

the already built ffmpeg are nice but often lack mpeg2 hardware acceleration. Also libfdk-aac  and a few other options are not necessary 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

With those options you're gonna need libraspberrypi0 libraspberrypi-dev installed and you need to add their custom paths --extra-ldflags="-L/opt/vc/lib" --extra-cflags="-I/opt/vc/include/interface/mmal"

 

Problem is, that compiles a dynamic library, and that's a hell to maintain in Docker. I'd rather just copy a static library over and call it a day (the johnvansickle binaries are also static). If we can just have some build instructions up on how to compile ffmpeg statically together with hardware acceleration then we're good to go.

 

However, I'm unable to compile ffmpeg statically.

 

$ ldd ffmpeg | grep -v /lib/arm
        linux-vdso.so.1 (0x7ee75000)
        libmmal_core.so => /opt/vc/lib/libmmal_core.so (0x76a72000)
        libmmal_util.so => /opt/vc/lib/libmmal_util.so (0x76a52000)
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0x76a37000)
        libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x76a10000)
        /lib/ld-linux-armhf.so.3 (0x76f56000)
        libvcos.so => /opt/vc/lib/libvcos.so (0x76662000)
        libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so (0x7664c000)
        libvcsm.so => /opt/vc/lib/libvcsm.so (0x76638000)
$ ldd ffmpeg | wc -l
74
$ file ffmpeg
ffmpeg: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=930085205dda8fe22aab095d31048385d084530c, stripped
 
As per http://www.ffmpeg-archive.org/Build-with-enable-static-td1583036.html I tried to compile the binary static (couldn't find a proper, better guide), adding --extra-libs="-static" --extra-ldflags="-L/opt/vc/lib" --extra-cflags="--static -I/opt/vc/incde/interface/mmal" --enable-static --disable-shared but then it can't find mmal or libx264
 
./configure --arch=armhf --target-os=linux --extra-libs="-static" --extra-ldflags="-L/opt/vc/lib" --extra-cflags="-I/opt/vc/incde/interface/mmal --static" --enable-gpl --enable-version3 --enable-nonfree --enable-omx --enable-omx-rpi --enable-decoder=mpeg2_mmal --enable-mmal --disable-libx264 --disable-ffplay --disable-ffprobe --disable-ffserver --enable-static --disable-shared --enable-pthreads
 
But then it can't find libx264 and mmal...
 

I am also not sure the hardware acceleration is going to work in Docker either.

 

For reference here is Johnvansickle's build:

 

./ffmpeg.orig -buildconf

ffmpeg version 3.3.4-static http://johnvansickle.com/ffmpeg/ Copyright © 2000-2017 the FFmpeg developers

  built with gcc 6.4.0 (Debian 6.4.0-4) 20170820

  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg

Edited by Fnordje
Link to comment
Share on other sites

So apparently it can't be build static with support for OMX/MMAS, and --enable-libx264 has to be stated in different spot in the ./configure options (quite retarded ancient build system). I managed to build a dynamic binary which I put in /usr/local just like you did. It seems to work reasonably well. I been told on #ffmpeg that its unlikely the hardware decoder works from within Docker. That could explain the transcoding issues?

Link to comment
Share on other sites

We're going to be updating our docker in the near future and then you won't have to worry about this anymore.

Link to comment
Share on other sites

It will have support for va api compiled in. We might be able to look into openmax later.

 

Currently when a package supplies it's own ffmpeg, the configuration to customize gets hidden, so in the short term, that ability will be lost. We will look at restoring that though for a upcoming server release. Thanks.

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