Erroneous parameters generated when using DAR=16:9
The ffmpeg for the file is
Input #0, mpegts, from 'http://77.51.249.16:8032':
Duration: N/A, start: 48526.849867, bitrate: 96 kb/s
Program 1
Stream #0:0[0x44](rus): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, mono,
s16, 96 kb/s
Stream #0:1[0x45]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 704
x576 [SAR 12:11 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
To accomplish this I set the following rule in the mediabrowser online transcoding profile. I set aBitrate to 256 in order to verify when the rule was being applied.
<Video targetContainer="flv" targetVCodec="flv" targetACodec="mp3" DAR="16:9" forceStereo="true" aBitrate="256" aSamplerate="44100">
<Matches container="mpegts" vCodec="h264" profile="high"/>
</Video>
I expected the resulting generated ffmpeg command to contain the following -vf parameter which will cause the mediabrowser to play it as 1024x576 =16:9 as I show later.
-vf setdar=16:9,scale=iw*sar:ih,setsar=1
Instead the generated Serviio ffmpeg command is:
C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i http://77.51.249.16:8032 -y -copyts -c:v flv -sameq -vf scale=1024:838,setsar=1,pad=1024:576:0:131:black,setdar=4:3 -r 25 -g 15 -c:a libmp3lame -b:a 256k -ar 44100 -ac 1 -map 0:1 -map 0:0 -sn -f flv pipe:
which opens the correct 1024x576 mediabrowser window but the transcode fails with return code 1. When run from the command line it also fails with the following errors:
C:\Users\John>ffmpeg -i http://77.51.249.16:8032 -y -copyts -c:v flv -sameq -vf
scale=1024:819,setsar=1,pad=1024:576:0:121:black,setdar=4:3 -r 25 -g 15 -c:a lib
mp3lame -b:a 256k -ar 44100 -ac 1 -map 0:1 -map 0:0 -sn -f flv D:/flv.flv
ffmpeg version N-42368-gbf53863 Copyright (c) 2000-2012 the FFmpeg developers
...
Input #0, mpegts, from 'http://77.51.249.16:8032':
Duration: N/A, start: 9881.758711, bitrate: 94 kb/s
Program 1
Stream #0:0[0x44](rus): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, mono,
s16, 94 kb/s
Stream #0:1[0x45]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 704
x576 [SAR 12:11 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
[graph 0 input from stream 0:1 @ 054F27C0] w:704 h:576 pixfmt:yuv420p tb:1/90000
fr:25/1 sar:12/11 sws_param:flags=2
[output stream 0:0 @ 01335360] No opaque field provided
[Parsed_scale_0 @ 054E6B20] w:704 h:576 fmt:yuv420p sar:12/11 -> w:1024 h:819 fm
t:yuv420p sar:273/256 flags:0x4
[Parsed_pad_2 @ 05500200] Input area 0:120:1024:939 not within the padded area 0
:0:1024:576 or zero-sized
[Parsed_setsar_1 @ 012B4200] Failed to configure input pad on Parsed_pad_2
Error opening filters!
Using the command ffplay -i http://77.51.249.16:8032 -vf setdar=16:9,scale=iw*sar:ih,setsar=1 plays it correctly as 1024x576 16:9 per the following ffplay/ffmpeg output, and also by using my ffmpeg.bat to force the generated ffmpeg command to the expected -vf setdar=16:9,scale=iw*sar:ih,setsar=1 and remove the erroneous ",pad=1024:576:0:121:black,setdar=4:3" string results in the following Serviio command which allows the mediabrowser to open with scale 1024:576 and play the video 16:9 as expected.
[quoteInput #0, mpegts, from 'http://77.51.249.16:8032':
Duration: N/A, start: 14843.303478, bitrate: 83 kb/s
Program 1
Stream #0:0[0x44](rus): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, mono,
s16, 83 kb/s
Stream #0:1[0x45]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 704
x576 [SAR 12:11 DAR 4:3], 25.62 fps, 25 tbr, 90k tbn, 50 tbc
[src @ 0688af80] w:704 h:576 pixfmt:yuv420p tb:1/90000 sar:12/11 sws_param:
[Parsed_setdar_0 @ 03edd320] a:16/9
[Parsed_setsar_2 @ 03e3ff00] a:1/1
[Parsed_setdar_0 @ 03edd320] w:704 h:576 -> dar:16/9 sar:16/11
[Parsed_scale_1 @ 063d8880] w:704 h:576 fmt:yuv420p sar:16/11 -> w:1024 h:576 fm
t:yuv420p sar:1/1 flags:0x4[/quote]
ffmpeg.exe" -i http://77.51.249.16:8032 -y -copyts -c:v flv -sameq -vf setdar=16:9,scale=iw*sar:ih,setsar=1 -r 25 -g 15 -c:a libmp3lame -b:a 256k -ar 44100 -ac 1 -map 0:1 -map 0:0 -sn -f flv pipe:
So I conclude that the generated ffmpeg command for DAR=16:9 is incorrect. While the mediabrowser window size is the correct, the ffmpeg -vf values are incorrect and the pad parameters need to be removed.
Please advise if this warrants a ticket.