video rescaling
Ian Davidson
id012c3076 at blueyonder.co.uk
Sun Jun 7 15:05:36 UTC 2020
Many formats like multiples of 4 - so maybe a width of 401 could throw
it. Try 404.
On 07/06/2020 15:29, Patrick Welche wrote:
> On Sun, Jun 07, 2020 at 02:53:05PM +0100, Ian Davidson wrote:
>> Is the use of
>>
>> pixel-aspect-ration
>>
>> in your examples (with 'n' at the end) a typo in your posting or a typo in
>> your testing?
> A typo in the testing :-/ Thank you!
>
> The question about ratios still stands though:
>
> video/x-raw,width=400,height=300,pixel-aspect-ratio=1/1 -> 400x300
> video/x-raw,width=401,height=300,pixel-aspect-ratio=1/1 -> FAIL
>
> (original = 560x320)
>
> How do you know what is allowed? (500x320 OK, 501x320 fail)
>
> Cheers,
>
> Patrick
>
>> On 07/06/2020 14:34, Patrick Welche wrote:
>>> On Sat, Jun 06, 2020 at 12:54:25PM -0400, Nicolas Dufresne wrote:
>>>> Le sam. 6 juin 2020 11 h 15, Patrick Welche <prlw1 at cam.ac.uk> a écrit :
>>>>
>>>>> Given a sample video, e.g.,
>>>>> http://techslides.com/demos/sample-videos/small.ogv
>>>>> and following the videoscale documentation,
>>>>>
>>>>> gst-launch-1.0 -e \
>>>>> filesrc location=small.ogv ! decodebin ! video/x-raw ! videoconvert \
>>>>> ! videoscale ! video/x-raw,width=50 ! ximagesink
>>>>>
>>>>> does exactly what one expects. If I channel the output to a file
>>>>>
>>>>> gst-launch-1.0 -e \
>>>>> filesrc location=small.ogv ! decodebin ! video/x-raw ! videoconvert \
>>>>> ! videoscale ! video/x-raw,width=50 ! x264enc ! filesink location=out.mp4
>>>>>
>>>> Unlike ximagesink, x264enc supports non square pixels. As it's zero copy,
>>>> videoscale will prefer scaling the pixel-aspect-ratio field instead.
>>>>
>>>> Set pixel-aspect-ratio=1/1 in your filter if you want to force scaling.
>>> Thanks! It seems there is more to it though...
>>>
>>> From the videoscale documentation, I had the impression that I
>>> could throw any old height & width in and hope that what came out
>>> was whatever is specified in the filter after the videoscale element,
>>> and if it is ridiculous, I may get a black border (add-borders=true),
>>> but it would still be the desired size.
>>>
>>>
>>> AFAICT that sample small.ogv is 560x320. If I try I get
>>>
>>> video/x-raw,width=400,height=300,pixel-aspect-ration=1/1 525x300
>>> video/x-raw,height=300,width=400,pixel-aspect-ration=1/1 525x300
>>> video/x-raw,height=300,width=400 525x300
>>> video/x-raw,height=300 525x300
>>>
>>> which suggests height wins, and 560*300/320 = 525
>>>
>>> If I try
>>>
>>> video/x-raw,height=301
>>>
>>> I get "Can not initialize x264 encoder"
>>>
>>> Does this mean videoscale only scales integer ratios of height, or
>>> is there more to it?
>>>
>>>
>>> Cheers,
>>>
>>> Patrick
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list