Jump to content

Question about H264 vs libx264


Recommended Posts

PenkethBoy
Posted

I have some videos which are encoded as H264

 

When played on my Phone (via Wifi) they get transcoded

  Duration: 00:29:47.65, start: 0.000000, bitrate: 8386 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 8062 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)

to libx264.

 

Bit rate is not that high - so wondering why they would be transcoded?

 

Phone is a Sony Xperia X on android 7

 

Is H264 different from libx264??

 

Looking for ideas why and if i can change things to stop the transcoding if possible

PenkethBoy
Posted (edited)
First, compare the media format of your file to the format supported by the Emby app. You can find the media info in the Emby Web Client, at the bottom of the detail page:

Where is the list of supported format by Emby APP?? - Found it

 

No subtitles - video quality is on Auto in App and on the server

 

59d3fd266333b_Capture.jpg

 

noticed the bit rate is different in the details page and what ffmpeg is returning - not sure if thats significant?

Edited by PenkethBoy
Happy2Play
Posted

You would have to post the full logs, server and transcode.

PenkethBoy
Posted

Ok it matches supported formats

 

i.e. - MP4, AAC

PenkethBoy
Posted

Ah ok found this in the log

 

&TranscodeReasons=ContainerBitrateExceedsLimit&

 

as its on Auto is it better to set a limit if the server is making the wrong guess on whats supported by bitrate 

PenkethBoy
Posted

Ok put max - bit rate to 1080p - 60MPs

 

Played file and it says in Dashboard its direct playing

 

but its actually transcoding - can see ffmpeg process and transcode log created

 

tried a couple of other files and they do the same

 

I thought it was an easy answer :) - will raise a separate thread in android mobile sub forum

Guest asrequested
Posted (edited)

Post the transcode logs. I'd like to poke around, when I get home. And what is your phones Wi-Fi bandwidth?

Edited by Doofus
Posted

The browser video player may have reported an error and therefore the web app automatically switched to a full transcode. when this happens i haven't yet tested the effect on the various reporting mechanisms, e.g. server dashboard, stats for nerds, etc.

PenkethBoy
Posted (edited)

only error i see is after the video has been stopped

2017-10-03 22:48:35.408 Error HttpServer: Error in HttpListenerResponseWrapper: An established connection was aborted by the software in your host machine
	*** Error Report ***
	Version: 3.2.33.1
	Command line: C:\Users\TimPercy\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe C:\Users\TimPercy\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe C:\Users\TimPercy\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe
	Operating system: Microsoft Windows NT 6.2.9200.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 8
	Program data path: C:\Users\TimPercy\AppData\Roaming\Emby-Server
	Application directory: C:\Users\TimPercy\AppData\Roaming\Emby-Server\System
	System.Net.Sockets.SocketException (0x80004005): An established connection was aborted by the software in your host machine
	   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
	   at SocketHttpListener.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count)
	   at SocketHttpListener.Net.HttpResponseStream.InternalWrite(Byte[] buffer, Int32 offset, Int32 count)
	   at SocketHttpListener.Net.HttpResponseStream.DisposeCore()
	   at SocketHttpListener.Net.HttpResponseStream.Dispose(Boolean disposing)
	   at System.IO.Stream.Close()
	   at Emby.Server.Implementations.HttpServer.SocketSharp.WebSocketSharpResponse.CloseOutputStream(HttpListenerResponse response)
	System.Net.Sockets.SocketException
	   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
	   at SocketHttpListener.SocketStream.Write(Byte[] buffer, Int32 offset, Int32 count)
	   at SocketHttpListener.Net.HttpResponseStream.InternalWrite(Byte[] buffer, Int32 offset, Int32 count)
	   at SocketHttpListener.Net.HttpResponseStream.DisposeCore()
	   at SocketHttpListener.Net.HttpResponseStream.Dispose(Boolean disposing)
	   at System.IO.Stream.Close()
	   at Emby.Server.Implementations.HttpServer.SocketSharp.WebSocketSharpResponse.CloseOutputStream(HttpListenerResponse response)

I will post logs in a few just trying out a couple of things on a different machine to see if any difference

Edited by PenkethBoy
Posted

That looks like the html video player disconnecting after encountering an error, so then the app switched over to transcoding.

PenkethBoy
Posted (edited)

Tested on two different Beta Servers (not netcore) 3.2.33.1

 

Mobile App on phone is 2.9.61

 

Bit rate on App set to 4k-120MPs - ie max

 

But transcodes when on Auto as well or any setting it appears

 

Phone is on WIFI - just tested at 24MBps

 

what ever i set the in App bandwidth to it transcodes - even though the dashboard shows as Direct playing?

 

59d40b6958d75_Capture2.jpg

 

Have tried a low bit rate file

 

59d40bd5a9833_Capture3.jpg

 

and a higher bitrate file 

 

59d40bedbda97_Capture.jpg

 

Logs [removed] for testing both of above files with trans log files

 

Over to the experts :)

Edited by PenkethBoy
PenkethBoy
Posted

ok so is it an error with the phone App or the phone?

Guest asrequested
Posted

You have the same router that I was using. I found that my Wi-Fi connectivity was not very good. There isn't anything wrong with it, it's how its designed. After changing to the unifi AP, the difference is amazing. You may be experiencing something like I was.

Happy2Play
Posted

Do you see the same issues while not on wifi?

PenkethBoy
Posted

dont have external access setup to use 4g on the phone.

Guest asrequested
Posted

You have to forward your port in your router :D

PenkethBoy
Posted

You have the same router that I was using. I found that my Wi-Fi connectivity was not very good. There isn't anything wrong with it, it's how its designed. After changing to the unifi AP, the difference is amazing. You may be experiencing something like I was.

Dont see any wifi connectivity issues - always works and the AP is in the next room with Max bars in android so dont think it's that

PenkethBoy
Posted

You have to forward your port in your router :D

Yeah no Sh*t - no not doing that  :D

Posted

Ok so this is the android app. it appears that the video player in the app had a problem direct playing the file, so we automatically switched to transcoding.

 

as for possible reasons why, if you encoded these files using handbrake's web optimized mp4 feature, libvlc fails to play those for whatever reason.

 

does this answer your question?

PenkethBoy
Posted

Those files were downloaded from the web - i have not re encoded them with handbrake

 

i will test further to see if a Handbrake encoded file (dont use the web optimised option) does or does not transcode

 

Is there any way to tell a file has been "web optimised" ???

Posted

Would maybe remuxing the mp4 to an mkv using MKVToolNix be a good idea to get rid of the web optimized flag? I know the MKV container does not support it.

PenkethBoy
Posted

Thanks but for thousands of mp4 that may or may not be web optimised that would be a huge task to undertake - which i would like to avoid

PenkethBoy
Posted

@@Luke

 

I tested a file encoded by Handbrake with "web optimised" tag selected and yes the Android app fails to play the file at all - does not fall back to transcoding either - but thats a separate issue.

 

So i am sure that the issue i have is not related to the web optimised flag being set - as all the files i have tested are playing ok but transcoding.

 

I have tried several files of various types - and all fail to direct play but transcode and play fine.

 

Is there a way to obtain some more info from the Android App as to what it does not like about these files so i can figure out what needs changing etc?

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