Jump to content

Direct play XviD and transcode DivX. Possible?


lol
 Share

Recommended Posts

Evening all,

 

I'm basically looking for an answer to the title - Direct play XviD and transcode DivX. Possible?

 

It seems I'm only allowed to specify "mpeg4" in the DLNA profiles so my server has to unnecessarily transcode Xvid videos.

 

If this isn't possible, could I request that this be something to consider in a future release?

 

I'm running version 3.0.5821.0 on Windows.

 

Thanks very much!

Link to comment
Share on other sites

in the beta server there is now the CodecTag field which will have that info, although it will require refreshing the videos.

Link to comment
Share on other sites

Evening folks,

 

So I'm running the latest beta server (Version 3.0.5880.0). I've refreshed my videos and can see Codec tag in the media info.

 

How do I tell Emby that I want to direct play XviD and transcode DivX?

 

Many thanks!

Link to comment
Share on other sites

Happy2Play

Don't have any in my library so what does the Media Info show for your media in those codecs?

Link to comment
Share on other sites

I have a few versions of DivX codec. I'll list a few and XviD is at the bottom...

 

Media Info
Video
CodecMPEG4
Codec tagDIVX
ProfileSimple Profile
Level1
Resolution720x576
Aspect ratio5:4
AnamorphicNo
InterlacedNo
Framerate29.97
Bitrate773 kbps
Pixel formatyuv420p
Ref frames1
Audio
CodecMP3
Layoutstereo
Channels2 ch
Bitrate187 kbps
Sample rate44100 khz
DefaultNo
Containeravi

 

Media Info
Video
CodecMPEG4
Codec tagDX50
Level-99
Resolution720x400
Aspect ratio16:9
AnamorphicNo
InterlacedNo
Framerate29.97003
Bitrate756 kbps
Pixel formatyuv420p
Ref frames1
Audio
CodecMP3
Layoutstereo
Channels2 ch
Bitrate125 kbps
Sample rate44100 khz
DefaultNo
Containeravi

 

Media Info
Video
CodecMSMPEG4
Codec tagDIV3
Level-99
Resolution608x336
AnamorphicNo
InterlacedNo
Framerate23.976
Bitrate854 kbps
Pixel formatyuv420p
Ref frames1
Audio
CodecMP3
Layoutstereo
Channels2 ch
Bitrate123 kbps
Sample rate48000 khz
DefaultNo
Containeravi
Media Info
Video
CodecMPEG4
Codec tagXVID
ProfileAdvanced Simple Profile
Level5
Resolution640x480
Aspect ratio4:3
AnamorphicNo
InterlacedNo
Framerate29.97003
Bitrate864 kbps
Pixel formatyuv420p
Ref frames1
Audio
CodecMP3
Layoutstereo
Channels2 ch
Bitrate125 kbps
Sample rate48000 khz
DefaultNo
Containeravi

 

Many thanks!

Link to comment
Share on other sites

Happy2Play

What device/profile will this be for? 

 

The only way I can think of  doing this would be creating a container conditions or codec conditions.

 

Not sure the conditions can be together like this or if they need separated.

<ContainerProfiles>
    <ContainerProfile type="Video" container="avi">
      <Conditions>
        <ProfileCondition condition="Equals" property="VideoLevel" value="1" isRequired="true" />
        <ProfileCondition condition="Equals" property="VideoLevel" value="-99" isRequired="true" />
      </Conditions>
    </ContainerProfile>
  </ContainerProfiles>

or

<ContainerProfiles>
    <ContainerProfile type="Video" container="avi">
      <Conditions>
        <ProfileCondition condition="Equals" property="VideoLevel" value="1" isRequired="true" />
      </Conditions>
    </ContainerProfile>
    <ContainerProfile type="Video" container="avi">
      <Conditions>
        <ProfileCondition condition="Equals" property="VideoLevel" value="-99" isRequired="true" />
      </Conditions>
    </ContainerProfile>
  </ContainerProfiles>

Maybe codec profile

<CodecProfiles>
    <CodecProfile type="Video" codec="mpeg4">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoProfile" value="Advanced Simple Profile" isRequired="true" />
      </Conditions>
    </CodecProfile>
<CodecProfiles>
    <CodecProfile type="Video" codec="mpeg4">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoLevel" value="5" isRequired="true" />
      </Conditions>
</CodecProfile>

Any of these should theoretically transcode your divx and still allow direct play of xvid.  But still dependent on what will be playing them.

 

@@Luke, are profiles going to use "codec tags"?  If so do you have an example since none of the current profiles do.

Edited by Happy2Play
Link to comment
Share on other sites

I'm using a slightly tweaked version of the Sony Bravia 2014 profile.

 

My 2014 Bravia will quite happily play XviD encoded videos, yet wont play DivX, so distinguishing between these codecs would help cut down on needlessly transcoding XviD videos.

 

I've tried setting the profile to direct play "xvid" but it seems to only accept "mpeg4", which to my understanding is more of a standard than a codec.

 

Many thanks.

Link to comment
Share on other sites

Happy2Play

It will be trial and error but I believe the bottom one is probably the best option, it will transcode all mpeg4 files that aren't level 5.

Link to comment
Share on other sites

I'm just looking through my library and I'm seeing a few XviD's that are level 3 too.

 

If someone was to implement this new code, I'd be more than happy to test!

 

Many thanks.

Link to comment
Share on other sites

Happy2Play

Are all your xvid file "Advanced Simple Profile" for profile?  If not then container conditions will have to be the testing route. 

 

Are you wanting me to post a full profile with these changes?  You know you can add this code directly to the appropriate sections of the xml file.  I would make a backup of your custom profile first.

 

%appdata%\Emby-Server\config\dlna\user

Link to comment
Share on other sites

Most are advanced simple profile. There's a few simple profile level 3s.

 

I didn't know I was able to edit the profile like that. Will give it a go tomorrow and let you know how I get on.

Link to comment
Share on other sites

Happy2Play

It isn't that hard, just open your modified Sony (2014) profile in the %appdata%\Emby-Server\config\dlna\user folder and just insert the conditions you want to add into the proper section.  Each example I gave shows there sections, so all you need to insert is the <conditions>.

Link to comment
Share on other sites

Redshirt

When constructing your device profile, you can specify VideoCodecTag in your codec profiles. 

 

<CodecProfile type="Video" codec="mpeg4">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoCodecTag" value="DIV3" isRequired="true" />
      </Conditions>
    </CodecProfile>

  • Like 1
Link to comment
Share on other sites

Redshirt

That error looks more like a structural error in the XML... 

The 'CodecProfiles' start tag on line 79 position 4 does not match the end tag of 'Profile'. Line 108, position 3.

That says to me that the xml was missing a closing tag, or had too many. Or they were missmatched ie: <CodecProfile></Profile>

 

Nevermind. You snuck in while I was tying to say it's fixed.

Edited by Redshirt
Link to comment
Share on other sites

That error looks more like a structural error in the XML... 

The 'CodecProfiles' start tag on line 79 position 4 does not match the end tag of 'Profile'. Line 108, position 3.

That says to me that the xml was missing a closing tag, or had too many. Or they were missmatched ie: <CodecProfile></Profile>

 

Yep, it was missing a closing tag. My fault for being lazy with the copy and pasting!

Link to comment
Share on other sites

Happy2Play

So codectags can be used.

Would this be better by container and not codec since this should only affect avi files instead of all mpeg4.

 

<ContainerProfile type="Video" container="avi">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoLevel" value="xvid" isRequired="true" />
      </Conditions>
    </ContainerProfile>

 

Should transcode all avi files that are not xvid.

Link to comment
Share on other sites

Evening folks.

 

So after extensive testing and trial and error I have further tweaked the 2014 Bravia profile to Direct play what it's capable of and transcode the rest.

Here's what I've done:

 

Replaced the mpeg4 direct play profile with xvid...

DirectPlayProfile container="avi" audioCodec="ac3,eac3,mp3,mp2" VideoCodecTag="xvid" type="Video" />

Added some codec profiles so it always transcodes these...

<CodecProfiles>
    <CodecProfile type="Video" codec="mpeg4">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoCodecTag" value="DX50" isRequired="true" />
	<ProfileCondition condition="NotEquals" property="VideoCodecTag" value="DIVX" isRequired="true" />
      </Conditions>
    </CodecProfile>
    <CodecProfile type="Video" codec="msmpeg4">
      <Conditions>
        <ProfileCondition condition="NotEquals" property="VideoCodecTag" value="DIV3" isRequired="true" />
      </Conditions>
    </CodecProfile>
</CodecProfiles>

I'm not sure if it's been pointed out before, but now I've added the VideoCodecTag property, the front end website doesn't work when I try to change my custom DLNA profile. All changes have to be made through editing the xml file.

 

Thanks for all the help  :D

Link to comment
Share on other sites

Redshirt

Well done lol.

 

Luke (or anyone else), can you just verify for my own knowledge. The isRequired property... when set to false it only affects transcoding profiles, when set to true it affects both direct play/stream and transcoding?

Link to comment
Share on other sites

Happy2Play

I would think "NotEquals" would have given the opposite affect, transcoding everything not "DX50, DIVX, DIV3".

Link to comment
Share on other sites

Redshirt

Nah, I think that just re-enforces my question above.

 

When direct playing "mpeg4" the "VideoCodecTag" must "NotEquals" "DX50" or "DIVX". Chances are when it transcodes, it's transcoding to AAC or MP3.

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
 Share

×
×
  • Create New...