Bug 362211 - Wrong display ratio in Project monitor
Summary: Wrong display ratio in Project monitor
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Rendering & Export (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL: http://i.imgur.com/tmXp7iT.png
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-25 00:01 UTC by Fahad Alduraibi
Modified: 2016-04-25 23:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Original video playing in VLC with correct ratio (394.38 KB, image/png)
2016-04-25 00:09 UTC, Fahad Alduraibi
Details
Wrong ratio in Kdenlive (181.78 KB, image/png)
2016-04-25 00:11 UTC, Fahad Alduraibi
Details
Project Settings (85.60 KB, image/png)
2016-04-25 19:51 UTC, Fahad Alduraibi
Details
Project file with the ratio issue (18.93 KB, application/x-kdenlive)
2016-04-25 21:44 UTC, Fahad Alduraibi
Details
The original project file with the ratio issue (18.93 KB, application/x-kdenlive)
2016-04-25 22:01 UTC, Fahad Alduraibi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fahad Alduraibi 2016-04-25 00:01:40 UTC
I have a screencast from a phone in portrait mode, and I set up hte project to the correct dimensions (768x1280), however, in Project Monitor it shows it squeezed as if it was in landscape instead. (see screenshot in URL)  

Reproducible: Always

Steps to Reproduce:
1. Get a video that is in portrait mode
2. Play it

Actual Results:  
project monitor will play it in landscape mode instead

Expected Results:  
Project monitor show display the video following the project dimensions/ratio instead of some fixed ratio.
Comment 1 Fahad Alduraibi 2016-04-25 00:09:34 UTC
Created attachment 98572 [details]
Original video playing in VLC with correct ratio
Comment 2 Fahad Alduraibi 2016-04-25 00:11:18 UTC
Created attachment 98573 [details]
Wrong ratio in Kdenlive
Comment 3 Jean-Baptiste Mardelle 2016-04-25 05:59:57 UTC
This might be related to the pixel/display aspect ratio that you set in the project settings. Can you post a screenshot of the project settings dialog, and also the result of the following command:

ffmpeg -i myclip.mp4

Using your phone clip as input?
Comment 4 Fahad Alduraibi 2016-04-25 19:50:48 UTC
I have attached the screenshot for the project settings and I am using a custom profile which I have created to handle this display size. The rendered output is correct. It is just a problem with the Project Monitor, Clip Monitor and also the video timeline.

And here is the output from the ffmpeg command
-------------------------
$ ffmpeg -i video.mp4                                                                                        
ffmpeg version 2.8.6 Copyright (c) 2000-2016 the FFmpeg developers                                                                       
  built with gcc 5.1.1 (GCC) 20150618 (Red Hat 5.1.1-4)                                                                                  
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-01-19 21:22:38
  Duration: 00:01:06.20, start: 0.000000, bitrate: 3796 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 768x1280, 3792 kb/s, SAR 1:1 DAR 3:5, 33.14 fps, 90k tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2016-01-19 21:22:38
      handler_name    : VideoHandle
At least one output file must be specified
-------------------------
Comment 5 Fahad Alduraibi 2016-04-25 19:51:12 UTC
Created attachment 98593 [details]
Project Settings
Comment 6 Jean-Baptiste Mardelle 2016-04-25 20:06:36 UTC
Hmm, everything seems ok. Can you try playing the clip with MLT's command line player ?
From a terminal:

melt yourclip.mp4

And with FFmpeg:

ffplay yourclip.mp4

Does the clip play correctly with both commands ? If it does I will need a sample clip...
Comment 7 Fahad Alduraibi 2016-04-25 21:12:49 UTC
Yes it plays fine with all players.

I uploaded the original file to my google drive (~30MB)

https://drive.google.com/file/d/0B5g4fSdL2nL2d2Nwbm9aOWN4X2M/view?usp=sharing
(Tell me when you are done to remove the sharing - nothing private but for cleaning up)
Comment 8 Jean-Baptiste Mardelle 2016-04-25 21:30:23 UTC
I downloaded the video, you can delete it. It works perfectly for me. 
Can you create a new Kdenlive project with your profile, add your clip in the project and save the project, then attach the .kdenlive project file here ?
Comment 9 Fahad Alduraibi 2016-04-25 21:40:26 UTC
It works fine when I created a new project! 
Then it must be caused by the an upgrade, since I pulled the recent changes for kdenlive and when I started the projected it told me that it had upgraded the project file. The upgraded project worked fine (expect for the problem I mentioned) so I didn't think of that as the reason!
Comment 10 Fahad Alduraibi 2016-04-25 21:43:54 UTC
The problem is in the project file profile tag, the ratio is not correct!
----------
 <profile width="768" frame_rate_den="1000" height="1280" display_aspect_num="16" display_aspect_den="9" frame_rate_num="30000" colorspace="709" sample_aspect_den="1" description="Phone HD" progressive="1" sample_aspect_num="1"/>
----------
It was set like this when I created the project before since it is my default settings (1080 16:9) but I changed it in the profile settings and that didn't get reflected in the project file.

Changing 16:9 to 3:5 fixed the project monitor

I will also attach my project file in case it was of any use to you.
Comment 11 Fahad Alduraibi 2016-04-25 21:44:36 UTC
Created attachment 98596 [details]
Project file with the ratio issue
Comment 12 Fahad Alduraibi 2016-04-25 22:00:00 UTC
Comment on attachment 98596 [details]
Project file with the ratio issue

Sorry, this is the fixed file (where i change 16 to 3 and 9 to 5)
Comment 13 Fahad Alduraibi 2016-04-25 22:01:31 UTC
Created attachment 98597 [details]
The original project file with the ratio issue
Comment 14 Jean-Baptiste Mardelle 2016-04-25 22:28:43 UTC
Thanks. I just fixed a problem in Kdenlive that was maybe related: when editing the project profile for current project, the changes were not applied. You needed to select another profile, then come back to the correct one to have it applied. Might be what caused your problem. Should work correctly now
Comment 15 Fahad Alduraibi 2016-04-25 23:50:37 UTC
Actually this is exactly the case, I changed the profile while working on the project. Thanks for the fix. 

Will change the bug to fixed instead of invalid.