Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transcoded videos playback for Samsung 2016 UHD TVs #4272

Closed
sad-spirit opened this issue Dec 2, 2023 · 5 comments · Fixed by #4667
Closed

Fix transcoded videos playback for Samsung 2016 UHD TVs #4272

sad-spirit opened this issue Dec 2, 2023 · 5 comments · Fixed by #4667

Comments

@sad-spirit
Copy link
Contributor

I own a UE55KS7000 model and hit the same problem that is described in these forum posts
https://www.universalmediaserver.com/forum/viewtopic.php?t=12700
https://www.universalmediaserver.com/forum/viewtopic.php?t=13367

The TV did not play any transcoded videos showing an extremely unhelpful "Unknown error" message.

The logs showed a "Connection reset" exception:

DEBUG 2023-12-02 13:07:22.815 [jupnp-netty-worker 23] Caught exception: Connection reset
TRACE 2023-12-02 13:07:22.815 [jupnp-netty-worker 23] 
java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426)
	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
	at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)

which immediately followed that server response

HTTP/1.1 206 Partial Content (non-chunked)

HEADER:
  Content-Type: video/vnd.dlna.mpeg-tts
  Content-Range: bytes 0-9223372034707292158/9223372034707292159
  ContentFeatures.DLNA.ORG: DLNA.ORG_PN=AVC_TS_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000
  Accept-Ranges: bytes
  Connection: keep-alive
  Server: Linux-amd64-6.1.0-0.deb11.13-amd64, UPnP/1.0 DLNADOC/1.50, UMS/13.8.0

As I suspected that the TV was not amused by the above Content-Range header, I added

TranscodedVideoFileSize = 1000000

to a custom .conf file based on Samsung-UHD.conf and transcoded videos immediately started playing.

Also changing

SeekByTime = true

to

SeekByTime = exclusive

actually allowed seeking.

I can create a PR for these changes, what should be the correct approach:

  • Just fix Samsung-UHD.conf
    or
  • Create a new higher-priority .conf with these changes that applies only to models of 2016 and before?

Another question is whether it is reasonable to use an Exabyte-sized Content-Range header in the first place?

@sad-spirit
Copy link
Contributor Author

A followup:

ChunkedTransfer = true

also helps.

I think using chunked transfer encoding is a better way according to HTTP spec: it is specifically designed for content of unknown length.

juliekrodriguez added a commit to juliekrodriguez/UniversalMediaServer that referenced this issue Dec 12, 2023
@SubJunk
Copy link
Member

SubJunk commented Apr 22, 2024

@sad-spirit a PR would be great, thank you.
I can see that the TranscodedVideoFileSize hack is already in a lot of the Samsung configs. Do you need both ChunkedTransfer and TranscodedVideoFileSize, or just one of them?

@sad-spirit
Copy link
Contributor Author

@SubJunk

Do you need both ChunkedTransfer and TranscodedVideoFileSize, or just one of them?

Just one of them, I'd suggest ChunkedTransfer as a lesser hack.

PIease give me guidance on PR, see above:

what should be the correct approach:

  • Just fix Samsung-UHD.conf
    or
  • Create a new higher-priority .conf with these changes that applies only to models of 2016 and before?

I suspect that just fixing the config will not break anything as it only applies to pre-2019 TVs but obviously I don't have TVs to test the changes with.

@SubJunk
Copy link
Member

SubJunk commented May 2, 2024

@sad-spirit I agree with you, you can just change it in that UHD file

@SubJunk
Copy link
Member

SubJunk commented May 18, 2024

@sad-spirit thank you for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants