Jump to content

App for Samsung app


wp.rauchholz

Recommended Posts

FrostByte

That wasn't really a solution, just a test of a theory to see what was happening and also to give you an option to still play your movie.  The most desirable thing of course is for everything to Direct Play as long as the TV supports the input file

 

If you look at the log on your TV you will see that the app checks all the parts of your file and sees that it is okay (codec, bitrate, level etc) and then tries to Direct Play it.  However, the TV is then rejecting the file with a Type 1 error which is an invalid video type error because it's looking for the video part in the first position of the file.  That error you're seeing is from the TV and not the app.  

 

The only solutions I can see are:

 

1.  force a transcode by changing the bitrate of the app low enough which will create a file with the video in the first position.  Are all your files this way?  Normally that isn't the case so you would only have to set it low in the rare occurrence when playing those files with the video not in the first position  For LiveTV set it back up to whatever your TV supports (I believe that is 30 Mbps) when I was looking at the user manual for your TV

 

2.  Remux or change the header of your files yourself so that the video is the first ID position.  Takes time, but then everything will DP

 

3.  we find a developer to write a workaround which will force a remux on the fly if the video isn't in the first position while still keeping the quality of the original file.  Unfortunately, this app is a third party app (not made by Luke and his team) and isn't actively in development at this time.  The code is still on GitHub though if someone ever does want to take a stab at it

 

BTW: as a test I changed the order of one of my mkv movies so that all the audio was first and the video was way down and I get the same Type 1 error that you're seeing.

 

Maybe someone else around has a better solution?

Edited by FrostByte
  • Like 2
Link to comment
Share on other sites

I think the issue is definitely the video file not being the first stream.

 

From your testing, you appear to have confirmed that his is the case.

 

This means that some form of transcoding is going to be required.  In it's current form, it will never DirectPlay.

 

Your options are:

  1. Manually by the app by setting lower bit rates (as you have tested)
  2. Automatically by the app (requires a software change)
  3. Manually by a third party utility

 

For option 2, while this probably isn't a complex change, I expect the usage of this app is low and since this is the first occurrence (and a rare circumstance) such a change may not be worth the effort.

 

How many videos do you have where this is the case?  Checking the MediaInfo as you have done to confirm if the video id is the first one is the easiest way.  I would be surprised if you have many as I have never seen this before.

 

Personally, I would go for option 3.  Have you used HandBrake before?  It is a very easy GUI based app.  It allows you to set quality parameters, pass through audio (without any conversion or loss), copy all subs, etc.

 

I would give it a try, it you don't have many files this is probably your quickest/easiest path.

  • Like 1
Link to comment
Share on other sites

wp.rauchholz

I did not test all videos. I picked at random 3 and 2 triggered this error.

I have in total almost 200 movies on my server.

I tested Plex too who handles this w/o problem. Do you know hoe they do this?

Now, I prefer Emby and love to solve this w/o having to go through option  2. I am not a programmer, for which option 3 is a no-go for me.

 

 

 

Wolfgang

Link to comment
Share on other sites

I expect Plex are detecting this and forcing transcoding.  I don't expect it's a hard change, just takes a bit of time to update the package, etc.

 

It's odd that you have so many files with this issue.

Link to comment
Share on other sites

FrostByte

An idea how I could to this transcoding?

 

No need to transcode, just remux them

 

Do you need to have these files in MP4 format?  I know you can use MKVToolnix with MP4 files which is real easy, but it will output everything in mkv format of course.  Just drag and drop onto MKVToolnix and 30 seconds later you should have a good MKV.

 

Otherwise you may need to search for a MP4 tool which will remux

 

Edit:

 

If interested in MKVToolnix

 

https://mkvtoolnix.download/

Edited by FrostByte
Link to comment
Share on other sites

  • 2 weeks later...

Just drag and drop onto MKVToolnix and 30 seconds later you should have a good MKV.

 

Unfortunately that won't help in this case because mkvtoolnix-gui's default behaviour is to output the streams in the same order as the input file :( This is different to ffmpeg's default behaviour which, if no specific stream mapping options are specified, is to discover the "highest quality" (single) video input stream and "highest quality" (single) audio input stream from all input(s), and "send" that to the output. That's why the 30 second snippet worked but the original file didn't.

 

Due to the relatively complex manner in which Emby uses ffmpeg (namely the stream selection and mapping logic) there is no good solution to this problem just less bad ones. Plex is less problematic due to a more naive design, the same is broadly true for the Samsung internal media player, just not in this specific instance.

 

The least worst option is remuxing with manually specified stream mapping, it makes no difference whether mkvtoolnix or ffmpeg is used, the command options are very similar.

 

@@wp.rauchholz You appear to be quite comfortable with using a command line and ffmpeg, I will quite happily walk you through some examples, let me know if you're interested.

 

@@SamES The reason this has not come up before has to do with where the majority of users apparently source their media files. Personally I see this issue all the time but will not elaborate on a public forum. Re-encoding via HandBrake, Emby or anything else may be easy but it's the least desirable option in every other sense.

Edited by OddbOd
Link to comment
Share on other sites

FrostByte

I was able to play the original file uploaded from wp.rauchholz and sent through PM by remuxing using a tool called MP4Box.  There is a new version of Emby app, but that involves transcoding

Link to comment
Share on other sites

Thanks @@OddbOd.  I'd be curious to see how the current theatre based apps handle this.  I expect the server is remapping and streaming the files.

Link to comment
Share on other sites

FrostByte

The new official Orsay app Direct Streams the original file provided and it plays fine.  The file transcoded by ffmpeg and being streamed naturally looks more of the type you would expect to see. 

 

Where as the old Orsay app will buffer to about 91% and then crash giving a Type 1 error (invalid video type)

 

Remuxing with MP4Box seems to correct whatever is wrong with the original file and then the old app will Direct Play without any transcoding by the server.  I would do this to my files myself just for the Direct Play, but probably best if the app could handle it like the official app does and Direct Stream for those who don't want to mess with that.

Link to comment
Share on other sites

wp.rauchholz

Thanks @@OddbOd. I'd appreciate very much if you cold walk me through on command line. I see this behaviour in almost all my movies.

 

Wolfgang.


 

@@wp.rauchholz You appear to be quite comfortable with using a command line and ffmpeg, I will quite happily walk you through some examples, let me know if you're interested.

 

 

Edited by wp.rauchholz
Link to comment
Share on other sites

OK, firstly could you dump Percy Jackson using ffmpeg and attach the results so that I can see the stream ID's 

ffmpeg -i "Percy Jackson_ Im Bann des Zyklop (2013).mp4" >dump.txt
@@FrostByte or @@wp.rauchholz What happens if you try playing the full length Percy Jackson video from a USB drive rather than via Emby? The reason I ask is because the logic in the widget (specifically in app/javascript/Gui/GuiPlayer/GuiPlayer_Versions.js) should be handling this situation correctly.
Link to comment
Share on other sites

wp.rauchholz

Attached the file (small command correction, need to add a '2': ffmpeg -i "Percy Jackson_ Im Bann des Zyklop (2013).mp4" 2>dump.txt

I can play the file from USB in WINDOWS.

The movie shows fine with VLC on my CENTOS laptop

 

Wolfgang

dump.txt

Edited by wp.rauchholz
Link to comment
Share on other sites

FrostByte

Can you play the movie from a usb attached to your tv and using the built in media player (the one that came with the tv, not Emby)?  My usb ports don't work with the Evolution Kit installed on my TV, but I can remove that if needed and I still have your file here.  My guess is that you will still get the Type 1 error

 

What is supposed to happen is that if the Tv can't direct play the file for some reason then the Emby app has to transcode the unsupported file and that way everything plays without user intervention, which obviously isn't happening here

Edited by FrostByte
Link to comment
Share on other sites

Thanks @@FrostByte that's exactly what I meant, I should've been clearer. Would you mind trying it from USB? At least then we would know for certain that it's the widget that's the problem and not a firmware limitation.

 

@@wp.rauchholzThe ffmpeg option that does what we want is -map which is documented here and here. The basic syntax is to specify stream ID's in the order that you want them written to the output file. In this case we want Stream #0:4 to be the first stream, copying all of the others in the same order and not altering the disposition flags. Because I don't have a copy of the original video file I don't know what will happen to the chapter markers, they should not be affected but you will have to try this for yourself to be certain. Also, note that I have assumed you are using Bash.

 

The verbose command for doing this would therefore be:

ffmpeg -i 'Percy Jackson_Im Bann des Zyklon (2013).mp4' -vcodec copy -acodec copy -scodec copy -map 0:4 -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:5 -map 0:6 -map 0:7 -map 0:8 -map 0:9 'Percy Jackson_Im Bann des Zyklon (2013).Emby.mp4'
This command can be simplified but I think we should ensure that this is a practical solution before proceeding further.
Link to comment
Share on other sites

wp.rauchholz

Can you play the movie from a usb attached to your tv and using the built in media player (the one that came with the tv, not Emby)?  My usb ports don't work with the Evolution Kit installed on my TV, but I can remove that if needed and I still have your file here.  My guess is that you will still get the Type 1 error

 

What is supposed to happen is that if the Tv can't direct play the file for some reason then the Emby app has to transcode the unsupported file and that way everything plays without user intervention, which obviously isn't happening here

The movie plays with no problem from the USB on the Samsung build in media player.

Link to comment
Share on other sites

FrostByte

Ya, agreed.  Just got done playing the original file provided by Wolfgang on my TV also with no problem from usb

 

Very odd because the app is trying to Direct Play before it barfs, so it shouldn't be modifying the file at all.  

 

Using 2.2.3 the file buffers to about 91% then crashes to the hub, and then the TV displays that Type 1 error

Edited by FrostByte
Link to comment
Share on other sites

FrostByte

More testing today.

 

F8000 TV With 2014 EvoKit installed:  using Emby App v2.2.3, video Direct Plays, video buffers, app crashes to hub and TV displays a "Type 1 Error"

F8000 Without the EvoKit installed the video Direct Plays, buffers, though the app doesn't crash, but the app itself displays "Render Error 1" and in the log

BD player: video Direct Plays, buffers and then app displays "Render Error 1" and in log.  The video also caused my BD player to reboot once using Emby 2.2.3

 

From usb on F8000 the video plays just fine using the built in Samsung media app

 

Using the official Emby app v111 a few days ago the file Direct Streams and plays fine on F8000 w/EvoKit

server log

https://pastebin.com/LNB6XQMA

direct stream log

https://pastebin.com/02PeCGxH

Edited by FrostByte
Link to comment
Share on other sites

This is good news and exactly what I hoped would happen.

 

@@FrostByte Despite Wolfgang's client log stating Transcode Status: Direct Play the client is actually requesting Direct Stream mode as the playback URL contains the static=true parameter. Note that in the direct stream log using the official app the default video, audio and subtitle streams are selected and passed to ffmpeg (-map 0:4 -map 0:0 -map -0:s) and then HLS is used to deliver the untouched streams. I see no reason why we can't alter the unofficial clients to do exactly the same thing.

 

As a quick and dirty test could you try setting Enable AAC Transcoding to Dolby to true and see if that makes any difference? This should force the client down the Transcoding Audio codepath and explicitly request stream ID 0:4 from the server, hopefully in the appropriate order.

 

Since it's difficult for me to test anything without the original file I think it's time I prepared a freely shareable video that exhibits the same behaviour, Big Buck Bunny seems the obvious choice as all the streams we need are already available. I won't be able to get to this for a day or two due to work commitments but I will be back.

  • Like 1
Link to comment
Share on other sites

FrostByte

As a quick and dirty test could you try setting Enable AAC Transcoding to Dolby to true and see if that makes any difference? This should force the client down the Transcoding Audio codepath and explicitly request stream ID 0:4 from the server, hopefully in the appropriate order.

 

 

Setting AAC to transcode to Dolby does initiate a transcode of audio and ffmpeg is placing files in the appropriate order which plays fine.  Likewise, setting the bitrate to something below the bitrate of the original file causes the server to transcode the video and the resulting file is in the appropriate order and plays fine also.

 

I would assume then anything that initiates a ffmpeg process will create a file which requests the correct streams and plays fine 

Edited by FrostByte
Link to comment
Share on other sites

  • 6 months later...
  • 11 months later...

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