FAQ  •  Register  •  Login

DAR setting

<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Thu Jan 03, 2013 9:08 am

DAR setting

Hi,

I am playing with the DAR value because I have an old sony2010 and some files it stretches unnaturally. It seems that DAR woks only for mpeg files but not for mkv ... at least I do not see an effect.

I wonder why 16:9 is the only allowed value? From ffmpeg manual any floating point or x:y ratio should be possible. Any chances that this gets allowed in the profile? Or are there any reasons I am not aware of?

thx
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 03, 2013 10:02 am

Re: DAR setting

The only reason is that most TVs are 16:9.

It will only be invoked when you transcode, not when you remux.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Thu Jan 03, 2013 2:21 pm

Re: DAR setting

Force Video Transcoding is enabled. I think the Problem is more my 2y old Bravia. So I wanted to play with more DAR values.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 03, 2013 4:51 pm

Re: DAR setting

froce video transcoding only means that if the source video codec is the same as the target on it'll still re-encode it, not just copy. You have to set targetVCodec for a file to be trancoded.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Thu Jan 03, 2013 5:22 pm

Re: DAR setting

I think I did so:
<Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="17000" targetACodec="ac3" aBitrate="192" DAR="16:9" forceInheritance="true" forceVTranscoding="true">
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 03, 2013 5:25 pm

Re: DAR setting

so if you check the log it should produce a 16:9 resolution video (with black bars) using the scale filter.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Thu Jan 03, 2013 6:18 pm

Re: DAR setting

Thats the command line in the log:

  Code:
ffmpeg -threads auto -i /../mnt/raid5/media/Videos/@.Series/My Vids/test.mpeg -y -copyts -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -r 25 -g 15 -c:a copy -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-3456-sony2010-ORIGINAL.stf


I also checked the stf file - no bars to see.
Also, the input file is already 16:9:

  Code:
Input #0, mpegts, from 'test.mpeg':
  Duration: 00:20:49.76, start: 1.400000, bitrate: 3723 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), s16, 448 kb/s


My TV is stretching the movie horizontally - so thats why I thought about applying a different DAR to work around this "bug".

thx
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Thu Jan 03, 2013 7:53 pm

Re: DAR setting

With DAR=16:9 setting:
ffmpeg line:
  Code:
ffmpeg -threads auto -i /../mnt/raid5/media/Videos/test.avi -y -copyts -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=854:480:107:0:black,setdar=4:3 -r 25 -g 15 -c:a ac3 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-1651-sony2010-ORIGINAL.stf


transcoded file:
  Code:
Input #0, mpegts, from '/tmp/Serviio/transcoding-temp-1651-sony2010-ORIGINAL.stf':
  Duration: 00:02:30.04, start: 1.400000, bitrate: 4144 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 854x480 [SAR 320:427 DAR 4:3], 17000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, s16, 192 kb/s


Without DAR:
ffmpeg line:
  Code:
ffmpeg -threads auto -i /../mnt/raid5/media/Videos/test.avi -y -copyts -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -r 25 -g 15 -c:a ac3 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-1651-sony2010-ORIGINAL.stf


transcoded file:
  Code:
Input #0, mpegts, from '/tmp/Serviio/transcoding-temp-1651-sony2010-ORIGINAL.stf':
  Duration: 00:12:57.20, start: 1.400000, bitrate: 3786 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 17000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, s16, 192 kb/s


So in real it changes the SAR value, not the DAR ... (is this intended?)

-----------------------------------------------

I got another video with the following parameters:
  Code:
Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1920x1072 [SAR 1:1 DAR 120:67]


Which gets transcoded to (DAR=16:9):
  Code:
... -vf pad=1920:1080:0:4:black,setdar=4:3 -r 30000/1001 -g 15 ...

  Code:
Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080 [SAR 3:4 DAR 4:3]


The transcoded video gets displayed correctly on my TV.

Another source:
  Code:
Stream #0:1[0x101]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]


The transcoded file has the same SAR/DAR values.
The file gets horizontally stretched on my TV (bars on top and bottom).

------------------------------------------------

It looks to me that DAR is doing what I was looking for, only that it does not do it for already 16:9 files ...
Any ideas?

thx
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Jan 03, 2013 9:02 pm

Re: DAR setting

why would it do it for already 16:9 files?
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Fri Jan 04, 2013 9:15 am

Re: DAR setting

I understood the DAR setting exists because some TVs show a wrong aspect ratio ... and thats how to fix it.
Nevermind ... I think I'll have to find another solution.

thx
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Jan 04, 2013 11:02 am

Re: DAR setting

yes, but what this does it just resizes the frame to fit into a 16:9 box.
<<

ziggyball

Serviio newbie

Posts: 1

Joined: Sun Jan 06, 2013 2:11 pm

Post Sun Jan 06, 2013 2:17 pm

Re: DAR setting

Hi tombert,

Did you find a solution to this?

I have a 2010 Sony and I am still having aspect ratio problems with Serviio v1+

Transcoded 16:9 files are squashed horizontally...
Mkv's of widescreen DVDs are displayed squashed vertically.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Sun Jan 06, 2013 4:21 pm

Re: DAR setting

Only a workaround:
Go to Settings->Screen there you have a slider called "Vertical Size". This allows to stretch/shrink the picture ... its a bit better but not a final solution.
We have to blame Sony for this though ... my BD Player shows the correct aspect ratio.
<<

pdneri

Streaming enthusiast

Posts: 29

Joined: Tue Dec 27, 2011 9:25 pm

Location: Italy

Post Sun Jan 13, 2013 5:17 pm

Re: DAR setting

zip wrote:It will only be invoked when you transcode, not when you remux.


What if I want to correct aspect ratio of a remuxed video?
(hopefully without transconding)

Thanks
Davide
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jan 14, 2013 12:52 am

Re: DAR setting

if you can find the ffmpeg command that works for your TV, let me know. For my experiments, mpegts will not store DAR, or some renderers won't read its value.
<<

pdneri

Streaming enthusiast

Posts: 29

Joined: Tue Dec 27, 2011 9:25 pm

Location: Italy

Post Fri Jan 03, 2014 11:19 am

Re: DAR setting

Hi Zip,

is your last sentence still true now?
I've seen last comment here:
https://trac.ffmpeg.org/ticket/2046
which is:
Changed 7 months ago by cehoyos
◾Component changed from undetermined to FFmpeg
◾Resolution set to fixed
◾Status changed from new to closed
The original request was implemented by Nicolas George in b1cc12d
The direct264 patchset looks very interesting nonetheless.


I am particularly interested in solving this issue because I currently need to transcode (instead of remux), due to the 16:9 effect, and this also implies that I cannot pause/rewind/forward while watching. :cry:
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Jan 21, 2014 5:32 pm

Re: DAR setting

In their example they are remuxing to mp4, not mpegts (which it looks like doesn't store the dar in the container level).

You could try to run the ffmpeg command manually using the latest ffmpeg, and then add to Serviio to be played natively, to see if it makes any difference for you.
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Tue Jan 21, 2014 5:58 pm

Re: DAR setting

is it possible to add something like this:
(this is how I converted some 4:3 films to 16:9)

ffmpeg -i film.avi -vcodec libx264 -strict -2 -q 20 -vf "scale=1024:576,setdar=16:9" -aspect 16:9 output1024.mp4

important part is: -vf "scale=1024:576,setdar=16:9"

by adding scale as option from serviio, we could solve all 16:9 problems that can appear.
or will you add it in future?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jan 22, 2014 1:03 pm

Re: DAR setting

scale is already in place, but using different values. you can see that when using the DAR transcoding option (but that is not for remuxing)
<<

Iveky

User avatar

DLNA master

Posts: 329

Joined: Thu Jan 31, 2013 5:17 pm

Location: Split, Croatia

Post Wed Jan 22, 2014 2:25 pm

Re: DAR setting

i searched throu profiles, none use width x height, only maxheight is implemented?
i think, forcing ffmpeg to transcode into specific WxH, we cant set it through profile?

Sent from my LG-E440 using Tapatalk 2
Next

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 77 guests

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