Jump to content

Subtitle method "Embed" not accepted


Recommended Posts

VernoxVernax
Posted

Hello. Since subtitle extraction takes way too long for my system Embed is the only way I can do this.
This is the DeviceProfile I am sending on post /PlaybackInfo:

DeviceProfile: DeviceProfile {
                Name: "mpv",
                MaxStreamingBitrate: bitrate,
                TranscodingProfiles: [
                    TranscodingProfile {
                        Container: "ts",
                        Protocol: "hls",
                        Type: "Video",
                        VideoCodec: "hevc",
                    }
                ],
                SubtitleProfiles: [
                    SubtitleProfile {
                        Format: "subrip",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "srt",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "ass",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "ssa",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "pgssub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "sub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "dvdsub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "pgs",
                        Method: "Embed"
                    }
                ]
            }

I've tried mutliple combinations spread across the last few days.

I hope someone can point towards the solution.

I have tried multiple video files containing either ass subtitles or subrips.

Emby server log:

log.txt

Posted

Hi.  Exactly what are you trying to accomplish?  Those profile values are used to report to the server what your device supports, not what the server should necessarily do.  If your device/app does not support embedded subtitles then they are not going to work.

pünktchen
Posted

Do you want to burn-in the subtitles into the video stream? Then you want "encode" not "embed" because that's for video containers that can hold subtitles as a seperate stream like mkv.

Posted
29 minutes ago, pünktchen said:

Do you want to burn-in the subtitles into the video stream? Then you want "encode" not "embed" because that's for video containers that can hold subtitles as a seperate stream like mkv.

You never need to specify Encode profiles because that's always supported, and that's always the fallback if no better technique is available.

Posted
2 hours ago, VernoxVernax said:

Hello. Since subtitle extraction takes way too long for my system Embed is the only way I can do this.
This is the DeviceProfile I am sending on post /PlaybackInfo:

DeviceProfile: DeviceProfile {
                Name: "mpv",
                MaxStreamingBitrate: bitrate,
                TranscodingProfiles: [
                    TranscodingProfile {
                        Container: "ts",
                        Protocol: "hls",
                        Type: "Video",
                        VideoCodec: "hevc",
                    }
                ],
                SubtitleProfiles: [
                    SubtitleProfile {
                        Format: "subrip",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "srt",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "ass",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "ssa",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "pgssub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "sub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "dvdsub",
                        Method: "Embed"
                    },
                    SubtitleProfile {
                        Format: "pgs",
                        Method: "Embed"
                    }
                ]
            }

I've tried mutliple combinations spread across the last few days.

I hope someone can point towards the solution.

I have tried multiple video files containing either ass subtitles or subrips.

Emby server log:

log.txt 3.69 kB · 0 downloads

What happened and what did you expect to happen?

VernoxVernax
Posted
6 hours ago, Luke said:

What happened and what did you expect to happen?

Sorry, that I wasnt specific enough. I am trying to stream a transcoded video to my mpv player. The only reason for transcoding is or should be that the videos bitrate is too high for streaming. Since the video player is mpv, all subtitle codecs are supported and I would much rather just keep them Embeded in the video. This is why I specified all kinds of subtitle codecs in hopes of emby not always burning in the subtitles. External seemed to be suffice at the beginning but the extraction process took too long.

Posted

OK it's because embeds are not used with hls transcoding. I would leave those Embed profiles in place, but also add:

                {
                    Format: 'vtt',
                    Method: 'Hls'
                }

And then in your TranscodingProfile set ManifestSubtitles = 'vtt';

Now you'll get HLS subtitles, which the server fully supports, but then the next problem you'll run into is that this is not supported by mpv due to the hls demuxer in ffmpeg not having completed it's implementation of this.

VernoxVernax
Posted
12 hours ago, Luke said:

OK it's because embeds are not used with hls transcoding. I would leave those Embed profiles in place, but also add:

                {
                    Format: 'vtt',
                    Method: 'Hls'
                }

And then in your TranscodingProfile set ManifestSubtitles = 'vtt';

Now you'll get HLS subtitles, which the server fully supports, but then the next problem you'll run into is that this is not supported by mpv due to the hls demuxer in ffmpeg not having completed it's implementation of this.

Why is it not possible to just copy the subtitle tracks like `-c:s copy -map 0:s`?

Hls is not really necessary. I just tried to add whatever option, that could affect the transcode.

Posted

Then try removing the hls protocol from your transcodingproifle.

VernoxVernax
Posted
Just now, Luke said:

Then try removing the hls protocol from your transcodingproifle.

Trust me I only added that after hours of confusion.

*Removes it*

Still doesnt work.

Debug App: GetPostedPlaybackInfo request: {"Id":"42098","UserId":"b1384883b5904d67817a93c3b8804615","MaxStreamingBitrate":200000000,"StartTimeTicks":0,"DeviceProfile":{"Name":"mpv","Id":"12cdab97-934c-4c8b-85c7-8fde393b79a0","SupportedMediaTypes":"Audio,Photo,Video","MaxStreamingBitrate":200000000,"MusicStreamingTranscodingBitrate":256000,"MaxStaticMusicBitrate":999999999,"DirectPlayProfiles":[],"TranscodingProfiles":[{"Type":"Video","VideoCodec":"hevc","EstimateContentLength":false,"EnableMpegtsM2TsMode":false,"TranscodeSeekInfo":"Auto","CopyTimestamps":false,"Context":"Streaming","MinSegments":0,"SegmentLength":0,"BreakOnNonKeyFrames":false,"AllowInterlacedVideoStreamCopy":false,"MaxManifestSubtitles":0}],"ContainerProfiles":[],"CodecProfiles":[],"ResponseProfiles":[],"SubtitleProfiles":[{"Format":"subrip","Method":"Embed"},{"Format":"srt","Method":"Embed"},{"Format":"ass","Method":"Embed"},{"Format":"ssa","Method":"Embed"},{"Format":"pgssub","Method":"Embed"},{"Format":"sub","Method":"Embed"},{"Format":"dvdsub","Method":"Embed"},{"Format":"pgs","Method":"Embed"}]},"EnableDirectPlay":false,"EnableDirectStream":false,"EnableTranscoding":true,"AllowInterlacedVideoStreamCopy":false,"AllowVideoStreamCopy":false,"AllowAudioStreamCopy":true,"IsPlayback":true,"AutoOpenLiveStream":false,"DirectPlayProtocols":["Http"]}
2022-08-03 17:33:14.652 Info App: User policy for VernoxVernax. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
2022-08-03 17:33:14.654 Info Server: http/1.1 Response 200 to emby_remote_ip. Time: 18ms. http://host1/emby/Items/42098/PlaybackInfo?UserId=b1384883b5904d67817a93c3b8804615
2022-08-03 17:33:14.663 Info Server: http/1.1 POST http://host1/emby/Sessions/Playing?format=json. UserAgent: curl/7.83.1-DEV isahc/1.7.2
2022-08-03 17:33:14.665 Debug SqliteItemRepository: Public GetItemLinks
2022-08-03 17:33:14.667 Info SessionManager: Playback start reported by app Emby Theater 0.5.7 playing movie. Started at unknown ms
2022-08-03 17:33:14.667 Info Server: http/1.1 Response 204 to emby_remote_ip. Time: 4ms. http://host1/emby/Sessions/Playing?format=json
2022-08-03 17:33:14.862 Info Server: http/1.1 GET http://host1/emby/videos/42098/stream?DeviceProfileId=12cdab97-934c-4c8b-85c7-8fde393b79a0&DeviceId=12cdab97-934c-4c8b-85c7-8fde393b79a0&MediaSourceId=9881ffd7131961084f78954549c288ca&PlaySessionId=0a7d84676aa94dceacbedd8c255eb531&VideoCodec=hevc&VideoBitrate=199552000&AudioBitrate=448000&AudioStreamIndex=4&SubtitleStreamIndex=1&SubtitleMethod=Encode&TranscodeReasons=DirectPlayError&allowVideoStreamCopy=false&Container=mkv&SubtitleMethod=VideoSideData.

 

Posted

Please make sure to attach complete server and ffmpeg log file examples as these little snippets make it difficult to see the full picture. Thanks.

VernoxVernax
Posted
1 minute ago, Luke said:

Please make sure to attach complete server and ffmpeg log file examples as these little snippets make it difficult to see the full picture. Thanks.

Sorry. Btw thank you for still helping me. Many others would have already sent back to reading the docs.

 

ffmpeg.log emby.log.txt

Posted

I'm guessing you didn't specify a selected subtitle stream index in the /playbackinfo call. 

VernoxVernax
Posted
2 minutes ago, Luke said:

I'm guessing you didn't specify a selected subtitle stream index in the /playbackinfo call. 

You guessed correctly. I assumed emby would just return every track if I dont specify a single one.

Didn't change a thing though:

2022-08-03 18:24:28.207 Debug App: GetPostedPlaybackInfo request: {"Id":"42098","UserId":"b1384883b5904d67817a93c3b8804615","MaxStreamingBitrate":20000000,"StartTimeTicks":0,"SubtitleStreamIndex":0,"DeviceProfile":{"Name":"mpv","Id":"12cdab97-934c-4c8b-85c7-8fde393b79a0","SupportedMediaTypes":"Audio,Photo,Video","MaxStreamingBitrate":20000000,"MusicStreamingTranscodingBitrate":256000,"MaxStaticMusicBitrate":999999999,"DirectPlayProfiles":[],"TranscodingProfiles":[{"Type":"Video","VideoCodec":"hevc","EstimateContentLength":false,"EnableMpegtsM2TsMode":false,"TranscodeSeekInfo":"Auto","CopyTimestamps":false,"Context":"Streaming","MinSegments":0,"SegmentLength":0,"BreakOnNonKeyFrames":false,"AllowInterlacedVideoStreamCopy":false,"MaxManifestSubtitles":0}],"ContainerProfiles":[],"CodecProfiles":[],"ResponseProfiles":[],"SubtitleProfiles":[{"Format":"subrip","Method":"Embed"},{"Format":"srt","Method":"Embed"},{"Format":"ass","Method":"Embed"},{"Format":"ssa","Method":"Embed"},{"Format":"pgssub","Method":"Embed"},{"Format":"sub","Method":"Embed"},{"Format":"dvdsub","Method":"Embed"},{"Format":"pgs","Method":"Embed"}]},"EnableDirectPlay":false,"EnableDirectStream":false,"EnableTranscoding":true,"AllowInterlacedVideoStreamCopy":false,"AllowVideoStreamCopy":false,"AllowAudioStreamCopy":true,"IsPlayback":true,"AutoOpenLiveStream":false,"DirectPlayProtocols":["Http"]}
2022-08-03 18:24:28.211 Info App: User policy for VernoxVernax. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

 

ffmpeg.log

Posted

You're not specifying a container in  your TranscodingProfile

VernoxVernax
Posted
2 minutes ago, Luke said:

You're not specifying a container in  your TranscodingProfile

oh. I just added "&Container=mkv" to the url and since that worked I assumed it wouldn't have an impact on the subtitle mode.

Well its obviously working now.

While I am already at it:

I assume its not possible to mux and copy every track into the file (except for video of course). Like every subtitle track and audio track. Without the "index" options, it just takes the default one, which is fine, but not to my liking.

Posted

That's not exactly supported, no. You might be able to take the transcoding url obtained from /playbackInfo and do a search and replace on SubtitleStreamIndex and change it to SubtitleStreamIndexes=1,2,3, so a comma delimited list. But that's untested by us so I can't promise it will work.

  • Thanks 1
VernoxVernax
Posted
1 minute ago, Luke said:

That's not exactly supported, no. You might be able to take the transcoding url obtained from /playbackInfo and do a search and replace on SubtitleStreamIndex and change it to SubtitleStreamIndexes=1,2,3, so a comma delimited list. But that's untested by us so I can't promise it will work.

Great. Will try. Thank you so much for helping me!

Posted

How did that go?

VernoxVernax
Posted

Well, after I realised the SubtitleStreamIndex option wasn't working, it took me like 5 hours only to find out that one also has to provide the mediasourceid.

Changing/appending "es" to SubtitleStreamIndex and turning "1" to "1,2,3", yields in the whole argument missing from "Debug App: GetPostedPlaybackInfo request" (log).

Just tried turning the string to an array (like ["1", "2", "3"] or [1,2,3]).

Nothing.

  • 2 weeks later...
Posted

Ok thanks for the info.

  • Like 1

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