FAQ  •  Register  •  Login

Transcoding: Aspect ratio and subtitles

<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Sat Jan 27, 2018 7:54 pm

Transcoding: Aspect ratio and subtitles

I have some mkv files with "new" x265-codec in there videostream.
My Panasonic TV and Bluray-Player won't play these files natively, so i selected "Panasonic Viera (2013)"-profile for transcoding.
Playing the transcoded mpeg2-ts works, but there are two issues:

1. The transcoded video is stretched
2. The embedded forced subtitle (see stream #0:3 of source in ffmpeg info)

I found some similar threads concerning the aspect ratio, but with no real solution. DAR seems to be like the original file.
Seems to have something to do with Panasonic's mpeg2-ts playback? What can I change in the transcoding profile, to get better results?
Thanks for advice.

FFMpeg Source:
Input #0, matroska,webm, from 'unfired-sicario-x265.mkv-sample.mkv':
Metadata:
encoder : libebml v1.3.4 + libmatroska v1.4.5
creation_time : 2017-11-11T17:33:57.000000Z
Duration: 00:01:04.55, start: 0.167000, bitrate: 3987 kb/s
Chapter #0:0: start 0.000000, end 64.719000
Metadata:
title : 00:00:00.000
Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x800 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS : 999485
BPS-eng : 999485
DURATION : 00:01:04.022000000
DURATION-eng : 00:01:04.022000000
NUMBER_OF_FRAMES: 1535
NUMBER_OF_FRAMES-eng: 1535
NUMBER_OF_BYTES : 7998636
NUMBER_OF_BYTES-eng: 7998636
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-11-11 17:33:57
_STATISTICS_WRITING_DATE_UTC-eng: 2017-11-11 17:33:57
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Metadata:
BPS : 1508992
BPS-eng : 1508992
DURATION : 00:01:03.979000000
DURATION-eng : 00:01:03.979000000
NUMBER_OF_FRAMES: 5998
NUMBER_OF_FRAMES-eng: 5998
NUMBER_OF_BYTES : 12067976
NUMBER_OF_BYTES-eng: 12067976
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-11-11 17:33:57
_STATISTICS_WRITING_DATE_UTC-eng: 2017-11-11 17:33:57
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
Metadata:
BPS : 1508968
BPS-eng : 1508968
DURATION : 00:01:03.980000000
DURATION-eng : 00:01:03.980000000
NUMBER_OF_FRAMES: 5998
NUMBER_OF_FRAMES-eng: 5998
NUMBER_OF_BYTES : 12067976
NUMBER_OF_BYTES-eng: 12067976
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-11-11 17:33:57
_STATISTICS_WRITING_DATE_UTC-eng: 2017-11-11 17:33:57
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3(ger): Subtitle: dvd_subtitle, 1920x1080 (default) (forced)
Metadata:
title : forced
BPS : 0
BPS-eng : 0
DURATION : 00:00:00.000000000
DURATION-eng : 00:00:00.000000000
NUMBER_OF_FRAMES: 0
NUMBER_OF_FRAMES-eng: 0
NUMBER_OF_BYTES : 0
NUMBER_OF_BYTES-eng: 0
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-11-11 17:33:57
_STATISTICS_WRITING_DATE_UTC-eng: 2017-11-11 17:33:57
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:4(ger): Subtitle: dvd_subtitle, 1920x1080
Metadata:
title : complete
BPS : 13927
BPS-eng : 13927
DURATION : 00:00:02.640000000
DURATION-eng : 00:00:02.640000000
NUMBER_OF_FRAMES: 1
NUMBER_OF_FRAMES-eng: 1
NUMBER_OF_BYTES : 4596
NUMBER_OF_BYTES-eng: 4596
_STATISTICS_WRITING_APP: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.7.1 ('Pandemonium') 64bit
_STATISTICS_WRITING_DATE_UTC: 2017-11-11 17:33:57
_STATISTICS_WRITING_DATE_UTC-eng: 2017-11-11 17:33:57
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES


FFMpeg Target (while playback)
Input #0, mpegts, from 'transcoding-temp-d0733297bb4b340cd09949f800206def.stf':
Duration: 00:01:04.00, start: 1.441711, bitrate: 4788 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, progressive), 1920x800 [SAR 1:1 DAR 12:5], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x101](ger): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
Attachments
serviio.log
(154.15 KiB) Downloaded 54 times
<<

DenyAll

DLNA master

Posts: 2153

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sun Jan 28, 2018 1:01 am

Re: Transcoding: Aspect ratio and subtitles

A few questions:

  • What was the issue with the sub-titles?
  • What are your subtitle settings in Serviio Console?
  • Does the aspect button on your TV remote change anything?
  • What aspect does your TV see the transcoded file as (4:3 or 16:9)
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Sun Jan 28, 2018 10:13 am

Re: Transcoding: Aspect ratio and subtitles

DenyAll wrote:A few questions:

  • What was the issue with the sub-titles?
  • What are your subtitle settings in Serviio Console?
  • Does the aspect button on your TV remote change anything?
  • What aspect does your TV see the transcoded file as (4:3 or 16:9)


Sorry for not explaining the subtitle issue. Just forgot to finish the sentence.
The issue is the missing subtitle stream (see FFmpeg target). In Source there is a forced subtitle stream, in target there are no subtitle streams.

Subtitle settings in console are by default.
Subtitles are enabled, automatic detection charset are enabled.

Concerning the aspect on my TV I noticed two different behaviours (tv and bluray player).

Build-in media player of TV
  • Just three settings: Aspect1, Aspect2, Original
  • Aspect1 and 2 stretches the picture fullscreen without black bars
  • Original shows a 4:3 picture

Bluray player via HDMI in
  • TV shows the same 4:3 as mentioned above
  • There are more aspect options
  • “4:3 Fullscreen“ does the right thing -> stretching the picture just horizontal
<<

DenyAll

DLNA master

Posts: 2153

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sun Jan 28, 2018 12:21 pm

Re: Transcoding: Aspect ratio and subtitles

“4:3 Fullscreen“ does the right thing -> stretching the picture just horizontal
The device should remember this setting and use it for all 4:3 videos (if you're like me, you may not have too many so leaving it in this mode should work for you - when you do get a 4:3 native video just change it with the aspect button again). Just not sure yet why your TV doesn't give you the same option for changing the aspect ratio. Are both devices using the same profile?

For the TV try the Panasonic 2010 profile and let me know if that makes a difference.

The issue is the missing subtitle stream (see FFmpeg target). In Source there is a forced subtitle stream, in target there are no subtitle streams.
Subtitle streams are not copied into transcoded files in Serviio. The only way to do subtitles when transcoding is to burn them into the transcoded file. This will force transcoding for any file containing subtitles.

If you want this feature check "Enable burned-in subtitles" in Serviio Console and press Save. You also have to enable it for MKV files (the Panasonic 2013 profile only has them enabled for MP4 files). To do this you need to edit the profile:

  • Edit the file config\profiles.xml using your favourite text editor (Notepad++ recommended)
  • find the line
    <RequiredFor container="mp4"/>
    in the "Panasonic Viera (2013)" profile.
  • Add the following in a new line directly below that line
    <RequiredFor container="matroska"/>
Save file and restart your PC.
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Sun Jan 28, 2018 1:28 pm

Re: Transcoding: Aspect ratio and subtitles

Just not sure yet why your TV doesn't give you the same option for changing the aspect ratio.

This is cause we‘re talking about hdmi-input at the one hand side and built-in media player at the other hand side.

Are both devices using the same profile?

No, different profile. Bluray Player uses „Panasonic BD Player“. Because of more aspect options there is a workaround for that.

For the TV try the Panasonic 2010 profile and let me know if that makes a difference.

2010er profile really works better. The picture has now the right aspect in Aspect2-mode. But this profile transcodes every video file. Even those which could be played natively by the TV.
Witch line of profile.xml should I copy from 2010er to 2013er profile. To get 2013er work like 2010er but only for unplayable files?

The only way to do subtitles when transcoding is to burn them into the transcoded file. This will force transcoding for any file containing subtitles.

I don‘t want serviio to burn in and transcode subtitles at any time. Most of my video files play nativly on all deviced and need no trancoding.


The aspect issue seems to have something to do with mpeg2-ts playback on my TV and BD Player.
Can‘t I choose another target codec in profile.xml? Why is mpeg2-ts chosen in Panasonic-profiles?
And can‘t serviio just transcode the video stream and let audio and subtitles untouched (just mux them to the new video stream)?
<<

DenyAll

DLNA master

Posts: 2153

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Jan 29, 2018 8:56 am

Re: Transcoding: Aspect ratio and subtitles

2010er profile really works better. The picture has now the right aspect in Aspect2-mode. But this profile transcodes every video file.
Yep, using the 2010 Profile was for a test only- tells me what you need to do. So, based on this test you need to change the Panasonic 2013 Profile:

  • Edit the file config\profiles.xml using your favourite text editor (Notepad++ recommended)
  • find the line
    <Matches container="*" vCodec="h265" />
    in the "Panasonic Viera (2013)" profile.
  • Move it to be just above the line that reads:
    <Matches container="*" vCodec="h263" />
    This line appears earlier in the profile.
Save file and restart your PC.

I will try and get the Panasonic 2013 profile changed for the next release of Serviio. You will still need to change the Aspect to Aspect-2 mode but your TV should remember the setting.

The aspect issue seems to have something to do with mpeg2-ts playback on my TV and BD Player.
Yes its related to mpeg-2ts container. There are quite a few topics on this in the forum.
Can‘t I choose another target codec in profile.xml? Why is mpeg2-ts chosen in Panasonic-profiles?
There are only four container types (2 of which are mpeg-2) that support transcoding on the fly: asf, mpeg (MPEG2PS), mpegts (MPEG2TS), applehttp (HLS). asf supports limited codecs, and HLS is not supported by Panasonic (at least not on my TV). I have also tried most codecs within mpeg-2 containers to see if that helped - it doesn't.

The question I never quite got to the bottom of is why Serviio transcodes >16:9 video to 4:3 anamorphic video (with top and bottom pads). I know that a lot of DVD's were done this way, but not sure of the rationale for doing it when streaming padded video. This was before my time - suspect it was to gain compatibility with as many devices as possible.
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Mon Jan 29, 2018 7:38 pm

Re: Transcoding: Aspect ratio and subtitles

DenyAll wrote:
  • Edit the file config\profiles.xml using your favourite text editor (Notepad++ recommended)
  • find the line
    <Matches container="*" vCodec="h265" />
    in the "Panasonic Viera (2013)" profile.
  • Move it to be just above the line that reads:
    <Matches container="*" vCodec="h263" />
    This line appears earlier in the profile.
Save file and restart your PC.


This works fine with aspect2, thanks.
And thanks for explaination about on the fly transcoding, too. Does make sense, but the issue with the 4:3 anamorphic video ist annoying. But can be also an issue of devices (e. g. Panasonic TVs and other) and not of ffmpeg or serviio. As to see in the first post the DAR of transcoded file is 12:5 as original source file.

Any advice for change something in profiles.xml to map subtitle streams in target mpeg2-container?
<<

DenyAll

DLNA master

Posts: 2153

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Jan 30, 2018 9:41 pm

Re: Transcoding: Aspect ratio and subtitles

Any advice for change something in profiles.xml to map subtitle streams in target mpeg2-container?
Cannot be done - you’re only option within Serviio when transcoding is to burn them in. I’m not sure it’s even technically possible when transcoding on the fly to map subtitle streams, or whether they’d be playable in the resultant file.

May do some playing on the weekend - if it’s even possible it would still have to be developed into Serviio if accepted by the developer.
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Wed Jan 31, 2018 8:05 pm

Re: Transcoding: Aspect ratio and subtitles

That would be a great feature, if it’s possible.
Please give feedback if that works and is accepted by the developers.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Sun Feb 11, 2018 9:11 am

Re: Transcoding: Aspect ratio and subtitles

Some news here?
If it's not possible to get the subtitle-stream in the transcoded file, i would like to reconfigure hardsubs in profiles.xml.

If I add something to <RequiredFor>-Tag the log says, that this attribute is not supported in that tag.
Is there any chance to get hardsubs configured to burn in subtitle just in videos with e. g. vCodec=h265 ?

My case is to enable hardsubs just for videos that will be transcoded anyway, but not for videos that could be played native.
<<

DenyAll

DLNA master

Posts: 2153

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Feb 12, 2018 9:49 am

Re: Transcoding: Aspect ratio and subtitles

No news. I haven't had a chance to test but even when done (and assuming it works which I have my doubts) it will go into a request that then gets prioritised by the developer. Once it gets to the top of that queue it then has to get developed into Serviio and tested.
If I add something to <RequiredFor>-Tag the log says, that this attribute is not supported in that tag.
Is there any chance to get hardsubs configured to burn in subtitle just in videos with e. g. vCodec=h265 ?
No.
The RequiredFor attribute is very limited. It only supports a container type eg. <RequiredFor container="matroska"/>. It doesnt support matching on vcodec.
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.9 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

loeffelpan

Serviio newbie

Posts: 19

Joined: Sun Mar 13, 2016 12:35 pm

Post Mon Feb 12, 2018 5:49 pm

Re: Transcoding: Aspect ratio and subtitles

DenyAll wrote:The RequiredFor attribute is very limited. It only supports a container type eg. <RequiredFor container="matroska"/>. It doesnt support matching on vcodec.

Was just an idea for a workaround.

DenyAll wrote:No news. I haven't had a chance to test but even when done (and assuming it works which I have my doubts) it will go into a request that then gets prioritised by the developer. Once it gets to the top of that queue it then has to get developed into Serviio and tested.

A ticket (bitbucket?) for following the implementation (if possible) would be nice.

Return to Panasonic

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.