Jump to content


Photo
Completed

Force transcode Xvid (and Divx) with good reason



Best Answer fr0z3n , 17 July 2019 - 06:07 PM

Hardware decoding active
Decoder amc-mpeg2(S), Surface
Deinterlace method hardware Go to the full post


  • Please log in to reply
17 replies to this topic

#1 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 16 July 2019 - 07:00 AM

Hi

Im using a low powered android ARM device with Kodi Leia and Emby for Kodi addon.

The device (like most low powered android devices) has a decent x264 decoder and can natively play up to 4K x264 content with the in built hardware decoding.

But sadly when you try and play even SD XVID files, the video jitters/stutters.

This is because very few vendors have proper hardware acceleration of xvid on low powered android devices, and even if the device falls back to ffmpeg software decoding, the video still stutters. Low powered arm devices just struggle with xvid content, even with if it's SD.

But if you convert that same SD content to x264, then the video plays back fine!

Is there anyway to tell emby server to force transcode xvid (or divx) to x264 when playing xvid/divx content through kodi for Emby?

I can see lots of options to force transcode 10bit content to x264, can the same please be added for xvid and divx content? Or can someone please explain another way i can force transcode xvid/divx videos on the fly to x264?

I also don't want to lower the quality scale to some poor lower than sd quality just to trick the server to transcode. Really Need a dedicated setting to always force transcode xvid content.

For the reasons explained above.

Cheers

Edited by fr0z3n, 16 July 2019 - 07:38 AM.


#2 Angelblue05 OFFLINE  

Angelblue05

    Advanced Member

  • Developers
  • 13654 posts
  • Local time: 09:28 AM

Posted 16 July 2019 - 02:48 PM

Can you play the content and provide that Kodi log? I’ll add an option for it around the media info that will show in the log, Thank you

#3 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 16 July 2019 - 06:05 PM

Hi

Pm'd with full log attached

I think the key identifier similar across all the affected videos have this codec :

u'Codec': u'mpeg4'
u'CodecTag': u'XVID'

Cheers
  • Angelblue05 likes this

#4 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 17 July 2019 - 04:27 AM

Hi Angel

Can you also include a dedicated toggle to force transcode mpeg2 (DVD codec) as well?

I don't know what it is about these android boxes but they are just incapable of smoothly playing back old school codecs even in SD. Vendors obviously don't bother with full implementations of old codecs.

u'Codec': u'mpeg2video'

I'll PM you a log file of a DVD playing back

Cheers

#5 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 17 July 2019 - 04:46 AM

None inclusion of mpeg2video decoding is a licensing issue, Raspberry Pi offers a purchasable coded unlock key that allows the Pi to decode Mpeg2 in hardware.



#6 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 17 July 2019 - 07:49 AM

Hi

 

My android box can actually hardware decode MPEG2, that is not really the issue (just like it can hardware decode XVID).

 

The problem is, its hardware decoding capabilities are not properly optimized for MPEG2 or MPEG4 XvID - and playback is a jerky/stuttery (not due to CPU being maxed, but due to poorly optimized hardware decoding capabilities)

 

Throw the same MPEG2 or MPEG4 xvid file at the device, just re-encoded as x264, and it plays flawlessly. Hence the request to allow user to force on the fly re-encoding of these 2 formats by the server

 

Cheers


Edited by fr0z3n, 17 July 2019 - 07:50 AM.


#7 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 17 July 2019 - 08:35 AM

it would be interesting to see what your Kodi Leia shows in the playback details screen, press "o" when playing back a video just to confirm what driver it is using.



#8 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 17 July 2019 - 06:07 PM   Best Answer

Hardware decoding active
Decoder amc-mpeg2(S), Surface
Deinterlace method hardware

Edited by fr0z3n, 17 July 2019 - 06:09 PM.


#9 Angelblue05 OFFLINE  

Angelblue05

    Advanced Member

  • Developers
  • 13654 posts
  • Local time: 09:28 AM

Posted 17 July 2019 - 06:46 PM

So this is not needed after all?



#10 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 17 July 2019 - 07:07 PM

Yep i think it is absolutely still needed, sorry for the confusion.

 

As mentioned in my first post, my box can hardware decode mpeg2 dvd and mpeg4 xvid - but it still stutters and skips frames (even when it is hardware decoding).

 

So the box is capable of hardware decoding, BUT, it is not optimized in anyway and still a horrible playback experience.

 

If i turn off hardware decoding and put on software decoding, then the playback stutters because it is reaching CPU limits.

 

So both hardware and software decoding of mpeg2/mpeg4 are not ideal for low powered amlogic boxes.

 

But if i throw the same file at it just re-encoded as x264, it plays fine - because its hardware decoding abilities on x264 are much better and properly optimized (probably because these boxes are netflix and youtube approved, and the vendors would have spent all their effort ensuring the x264 hardware decoding is up to scratch, not really caring about xvid or mpeg2)

 

This would be the same for many other amlogic type boxes, and there are many threads about this on Kodi and other forums.

 

Hence the request for a dedicated switch in Emby settings to force transcode mpeg2 and mpeg4 xvid to x264 all the time!

 

Hope that made sense.

 

Cheers


Edited by fr0z3n, 17 July 2019 - 07:09 PM.


#11 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 17 July 2019 - 07:16 PM

I think he still wants it.

From my understanding some of the low powered ARM boards like the Raspberry Pi can not do hardware XVID decoding and some other codecs depending on chip-sets and drivers.
The idea is to let the Emby Server do the transcode for the device to h264 and most of these devices do have h264 hardware decoding or at least handle it better.

@fr0z3n do you have a screen shot of the playback info for an XVID or MSMPEG4V3 video? I think I have a few I can test with.

#12 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 17 July 2019 - 07:19 PM

@Angelblue05 I think you have a Force Trans-code context menu item now correct? That should allow him to preempt a trans-code. I know I added a Forece Trancode context menu item to EmbyCon for exactly this reason.

#13 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 17 July 2019 - 08:12 PM

Sure, can provide a screenshot later today.

 

I have found there is a force transcode in the context menu within kodi, but:

 

1. Bit hard to tell non-tech users to use this when playing certain content (and also not practical to do this day to day with apps like Yatse or voice control like google home)

 

2. More importantly, i have found that the "Force Transcode" action on my Android box does not work properly.

Whenever i "Force Transcode" on any type of video, it will pause for about 5-10 secs, then the audio player media player pops up and it starts playing the audio of the video, without any picture, as if it was an audio file.

 

The Force transcode has never worked for me. But curiously, if i lower my quality settings to some low value in emby settings and play any content, it will play properly and transcode on the fly to some low bitrate x264 stream.

 

But if i ever use the "Force Transcode" feature in the context menu it will only ever play the audio of the file as if it was an audio file (so i just assumed the force transcode feature was just broken)

 

The issue i described with "Force transcode" is not really relevant for the feature request i made, so i didn't want to muddy the waters and talk too much about it on this post - as i was really after a dedicated switch to transcode xvid & mpeg2 in the settings, exactly like the toggle settings to always transcode the various flavors of 10bit video.

 

But if you are curious why force transcode doesn't work on my machine at all i can provide the logs and start another post or something like that.

 

Thank you again for hearing me out.

 

Cheers


Edited by fr0z3n, 17 July 2019 - 08:20 PM.


#14 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 17 July 2019 - 08:18 PM

I agree that a dedicated override and logic to force trans-coding in some situations is a good idea.

Perhaps you could force a client capabilities to be narrower or even let a user specify the clients capabilities. That might be best.

Interesting project for the weekend :-)

#15 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 19 July 2019 - 04:02 AM

Great, thanks for understanding.

I hope it's not too difficult to do, as there is already a switch to force transcode x265, I imagined this feature could just be extended to other codecs like xvid and mpeg2

Please let me know if you need anything further info from me

Cheers

Edited by fr0z3n, 19 July 2019 - 04:03 AM.


#16 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 19 July 2019 - 08:05 PM

It has been many years since I have had to play with DivX and Xvid but looking at some examples in my old archived collection Divx and Xvid are different:

Divx = MSMPEG4V3
Xvid = MPEG4

My Raspberry Pi 3 has hardware decoding for MPEG4 but not for MSMPEG4V3

Edited by TeamB, 19 July 2019 - 08:06 PM.

  • Angelblue05 likes this

#17 fr0z3n OFFLINE  

fr0z3n

    Member

  • Members
  • 19 posts
  • Local time: 01:28 AM

Posted 19 July 2019 - 09:55 PM

Yeah you are right.

Divx wasn't terribly popular so it's not a priority, but xvid and mpeg2 was certainly mainstream for many years and this would be great if they had dedicated switches

#18 TeamB OFFLINE  

TeamB

    Advanced Member

  • Developers
  • 5734 posts
  • Local time: 12:28 AM

Posted 19 July 2019 - 10:23 PM

I have added force transcode options for h265, Mpeg2, MsMpeg4v3 (Divx) and Mpeg4(Xvid)

This is to EmbyCon Beta : 1.9.20
  • Vito_MCE likes this





Also tagged with one or more of these keywords: Completed

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users