Jump to content

Direct Stream transcoding video if PGS subtitles are used


Xorp

Recommended Posts

Previously, if I played a Blu-ray mkv remux with PGS subtitles, the Emby Android app would direct stream everything (which it still does if I have no subtitles or SRT subtitles selected), but after a recent update it's transcoding the video if I turn on the PGS subtitles. It used to Direct Stream the PGS subtitles. This over a gigabit LAN to a Shield. Same thing is happening to a Roku.

 

Log: https://pastebin.com/nzL61MPh

Edited by Xorp
Link to comment
Share on other sites

Hi.  This is due to the audio being multi-channel FLAC.  That needs to be converted and, once that happens, the only thing we can do with PGS subs at this time is burn them in.

Link to comment
Share on other sites

This is on my local LAN. The audio doesn't need to be converted since the receiver supports up to 24/192 PCM. The app used to decode and output to the receiver as PCM.

Edited by Xorp
Link to comment
Share on other sites

I already know why this is happening.  The player in the app does not support multi-channel FLAC in a video file right now.  So, it needs to convert that and, once that is the case, the only way to deliver the PGS subs is to burn them in.  External text-based subs or a compatible audio track (almost anything other than FLAC) would eliminate this issue.

Link to comment
Share on other sites

This must be a new bug? I've been playing FLAC 5.1-7.1 / AVC / PGS / MKV files for over a year in the Emby Android app with no problem.

  • Like 1
Link to comment
Share on other sites

This must be a new bug? I've been playing FLAC 5.1-7.1 / AVC / PGS / MKV files for over a year in the Emby Android app with no problem.

 

Can you provide a sample file that you know used to direct play?

Link to comment
Share on other sites

  • 1 year later...
thegrunge

I get the same problème when I used pgs subtitles the video is transcode and cut every 10 secondes. The audio format of my files are on AC3 5.1 and if I download others subtitles from emby that’s ok. I try the same file on my plex server and it’s direct play

 

EDIT: I unchecked Allow caption extraction on the fly and it works 100% better!

 

 

post-177488-0-67489900-1581983234_thumb.png

post-177488-0-09558300-1581983242_thumb.png

post-177488-0-86012800-1581983335_thumb.png

post-177488-0-08451100-1581983343_thumb.png

post-177488-0-25296700-1581985503_thumb.png

post-177488-0-17757700-1581985511_thumb.png

Edited by thegrunge
Link to comment
Share on other sites

thegrunge

yet it changes everything for me into a roof case. I will send a comparison video but already we can see the difference in bitrate. I think he try to extract pgs and it fuck everything.

 

And thing to see is that the bitrate is constantly adjusting in transcoding. I send video tomorrow

Edited by thegrunge
Link to comment
Share on other sites

thegrunge

I redid tests and indeed this function does not change anything. Simple circumstance which makes that the bitrate is higher than the days before in video transcoding caused by the PGS format. In any case even with a bitrate = to that of the video in transcoding, the video cuts every 10 seconds is a rather annoying problem.

Link to comment
Share on other sites

 In any case even with a bitrate = to that of the video in transcoding, the video cuts every 10 seconds is a rather annoying problem.

 

Hi. That would be an indication that your server just cannot transcode fast enough for smooth playback.  I see this in one of your images above (31fps).

Link to comment
Share on other sites

thegrunge

@ebr it is possible, however I have no reading problems if I do not put PGS subtitles and I force transcoding for example 2 mbps of a video file which normally in direct reading uses 15 mbps .. What would be the number of fps would be acceptable, because I can deactivate the regulation option in transcoding to see, otherwise the transcoding is done by hardware generally.

Link to comment
Share on other sites

Burning in graphical subs can be quite processor intensive.  You need to be able transcode faster than the video needs to be delivered.  Standard frame rate is about 30.

Link to comment
Share on other sites

thegrunge

@ebr Good here I made some test while playing with the profile of encoding and the crf and came to the conclusion that it was necessary to go as high as possible with the profile of encoding at the expense of a higher crf. this is the best way to have the best possible image as long as we have at least a fps of 20 and not below it otherwise we will be victim of video cutoff (We are always talking about a transcoded video playback because of the PGS subtitle format) In my case I had to set the encoding profile to medium and the crf to 24 to have a fps always above 20

Edited by thegrunge
Link to comment
Share on other sites

PGS subs by themselves do not require transcoding. It is only because some other factor of your media is not playable on the device.  My guess would be the audio track.  If you provide compatible audio tracks, or set the app to downmix to stereo, then transcoding will probably not be required at all.

Link to comment
Share on other sites

thegrunge

@ebr The sound is in AC3 5.1 and by deactivating the PGS subtitles I fall in direct reading. The same file with the pgs activated on the same device with my plex server is in direct reading. I tested with other type of subtitle other than PGS and I stayed in direct reading with emby. Apart from an incompatibility at the Emby server level with PGS subtitles, I don't really see what it could be.

Link to comment
Share on other sites

@ebr The sound is in AC3 5.1 and by deactivating the PGS subtitles I fall in direct reading. The same file with the pgs activated on the same device with my plex server is in direct reading. I tested with other type of subtitle other than PGS and I stayed in direct reading with emby. Apart from an incompatibility at the Emby server level with PGS subtitles, I don't really see what it could be.

 

Please post the ffmpeg log that is created when you play that item.

Link to comment
Share on other sites

thegrunge

@@ebr this is a exemple log with pgs subtitle:

 

19:39:28.732 ffmpeg version 4.3.0-emby_2019_11_09 Copyright © 2000-2019 the FFmpeg developers and softworkz for Emby LLC
19:39:28.733 built with clang version 8.0.0 (tags/RELEASE_800/final)
19:39:28.733 Execution Date: 2020-02-19 19:39:28
19:39:28.847 [matroska,webm @ 0x7fb478800000] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
19:39:28.847 [matroska,webm @ 0x7fb478800000] Could not find codec parameters for stream 4 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
19:39:28.847 [matroska,webm @ 0x7fb478800000] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
19:39:28.847 Input #0, matroska,webm, from 'file:/Volumes/My Passport/Films/Video/Winter's Bone 2010 MULTi 1080p BluRay X264 AC3 5.1-TG.mkv':
19:39:28.847 Metadata:
19:39:28.847 title : Winter's Bone 2010 MULTi 1080p BluRay X264 AC3 5.1-TG
19:39:28.847 encoder : libebml v1.3.10 + libmatroska v1.5.2
19:39:28.847 creation_time : 2020-02-15T03:38:20.000000Z
19:39:28.847 Duration: 01:39:58.98, start: 0.000000, bitrate: 6550 kb/s
19:39:28.847 Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1038 [sAR 1:1 DAR 320:173], Level 41, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc, Start-Time 0.005s (default)
19:39:28.847 Metadata:
19:39:28.847 BPS-eng : 5223381
19:39:28.847 DURATION-eng : 01:39:58.952000000
19:39:28.847 NUMBER_OF_FRAMES-eng: 143831
19:39:28.847 NUMBER_OF_BYTES-eng: 3916851934
19:39:28.847 Stream #0:1(fre): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
19:39:28.847 Metadata:
19:39:28.847 title : Français
19:39:28.847 BPS-eng : 640000
19:39:28.847 DURATION-eng : 01:39:58.976000000
19:39:28.847 NUMBER_OF_FRAMES-eng: 187468
19:39:28.847 NUMBER_OF_BYTES-eng: 479918080
19:39:28.847 Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
19:39:28.847 Metadata:
19:39:28.847 title : Anglais
19:39:28.847 BPS-eng : 640000
19:39:28.847 DURATION-eng : 01:39:58.976000000
19:39:28.847 NUMBER_OF_FRAMES-eng: 187468
19:39:28.847 NUMBER_OF_BYTES-eng: 479918080
19:39:28.847 Stream #0:3(fre): Subtitle: hdmv_pgs_subtitle (default)
19:39:28.847 Metadata:
19:39:28.847 title : ForceÌs
19:39:28.847 BPS-eng : 2069
19:39:28.847 DURATION-eng : 00:37:22.991000000
19:39:28.847 NUMBER_OF_FRAMES-eng: 84
19:39:28.847 NUMBER_OF_BYTES-eng: 580358
19:39:28.847 Stream #0:4(fre): Subtitle: hdmv_pgs_subtitle
19:39:28.847 Metadata:
19:39:28.847 title : Complets
19:39:28.847 BPS-eng : 19378
19:39:28.847 DURATION-eng : 01:39:24.292000000
19:39:28.847 NUMBER_OF_FRAMES-eng: 1694
19:39:28.848 NUMBER_OF_BYTES-eng: 14447258
19:39:28.848 Stream #0:5(eng): Subtitle: hdmv_pgs_subtitle
19:39:28.848 Metadata:
19:39:28.848 title : Anglais
19:39:28.848 BPS-eng : 26980
19:39:28.848 DURATION-eng : 01:32:26.833000000
19:39:28.848 NUMBER_OF_FRAMES-eng: 1840
19:39:28.848 NUMBER_OF_BYTES-eng: 18707369
19:39:28.849 Stream mapping:
19:39:28.849 Stream #0:0 (h264) -> overlay:main
19:39:28.849 Stream #0:4 (pgssub) -> scale
19:39:28.849 scale -> Stream #0:0 (libx264)
19:39:28.849 Stream #0:1 -> #0:1 (copy)
19:39:28.849 Press [q] to stop, [?] for help
19:39:28.867 [matroska,webm @ 0x7fb478800000] sub2video: using 1920x1038 canvas
19:39:28.870 [libx264 @ 0x7fb47800a800] using SAR=1/1
19:39:28.871 [libx264 @ 0x7fb47800a800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
19:39:28.874 [libx264 @ 0x7fb47800a800] profile Main, level 4.1, 4:2:0, 8-bit
19:39:28.874 [libx264 @ 0x7fb47800a800] 264 - core 157 r2935+10 72db437 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=4 chroma_me=0 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=72 keyint_min=37 scenecut=0 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=3360 vbv_bufsize=6720 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
19:39:28.874 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef0.ts.tmp' for writing
19:39:28.874 Output #0, segment, to '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef%d.ts':
19:39:28.874 Metadata:
19:39:28.874 encoder : Lavf58.31.104
19:39:28.874 Stream #0:0: Video: h264 (libx264), yuv420p, 1280x692 [sAR 1:1 DAR 320:173], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc (default)
19:39:28.874 Metadata:
19:39:28.874 encoder : Lavc58.56.101 libx264
19:39:28.874 Side data:
19:39:28.874 cpb: bitrate max/min/avg: 3360000/0/0 buffer size: 6720000 vbv_delay: N/A
19:39:28.875 Stream #0:1(fre): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
19:39:29.366 frame= 48 fps=0.0 q=27.0 size= 212kB time=00:00:02.49 bitrate= 695.0kbits/s throttle=off speed=4.93x
19:39:29.866 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef.m3u8.tmp' for writing
19:39:29.867 SegmentComplete=video:0 Index=0 Start=0.000000 End=3.003000 Duration=3.003000 offset_pts=0 start_pts=0 Frames=72 filename=21335a7dd7a109e7f5c853269bbbdeef0.ts
19:39:29.867 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef1.ts.tmp' for writing
19:39:29.868 frame= 93 fps= 91 q=27.0 size= 527kB time=00:00:04.25 bitrate=1014.9kbits/s throttle=off speed=4.18x
19:39:30.378 frame= 138 fps= 91 q=27.0 size= 801kB time=00:00:06.04 bitrate=1085.2kbits/s throttle=off speed=3.98x
>> ThrottleByStreamBufferSize: Playback position unknown
19:39:30.675 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef.m3u8.tmp' for writing
19:39:30.677 SegmentComplete=video:0 Index=1 Start=3.003000 End=6.006000 Duration=3.003000 offset_pts=0 start_pts=3003000 Frames=72 filename=21335a7dd7a109e7f5c853269bbbdeef1.ts
19:39:30.677 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef2.ts.tmp' for writing
19:39:30.882 frame= 188 fps= 93 q=27.0 size= 1074kB time=00:00:08.09 bitrate=1086.7kbits/s throttle=off speed= 4x
19:39:31.345 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef.m3u8.tmp' for writing
19:39:31.347 SegmentComplete=video:0 Index=2 Start=6.006000 End=9.009000 Duration=3.003000 offset_pts=0 start_pts=6006000 Frames=72 filename=21335a7dd7a109e7f5c853269bbbdeef2.ts
19:39:31.347 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef3.ts.tmp' for writing
19:39:31.383 frame= 240 fps= 95 q=27.0 size= 1295kB time=00:00:10.40 bitrate=1019.9kbits/s throttle=off speed=4.12x
19:39:31.909 frame= 283 fps= 93 q=27.0 size= 1455kB time=00:00:12.19 bitrate= 977.8kbits/s throttle=off speed= 4x
19:39:32.356 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef.m3u8.tmp' for writing
19:39:32.369 SegmentComplete=video:0 Index=3 Start=9.009000 End=12.012000 Duration=3.003000 offset_pts=0 start_pts=9009000 Frames=72 filename=21335a7dd7a109e7f5c853269bbbdeef3.ts
19:39:32.369 [segment @ 0x7fb478027c00] Opening '/Volumes/My Passport/transcoding-temp/21335a7dd7a109e7f5c853269bbbdeef4.ts.tmp' for writing
19:39:32.420 frame= 313 fps= 88 q=27.0 size= 1809kB time=00:00:13.44 bitrate=1102.5kbits/s throttle=off speed=3.78x
>! ThrottleByStreamBufferSize: WARNING - Playback position too close to transcoding position: PlaybackPosition: 00:00:00 - TranscodingPosition: 00:00:13 - ThrottleBuffer: 13s

Link to comment
Share on other sites

Hi.  Can you please attach the entire log as a file?  Thanks.

 

 

How to Post Log Files

 

When posting in a thread, click "More Reply Options", then click "Attach Files". Zip files are permitted but not preferred - please only zip log files if you receive a file size warning. 
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
×
×
  • Create New...