After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691827 - videoscale: display aspect ratio is not maintained
videoscale: display aspect ratio is not maintained
Status: RESOLVED DUPLICATE of bug 696019
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.36
Other Linux
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-16 05:48 UTC by pavan goyal
Modified: 2013-03-21 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to modify videoscale element to correct aspect ratio (3.83 KB, patch)
2013-01-16 05:54 UTC, pavan goyal
none Details | Review
sample jpeg image with resolution 2048*2048 (521.65 KB, image/jpeg)
2013-01-17 10:51 UTC, pavan goyal
  Details
log attached with command GST_DEBUG=*:5 gst-launch filesrc location=test_2048*2048.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! autovideosink 2>debug.log (988.39 KB, text/plain)
2013-01-17 13:06 UTC, pavan goyal
  Details
debug log 2 (975.98 KB, text/plain)
2013-01-17 13:07 UTC, pavan goyal
  Details
debug log 3 (637.39 KB, text/plain)
2013-01-17 13:08 UTC, pavan goyal
  Details
debug log 4 (538.87 KB, text/plain)
2013-01-17 13:08 UTC, pavan goyal
  Details

Description pavan goyal 2013-01-16 05:48:18 UTC
Hello,
       i am using gstreamer version 0.10.36. My Display plane has size 1920*1080. when i display a picture with resolution 1920*1920, on display i see a picture with resolution 1920*1080 but it should be 1080*1080. 
i observe that videoscale returns give size 1920*1080 to my displaysink instead of 1080*1080.
add_border property is also TRUE.
is it a know issue with gstreamer-base-plugin?

Thanks & Regards,
Pavan Goyal
Comment 1 pavan goyal 2013-01-16 05:54:02 UTC
Created attachment 233570 [details] [review]
patch to modify videoscale element to correct aspect ratio

attached patch in videoscale element maintains the aspect ratio. please let me know if its a correct solution or how can it be proceeded.

Thanks & Regards,
Pavan Goyal
Comment 2 Sebastian Dröge (slomo) 2013-01-16 10:46:26 UTC
Can you provide a testcase for this, e.g. a gst-launch line?
Comment 3 pavan goyal 2013-01-17 10:49:14 UTC
Hello Sebastian,
                 like a below pipeline can be used,

gst-launch filesrc location=colorbar.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! freeze ! autovideosink

i am using a custom displaysink as per my hardware. my display plane size is 1920 * 1080.

so when in my displaysink, 

get_caps is called, i return

          gst_structure_set (structure,
              "width", GST_TYPE_INT_RANGE, 1, 1920,
              "height", GST_TYPE_INT_RANGE, 1, 1080,
              "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
        }

so in set caps, for an image of resolution say 1920*1920, i get width=1920 and height 1080 but i should get width 1080 and height 1080.


Thanks & Regards,
Pavan Goyal

(In reply to comment #2)
> Can you provide a testcase for this, e.g. a gst-launch line?
Comment 4 pavan goyal 2013-01-17 10:51:42 UTC
Created attachment 233661 [details]
sample jpeg image with resolution 2048*2048

i have also attached an sample image.
Comment 5 Tim-Philipp Müller 2013-01-17 12:05:27 UTC
Could you also provide the (gzip/bzip2-ed) debug log output for:

 $ GST_DEBUG=*:5  gst-launch filesrc location=colorbar.jpg ! jpegdec ! ffmpegcolorspace !
videoscale ! autovideosink 2>dbg.log

?
Comment 6 pavan goyal 2013-01-17 13:06:56 UTC
Created attachment 233666 [details]
log attached with command GST_DEBUG=*:5  gst-launch filesrc location=test_2048*2048.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! autovideosink 2>debug.log

log is attached which was captured with command 

GST_DEBUG=*:5  gst-launch filesrc location=test_2048*2048.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! autovideosink 2>debug.log

using attached image.


Regards,
Pavan Goyal
Comment 7 pavan goyal 2013-01-17 13:07:33 UTC
Created attachment 233667 [details]
debug log 2
Comment 8 pavan goyal 2013-01-17 13:08:05 UTC
Created attachment 233668 [details]
debug log 3
Comment 9 pavan goyal 2013-01-17 13:08:31 UTC
Created attachment 233669 [details]
debug log 4
Comment 10 pavan goyal 2013-01-17 13:09:14 UTC
log was huge (more than 3000 kb) so has been broken into parts since bugzilla does not allow more than 1000 kb.
Comment 11 Tim-Philipp Müller 2013-01-17 13:19:14 UTC
Yes, that's why I suggested you gzip it ;)  Thanks for the log.
Comment 12 Tim-Philipp Müller 2013-01-17 13:36:39 UTC
Unfortunately the debug log doesn't print out the caps, because you are using a libc that doesn't support printf extensions.

But anyway, what are the full caps you get in set_caps at the sink? I'm guessing you're getting a non-1/1 pixel-aspect-ratio then?

Which would be fine, since your sink's get_caps does not contain any pixel-aspect-ratio field, so claims to be able to handle any (e.g. because it can scale itself). If that's what's actually happening, it's not clear to me that it is preferable to rescale horizontally as well to maintain the aspect ratio then, vs. just passing it through.
Comment 13 Tim-Philipp Müller 2013-01-17 13:41:12 UTC
$ gst-launch-0.10 filesrc location= /home/tpm/samples/misc/691827-2048x2048.jpg ! jpegdec ! videoscale ! appsink caps='video/x-raw-yuv,width=[1,1920],height=[1,1080],framerate=[0/1,100/1]' -v
/GstPipeline:pipeline0/GstAppSink:appsink0.GstPad:sink: caps = video/x-raw-yuv, width=(int)1920, height=(int)1080, framerate=(fraction)0/1, format=(fourcc)I420, pixel-aspect-ratio=(fraction)9/16

$ gst-launch-0.10 filesrc location= /home/tpm/samples/misc/691827-2048x2048.jpg ! jpegdec ! videoscale ! appsink caps='video/x-raw-yuv,width=[1,1920],height=[1,1080],framerate=[0/1,100/1],pixel-aspect-ratio=1/1' -v
/GstPipeline:pipeline0/GstAppSink:appsink0.GstPad:sink: caps = video/x-raw-yuv, width=(int)1080, height=(int)1080, framerate=(fraction)0/1, pixel-aspect-ratio=(fraction)1/1, format=(fourcc)I420
Comment 14 pavan goyal 2013-01-17 16:42:17 UTC
Hello Philipp,
              Thanks for your analysis. it realy helps.

yes, without setting any pixel-aspect-ratio, i get same string as you mentioned.

root@PAVAN-SDK2:~# gst-launch filesrc location=test-2048x2048.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! freeze ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
gst_st_v4l2_object_get_caps_info-525:video/x-raw-rgb, bpp=(int)32, depth=(int)32, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, endianness=(int)4321, width=(int)1920, height=(int)1080, framerate=(fraction)0/1, pixel-aspect-ratio=(fraction)9/16;
  
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 5201580732 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@PAVAN-SDK2:~# 

but if i set pixel-aspect-ratio to 1/1, i get width=1 and height=1980 not 1080 & 1080 as you got.

with,    
     if (gst_st_v4l2_formats[i].dimensions) {
          gst_structure_set (structure,
              "width", GST_TYPE_INT_RANGE, 1, MAX_ALLOC_WIDTH,
              "height", GST_TYPE_INT_RANGE, 1, MAX_ALLOC_HEIGHT,
              "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
        }

root@PAVAN-SDK2:~# gst-launch filesrc location=test-2048x2048.jpg ! jpegdec ! ffmpegcolorspace ! videoscale ! freeze ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
gst_st_v4l2_object_get_caps_info-525:video/x-raw-rgb, bpp=(int)32, depth=(int)32, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, endianness=(int)4321, width=(int)1, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)0/1;
  
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 34845658113 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

am i missing something!!

Thanks & Regards,
Pavan Goyal
Comment 15 pavan goyal 2013-01-17 16:44:11 UTC
Hello Philipp,
              Thanks for your analysis. it realy helps.

yes, without setting any pixel-aspect-ratio, i get same string as you
mentioned.

root@PAVAN-SDK2:~# gst-launch filesrc location=test-2048x2048.jpg ! jpegdec !
ffmpegcolorspace ! videoscale ! freeze ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
gst_st_v4l2_object_get_caps_info-525:video/x-raw-rgb, bpp=(int)32,
depth=(int)32, red_mask=(int)-16777216, green_mask=(int)16711680,
blue_mask=(int)65280, alpha_mask=(int)255, endianness=(int)4321,
width=(int)1920, height=(int)1080, framerate=(fraction)0/1,
pixel-aspect-ratio=(fraction)9/16;

Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 5201580732 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@PAVAN-SDK2:~# 

but if i set pixel-aspect-ratio to 1/1, i get width=1 and height=1980 not 1080
& 1080 as you got.

with,    
     if (gst_st_v4l2_formats[i].dimensions) {
          gst_structure_set (structure,
              "width", GST_TYPE_INT_RANGE, 1, MAX_ALLOC_WIDTH,
              "height", GST_TYPE_INT_RANGE, 1, MAX_ALLOC_HEIGHT,
              "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
              "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
        }

root@PAVAN-SDK2:~# gst-launch filesrc location=test-2048x2048.jpg ! jpegdec !
ffmpegcolorspace ! videoscale ! freeze ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
gst_st_v4l2_object_get_caps_info-525:video/x-raw-rgb, bpp=(int)32,
depth=(int)32, red_mask=(int)-16777216, green_mask=(int)16711680,
blue_mask=(int)65280, alpha_mask=(int)255, endianness=(int)4321, width=(int)1,
height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)0/1;

Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 34845658113 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

am i missing something!!

Thanks & Regards,
Pavan Goyal
Comment 16 pavan goyal 2013-03-04 13:45:53 UTC
with the suggestion provided by Phillip in comment 12, i am able to achieve desired display aspect ration.

this issue can be closed.

Thanks & Regards,
Pavan Goyal
Comment 17 Tim-Philipp Müller 2013-03-21 10:24:04 UTC
I think this is fixed in git master now.

*** This bug has been marked as a duplicate of bug 696019 ***