video rescaling

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

video rescaling

Patrick Welche
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

the file has the desired resolution, but gst-play-1.0 out.mp4 displays a
window of the original dimensions.

What am I missing?


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

David Ing
Try using a muxer (mp4mux) after x264enc.

On Sat, Jun 6, 2020, 7:14 AM Patrick Welche <[hidden email]> wrote:
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

the file has the desired resolution, but gst-play-1.0 out.mp4 displays a
window of the original dimensions.

What am I missing?


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Patrick Welche
On Sat, Jun 06, 2020 at 07:58:58AM -0700, David Ing wrote:

> On Sat, Jun 6, 2020, 7:14 AM Patrick Welche <[hidden email]> wrote:
>
> > 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
> >
> > the file has the desired resolution, but gst-play-1.0 out.mp4 displays a
> > window of the original dimensions.
> >
> > What am I missing?
>
> Try using a muxer (mp4mux) after x264enc.

I should have updated my note to say I tried that as soon as I hit
send but with the same result...

gst-launch-1.0 -e \
filesrc location=small.ogv ! decodebin ! video/x-raw ! videoconvert \
! videoscale ! video/x-raw,width=50 ! x264enc ! mp4mux ! filesink location=out.mp4

creates a file which gst-play-1.0 displays in a window of the original
width, but with only 50 stretched pixels inside.


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Nicolas Dufresne-5
In reply to this post by Patrick Welche


Le sam. 6 juin 2020 11 h 15, Patrick Welche <[hidden email]> 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.

the file has the desired resolution, but gst-play-1.0 out.mp4 displays a
window of the original dimensions.

What am I missing?


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Patrick Welche
On Sat, Jun 06, 2020 at 12:54:25PM -0400, Nicolas Dufresne wrote:

> Le sam. 6 juin 2020 11 h 15, Patrick Welche <[hidden email]> 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Ian Davidson
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?

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 <[hidden email]> 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
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Patrick Welche
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 <[hidden email]> 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
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Ian Davidson
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 <[hidden email]> 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
>>> [hidden email]
>>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> _______________________________________________
>> gstreamer-devel mailing list
>> [hidden email]
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Patrick Welche
On Sun, Jun 07, 2020 at 04:05:36PM +0100, Ian Davidson wrote:
> Many formats like multiples of 4 - so maybe a width of 401 could throw it. 
> Try 404.

Thanks! Even (n%2=0) works!

Patrick

>
> 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 <[hidden email]> 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
> > > > [hidden email]
> > > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > _______________________________________________
> > > gstreamer-devel mailing list
> > > [hidden email]
> > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Nicolas Dufresne-5
In reply to this post by Patrick Welche
Le dimanche 07 juin 2020 à 14:34 +0100, Patrick Welche a écrit :

> On Sat, Jun 06, 2020 at 12:54:25PM -0400, Nicolas Dufresne wrote:
> > Le sam. 6 juin 2020 11 h 15, Patrick Welche <[hidden email]> 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?

No, it means x264enc does not support off height. We could wake this
limitation in software, it's just not implemented.

>
>
> Cheers,
>
> Patrick
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video rescaling

Nicolas Dufresne-5
Le dimanche 07 juin 2020 à 16:07 -0400, Nicolas Dufresne a écrit :

> Le dimanche 07 juin 2020 à 14:34 +0100, Patrick Welche a écrit :
> > On Sat, Jun 06, 2020 at 12:54:25PM -0400, Nicolas Dufresne wrote:
> > > Le sam. 6 juin 2020 11 h 15, Patrick Welche <[hidden email]> 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?
>
> No, it means x264enc does not support off height. We could wake this
> limitation in software, it's just not implemented.

Correction, "off" -> "odd", sorry.

>
> >
> > Cheers,
> >
> > Patrick
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel