FAQ  •  Register  •  Login

DAR setting

<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 23, 2014 10:20 pm

Re: DAR setting

No you can't. but you can set DAR, which would possibly use the scale filter too, if needed.
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Sun Feb 02, 2014 8:32 pm

Re: DAR setting

i tried this (to change aspect ratio from 4:3 into 16:9)

<Video targetContainer="applehttp" targetVCodec="h264" maxVBitrate="1024" forceVTranscoding="true" targetACodec="aac" forceStereo="true" aBitrate="192" DAR="16:9" maxHeight="320">

but no help, it is transcoded from 720x576 into 534x320 (resolution changed) but aspect on tv stays 4:3 :(
I see, we can't change DAR setting, 16:9 or nothing?
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Feb 03, 2014 8:29 am

Re: DAR setting

Iveky wrote:but no help, it is transcoded from 720x576 into 534x320 (resolution changed) but aspect on tv stays 4:3 :(


720x576 is not a 16:9 display ratio, so you will have some black bars after resizing (you should have something like 1024x576 with 2x152 black bars, but you're right, 534x320 is not a 16:9 ratio (1.66 instead of 1.77)

Could you provide the ffmpeg command line used during the transcoding, then retry locally and check the ffmpeg log ?
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Mon Feb 03, 2014 9:43 am

Re: DAR setting

will play tonite again with it.

Sent from my LG-E440 using Tapatalk 2
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Mon Feb 03, 2014 5:48 pm

Re: DAR setting

converting out of serviio, using command line, these both commands produce proper 16:9 aspect ratio from origin 720x576 video which is 4x3 aspect:

ffmpeg -i "http://5.149.64.186:8081" -vcodec libx264 -qscale 0 -strict -2 -aspect 16:9 test169.mp4
(this one above produce 720x576 in 16:9)
ffmpeg -i "http://5.149.64.186:8081" -vcodec libx264 -strict -2 -q 20 -vf "scale=522:320,setdar=16:9" -aspect 16:9 test320.mp4
(this one above produce 522x320 in 16:9)


but using serviio (this profile line below), it stays 4x3:

<Video targetContainer="applehttp" targetVCodec="h264" maxVBitrate="1024" forceVTranscoding="true" targetACodec="aac" forceStereo="true" aBitrate="192" DAR="16:9" maxHeight="320">

converted video is fine, proper codec, proper resolution: 522x320 but aspect ratio is wrong, 4:3 instead of requested 16:9

where I can see ffmpeg log?
what try next illlico?


this is info about origin stream:
nput #0, mpegts, from 'http://5.149.64.186:8081':
Duration: N/A, start: 47143.700267, bitrate: 128 kb/s
Program 1
Stream #0:0[0x44](): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s
Stream #0:1[0x45](): Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x576 [SAR 12:11 DAR 15:11], 25 fps, 25 tbr, 90k tbn, 50 tbc
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Feb 03, 2014 7:06 pm

Re: DAR setting

Iveky wrote: where I can see ffmpeg log?
what try next illlico?

Enable detailed logging and check the ffmpeg command line used. (../serviio/log/serviio.log)
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Mon Feb 03, 2014 9:14 pm

Re: DAR setting

here it is, detailed log:
as I see from those lines, it sets wrong aspect ratio, i want 16:9 it sets 4:3 ?!?
why?



2014-02-03 22:05:27,265 DEBUG [AbstractTranscodingDeliveryEngine] No suitable transcoding job exists yet, start one for client 'Identifier=192.168.1.100, Profile=LG Android Phone'
2014-02-03 22:05:27,266 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: http://5.149.64.186:8081
2014-02-03 22:05:27,266 DEBUG [ProcessExecutor] Starting ffmpeg -analyzeduration 10000000 -threads 2 -i http://5.149.64.186:8081 -y -threads 2 -c:v libx264 -profile:v baseline -level 3 -preset veryfast -b:v 1024k -maxrate:v 1024k -bufsize:v 1024k -crf 10 -vf scale=400:320,pad=522:320:61:0:black,setdar=4:3,setsar=12:11 -r 25 -g 15 -bsf:v h264_mp4toannexb -flags -global_header -c:a aac -strict experimental -b:a 192k -ac 2 -map 0:1 -map 0:0 -sn -f segment -segment_time 10 -segment_format mpegts -segment_list_flags live -segment_list /tmp/Serviio/transcoding-temp-1000000460004768-LGandroid-ORIGINAL.stf/playlist.m3u8 -segment_list_size 10 /tmp/Serviio/transcoding-temp-1000000460004768-LGandroid-ORIGINAL.stf/segment%05d.ts
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Feb 03, 2014 10:32 pm

Re: DAR setting

Am monitoring this thread hoping a better solution emerges (remuxing to m2ts is almost becoming obsolete as most source material is 16:9 or above, so you end up having to transcode).

To answer your question the reason Serviio sets to 4:3 when you add the DAR="16:9" command is that Serviio is attempting to overcome the limitation of the ts container. Given that the aspect ratio isn't stored in the container and that some (all?) renderers will render it as 4:3 irrespective of the fact that the video stream is 16:9, Serviio doesn't attempt to set the DAR to 16:9 (as this approach doesn't work... so far).

Rather Serviio compensates by creating an anamorphic video, setting the DAR to 4:3 and then padding it top and bottom if needed (for higher than 16:9 ratios). Your TV then stretches the 4:3 back to full screen giving the "illusion" of a 16:9 or higher aspect ratio. The frame is still really 4:3 (your TV will report it as such), but it is stretched and may have padding top and bottom. Clear as mud? :) Its counter intuitive I know, but is a clever solution to overcome the limitations of the container. Unfortunately it relies on transcoding.

I'm going to play with ffmpeg and see if anything emerges to allow a remuxed video (rather than transcoded) to retain the original aspect ratio (in a ts container), but I do fear it may be a losing battle.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Tue Feb 04, 2014 5:16 am

Re: DAR setting

some tv will stretch it left right, BUT samsung E wont do it unless I press.option on remote (6-7 buttons to do it, and then is stretched wide) and vertical stretching is DISABLED for DLNA sources... so I cant zoom letterboxed film from internet streams that are 4x3. i need to do it on server side.

in serviio profiles, only option for DAR is 16x9, enable also other options so users can play with it, now if i set DAR as 4x3 or anything else then 16:9 serviio wont start... and add also scale options so we can also clip picture as we wish, all from profile?

Sent from my LG-E440 using Tapatalk 2
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Feb 04, 2014 1:15 pm

Re: DAR setting

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>
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Wed Feb 05, 2014 8:44 am

Re: DAR setting

Few years ago, I made lots of test with my Sony Bravia TV because we had problems with the display aspect ratio during mpeg2video transcoding.
viewtopic.php?f=11&t=2956

- I confirm that ffmpeg aspect ratio option (-aspect) had no effect during remuxing, only during mpeg2 transcoding (never test with h264 transcoding).
- I also confirm that Sony bravia TV had strange behaviour with DAR, in fact we had to finish the transcoding process with a setdar=4:3, then TV's screen was adjusted to 16:3 aspect ratio...I never understand, but it works for Sony device.
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Wed Feb 05, 2014 8:56 am

Re: DAR setting

it isn't important container... anyone that will convert 4:3 picture into 16:9 is ok... but I have none, all I get now is change in resolution but aspect stays 4:3
:(
Previous

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 86 guests

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