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