FAQ  •  Register  •  Login

Transcoding aspect ratio issue

<<

henryjfry

Serviio newbie

Posts: 4

Joined: Sun May 11, 2014 10:08 am

Post Sat May 20, 2017 11:07 am

Transcoding aspect ratio issue

Hey

Ive just installed serviio in order to be able to transcode files with dts as my tv doesnt support this. Managed to find profiles which will work but whenever it transcodes the audio it seems to mess up the aspect ratio of the videos.

2017-05-20 11:48:30,201 DEBUG [ProcessExecutor] Starting ffmpeg -fflags +genpts -threads 0 -i /mnt/Torrent/Fantastic.Beasts.and.Where.to.Find.Them.2016.1080p.BluRay.x264.DTS-JYK/Fantastic.Beasts.and.Where.to.Find.Them.2016.1080p.BluRay.x264.DTS-JYK.mkv -y -threads 0 -c:v copy -bsf:v h264_mp4toannexb -c:a:0 ac3 -b:a:0 384k -ac:a:0 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-6270f02a95c0a65041f313830b4a5a3c.stf

This is the ffmpeg command from detailed logging (i think) and its displaying in full 16:9 with no black bars (and possibly chopping some video off the side to achieve this, not sure) it looks stretched full screen anyway.

I have seen other stuff on the forum about this, solutions seem to relate to changing the ffmpeg command line but im not sure how to achieve that on linux. It may also be something to do with the profile. I got a profile which should be pretty close to actuality with only small modifications (i have a panasonic viera DX700 4K tv)

<Profile id="viera2015" name="Panasonic Viera (2015)" extendsProfileId="1">
<!-- Panasonic Viera 2015 Models:
LED/LCD's: CX800, CX850
Supports native streaming of mainstream MP4, MKV and XVid files -->
<Detection>
<UPnPSearch>
<FriendlyName>.*DX*(0|5)0_Series.*</FriendlyName>
<Manufacturer>Panasonic</Manufacturer>
</UPnPSearch>
</Detection>
<ContentDirectoryMessageBuilder>org.serviio.upnp.service.contentdirectory.PacketVideoDLNAMessageBuilder</ContentDirectoryMessageBuilder>
<Transcoding>
<!-- Transcode h265 videos and a few others to mpegts with ac3 audio -->
<Video targetContainer="mpegts" targetVCodec="mpeg2video" DAR="16:9" targetACodec="ac3" aBitrate="384" forceInheritance="true">
<!-- Matches container="*" vCodec="h265" / --> <!-- Uncomment this line if H265 is not supported natively -->
<Matches container="*" vCodec="h264" profile="high_10" />
<Matches container="mp4" vCodec="mjpeg" />
<Matches container="mpeg" vCodec="mpeg1video" />
<Matches container="matroska" vCodec="vp8" />
<Matches container="matroska" vCodec="vp9" />
<Matches container="ogg" />
<Matches container="rm" />
</Video>
<!-- remux DTS/DTS-HD/TrueHD to AC3 -->
<Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384" forceInheritance="true">
<Matches container="*" aCodec="dca" /> <!-- Uncomment this line if DTS is not supported natively -->
<Matches container="*" aCodec="dts-hd" />
<Matches container="*" aCodec="truehd" />
</Video>
<!-- Transcode DivX (XVid is supported) -->
<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" aBitrate="384">
<Matches container="avi" vCodec="mpeg4" vFourCC="div3,div4,div5,divx,dm4v,dx50" />
<Matches container="avi" vCodec="msmpeg4" vFourCC="div3,div4,div5,divx,dm4v,dx50" />
<Matches container="avi" vCodec="dvvideo" />
</Video>
<!-- unsupported audio will be transcoded into lpcm audio -->
<Audio targetContainer="lpcm" forceInheritance="true">
<Matches container="ogg" />
<Matches container="asf" />
<Matches container="adts" />
<Matches container="wv" />
<Matches container="mpc" />
<Matches container="ape" />
<Matches container="dsf" />
</Audio>
</Transcoding>
<AudioTrackRemux>
<Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384">
<Matches container="*" vCodec="h264" />
<Matches container="*" vCodec="mpeg2video" />
<Matches container="*" vCodec="mpeg1video" />
<Matches container="*" vCodec="mpeg4" />
<Matches container="*" vCodec="msmpeg4" />
</Video>
</AudioTrackRemux>
<GenericTranscoding>
<Video targetContainer="mpegts" targetVCodec="mpeg2video" DAR="16:9" targetACodec="ac3" aBitrate="384" />
</GenericTranscoding>
<Subtitles>
<SoftSubs mime-type="text/srt" character-encoding="utf-8" />
</Subtitles>
<ThumbnailsResolution>HD</ThumbnailsResolution>
</Profile>

With or without DAR="16:9" it doesnt seem to make any difference so im almost certain its something to do with ffmpeg.

Could i put a wrapper or something for ffmpeg to modify how it out puts the mpegts?
Or maybe use a different transport stream?

Any insight would be greatly appreciated.
<<

DenyAll

DLNA master

Posts: 2065

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sun May 21, 2017 8:34 am

Re: Transcoding aspect ratio issue

This is a limitation of how the Panasonic TV (and a lot of other devices) work with video once you mux it into a mpegts container. Two solutions:

  1. Remove the lines
      </Video>
      <!-- remux DTS/DTS-HD/TrueHD to AC3 -->
      <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384" forceInheritance="true">
    from the profile. Save the profiles.xml file and restart your PC. This will force the video to be transcoded (rather than re-muxed as was the previous case) and the aspect ratio corrected.
    .
  2. Use a tool such as XMedia Recode to create an AC-3 audio track from your DTS audio and make sure it's the first audio track. This will then enable you to play the file natively (without re-encoding the video). Retaining the DTS audio track (as the second audio) will enable you to play DTS in the future if you get a device that supports it.
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.

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 3 guests

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