I don't want to hijack this thread but to let you know, I did some testing using the ffmpeg command:
ffmpeg.exe -fflags +genpts -threads 4 -i srcfile.mp4 -y -threads 4 -c:v copy -bsf:v h264_mp4toannexb -aspect xxx -c:a copy -map 0:0 -map 0:1 -sn -f mpegts destfile.mpg
Other than the bit in red, this is the command Serviio remuxes with. I used a source MP4 file with a 2.4:1 aspect ratio. Where it states
-aspect xxx I did three cases:
-aspect 16:9,
-aspect 2.4, and also removed the command.
In all cases it had no effect - the TV displayed the resultant video as a 16:9 frame, and stretches the video vertically to fill the screen. ps. I also tested with a mpeg-ps container, and with quotes around the parameter, both made no difference.
This tends to confirm that either the mpegts container doesn't store the aspect ratio in the container, or the TV is ignoring it (and the video stream aspect ratio, which was always 2.4:1). It also tells me my understanding (as per previous post) was wrong - a remuxed file is played in a 16:9, not 4:3 as I stated above. It does then beg the question - why does the DAR="16:9" command in Serviio transcode video to 4:3 anamorphic... wouldn't it have been better (and easier) to transcode to 16:9 and simply pad the top and bottom if the ratio is > 16:9 (eg. a 2.4:1 video would get transcoded to a 16:9 frame, with pad top and bottom). This would also overcome Iveky's issue I believe.
Given that the DAR="16:9" command appears to be only needed where the AR is greater than 16:9 I am beginning to think that perhaps a new matching criteria would be advantageous, eg:
<Matches container="*" vCodec="h264" DARGreaterThan="16:9" />
This could be then be used to transcode video
only where the DAR is higher than 16:9 (eg: 2.4:1), using a 16:9 frame and add padding top and bottom. Where the video is DAR=4:3 or DAR=16:9, then simple remuxing could be used (I haven't tested the 4:3 case, but remuxing works fine for 16:9). In the Panasonic profile (and many others) this would be added as an initial test in the same way we test for high level h264 profiles, eg:
- Code:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" DAR="16:9" targetACodec="ac3" forceInheritance="true">
<Matches container="*" vCodec="h264" profile="high" levelGreaterThan="4.1" />
<Matches container="*" vCodec="h264" profile="main" levelGreaterThan="4.1" />
<Matches container="*" vCodec="h264" DARGreaterThan="16:9"/>
</Video>