First, some explanation on why the "-vf aspect=4:3"stopped working. WMS 1.50.x uses a new version of FFMPEG, and in this new version a lot of parameters and filters have been renamed, and one of them was the "aspect" filter which was renamed to "setdar". But, simply changing the old string to "-vf setdar=4:3" in the transcoding profile doesn't work, as there are other filters set by the profile in the FFMPEG chain that overwrite it.
After reading about similar problems with other FFMPEG based products and analyzing the solutions they've found, I came to the following command that would generate a video my Bravia would render with the correct aspect ratio:
Code: Select all
-probesize 7000000 -analyzeduration 10000000 -i "G:\Videos\movie.avi" -f dvd -vf "scale=1280:-1","pad=1280:720:(ow-iw)/2:(oh-ih)/2:black","setdar=4:3" -vhook "wmssubt.dll G:\Videos\movie.srt,Arial Narrow,36,0,16777215,0,4,0,0,0,1280,720,23.976,0,0,0,por,0,1,0,14" -vcodec mpeg2video -b:v 25000000 -aspect 4:3 -copyts -pix_fmt yuv420p -threads 2 -acodec ac3 -ab 448000 -ar 48000 -ac 6 -vstreamid 1 -astreamid 2.
Code: Select all
const
csFFMpegVideoParams1 = ' -f dvd -vf "scale=1280:-1","pad=1280:720:(ow-iw)/2:(oh-ih)/2:black","setdar=4:3"';
csFFMpegVideoParams2 = ' -vcodec mpeg2video -b:v 25000000 -aspect 4:3 -copyts -pix_fmt yuv420p';
csFFMpegAudioParams = ' -acodec ac3 -ab 448000 -ar 48000 -ac 6';
function GetMultiThreadSupported(const aVideoCodec: string): Boolean;
begin
if SameText(aVideoCodec, 'WMV') then
Result := False
else
Result := True
end;
var
iAudioStreamNo: Integer;
sParams, sAudioStreamID: string;
begin
iAudioStreamNo := mpAudioStreamNo;
sParams := WmsTranscodingInputParams;
sParams := sParams + csFFMPegVideoParams1;
sParams := sParams + WmsTranscodingSubTitleParams(1280, 720, 1280, 720, 0, 0);
sParams := sParams + csFFMPegVideoParams2;
if (cfgTranscodingThreadCount > 1) and GetMultiThreadSupported(cfgTranscodingVideoCodec) then
sParams := sParams + ' -threads ' + IntToStr(cfgTranscodingThreadCount);
sParams := sParams + csFFMpegAudioParams;
sParams := sParams + WmsTranscodingMapParams(iAudioStreamNo);
TranscodingParams := sParams;
end.
When I have more time I'll try to improve this script/profile. And if anyone has any suggestions, please post them here.
Hope this solution works for you too.
Best regards
Richard