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 689278 - [videoscale] Letter boxing bug
[videoscale] Letter boxing bug
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-29 13:51 UTC by Baby octopus
Modified: 2012-11-29 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Baby octopus 2012-11-29 13:51:19 UTC
Border gets added with proper aspect ratio only when pixel-aspect-ratio is set to 1 in filter caps. 

I would want to scale an image with letter box for maintaining display aspect ratio. I tried to upscale a 352x288 image to 640x360 by running the below mentioned command. I'm not satisfied with the result. Input is http://i49.tinypic.com/os51r6.png but the result is http://i47.tinypic.com/25ksm6s.png  

gst-launch-1.0 -v filesrc location=/mnt/temp/cif_test.yuv ! videoparse width=352 height=288 ! videoscale add-borders=1  ! video/x-raw,width=640,height=360  !  filesink location=/mnt/temp/out.yuv 

My log looked like 

Setting pipeline to PAUSED ... 
Pipeline is PREROLLING ... 
/GstPipeline:pipeline0/GstVideoParse:videoparse0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstVideoScale:videoscale0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)11/16, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)11/16, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)11/16, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)11/16, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
/GstPipeline:pipeline0/GstVideoScale:videoscale0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)25/1 
Pipeline is PREROLLED ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
Got EOS from element "pipeline0". 
Execution ended after 3051953093 ns. 
Setting pipeline to PAUSED ... 
Setting pipeline to READY ... 
Setting pipeline to NULL ... 
Freeing pipeline ... 

This doesn't work:
gst-launch-1.0 videotestsrc ! video/x-raw,width=352,height=288 ! videoscale add-borders=1 ! video/x-raw,width=640,height=360 ! xvimagesink 

This works: 
gst-launch-1.0 videotestsrc ! video/x-raw,width=352,height=288 ! videoscale add-borders=1 ! video/x-raw,width=640,height=360,pixel-aspect-ratio=1/1 ! xvimagesink
Comment 1 Sebastian Dröge (slomo) 2012-11-29 14:01:52 UTC
If you don't set a pixel-aspect-ratio after videoscale it assumes that downstream can handle all pixel-aspect-ratios and scales the video to the full size and passes a corresponding pixel-aspect-ratio in the caps downstream.