Mi Box S (Android 9) Stremio Stutter Problem

by pesimistanblue
Kitten-Mittons

it's a codec issue I believe. I'm having the same issue with Live TV, whether I try to watch it through the Live Channels app, Plex, HDHomeRun app, etc. I can only seem to find things about this Android 9 update that made the Mi Box worse, I'm not really sure what the point of it was

bshensky

There is absolutely a bug/issue with the MPEG2 codec on Android Pie 9 on the MiBox S. I have the same problem here with 2 of the 35 broadcast stations that I received thru my HDHomeRun OTA received. It happens regardless of the app used to stream those 2 channels. The 2 channels are broadcast from the same tower and transmitter. Signal strength is 100%. IT happens regardless of what monitor the MiBox S is connected to. It does not happen with any other of the same apps on other Android-based non-MiBox devices.

I finally found a way around the problem. I created a transcoder process using ffmpeg on a house server that doesn't just remux the stream, it decodes and re-encodes the stream with the same MPEG2 codec. Audio remains untouched. This has been the only way I can watch those 2 channels on the MiBox S.

I'm using nginx with lua extensions, plus an obscure ffmpeg feature that will serve up output via http. Add this to your nginx default.conf file and salt to taste...

location ~ /transcode {
content_by_lua_block {
local source_url = " http://[HDHOMERUN-IP]:5004/auto/ " .. ngx.var.arg_channel
local port = tostring((ngx.crc32_short(ngx.var.arg_channel) % 1024) + 8192)
local cmd = "/usr/bin/nohup /usr/bin/ffmpeg -loglevel fatal -analyzeduration 3000000 -fflags +igndts -ignore_unknown -strict experimental -threads 0 -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i " .. source_url .. " -f mpegts -c:v:0 mpeg2_vaapi -c:a:0 copy -y -listen 1 http://" .. ngx.var.server_addr .. ":" .. port .. " < /dev/null &"
os.execute(cmd)
ngx.sleep(5)
ngx.header["X-cmd"] = cmd
ngx.redirect("http://" .. ngx.var.server_addr .. ":" .. port)
}
}

location ~ /auto {
rewrite ^/auto/(.*)$ /transcode?channel=$1 last;
}

Then hit up http://[NGINX-SERVER-IP]:[PORT]/auto/v7.1 . The server will redirect the browser to the ffmpeg output http URL and server the transcoded stream, removing the artifacting.

Good luck!

pesimistanblue

It stutters no matter what i do. You can see at the end of the video while camera zooming out.

rohit1347

Hulu faces the same issue. The workaround is to cast the video from the phone app.

O_Neders

I have issues on Android 9 with Hulu and Facebook Watch.

I have been flooding Xiaomi with emails to customer service. I would STRONGLY suggest that everybody from this sub to email Xiaomi. The more people complain, the faster they may issue a fix.

https://www.mi.com/us/support

rorymeister

I had these issues. The only solution I found was to put it in the cupboard and get an NVIDIA Shield.

blu3sh4rk

Give it more cache space

pesimistanblue

I dont know maybe it is related to this, because i started to use mi box with Android 9.

4ndril

my original versions stop playing local video files randomly - what gives?

akisnet

Stremio is a sideloaded and pirated app? What Mi Box has to do with that?