Setting the DAR of a video stream?

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

Setting the DAR of a video stream?

pisymbol .
I have a pipeline that crops a video to a resolution (3040x3040) but I noticed that
when I play back the video the DAR is listed as the original native resolution of the camera.

Is there a way to fix/set the display aspect ratio in the final MKV?

So the streams leading to the muxer look like this:

,, ! video/x-h264, width=(int)3040, height=(int)3040, stream-format=(string)byte-stream ! h264parse ! muxer.video_0 ! matroskamux name=muxer streamable=true ! filesink name=fsink location=whatevermp4

I want the DAR to be 1:1 when the video is played back etc.

-aps

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

Re: Setting the DAR of a video stream?

pisymbol .


On Thu, May 14, 2020 at 10:23 AM Alexander Sack <[hidden email]> wrote:
I have a pipeline that crops a video to a resolution (3040x3040) but I noticed that
when I play back the video the DAR is listed as the original native resolution of the camera.

Is there a way to fix/set the display aspect ratio in the final MKV?

So the streams leading to the muxer look like this:

,, ! video/x-h264, width=(int)3040, height=(int)3040, stream-format=(string)byte-stream ! h264parse ! muxer.video_0 ! matroskamux name=muxer streamable=true ! filesink name=fsink location=whatevermp4

I want the DAR to be 1:1 when the video is played back etc.


I should qualify this a bit - all of the recording, cropping, and encoding is being done in hardware. So GStreamer doesn't have real access to the frame until after the encoder which is the pipeline sample you see above.

I looked at "aspectratiocrop" but that seems to deal with raw frames pre-encode.

But the fact is the frames out of the encoder are 3040x3040 but the stream created still has a DAR of the original camera resolution and I really want it to be 1:1.

Thanks!

-aps

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

Re: Setting the DAR of a video stream?

Nicolas Dufresne-5
In reply to this post by pisymbol .
Le jeudi 14 mai 2020 à 10:23 -0400, Alexander Sack a écrit :
I have a pipeline that crops a video to a resolution (3040x3040) but I noticed that
when I play back the video the DAR is listed as the original native resolution of the camera.

DAR is a property of your display HW, we use PAR, or pixel-aspect-ratio= in caps.


Is there a way to fix/set the display aspect ratio in the final MKV?

So the streams leading to the muxer look like this:

,, ! video/x-h264, width=(int)3040, height=(int)3040, stream-format=(string)byte-stream ! h264parse ! muxer.video_0 ! matroskamux name=muxer streamable=true ! filesink name=fsink location=whatevermp4

I want the DAR to be 1:1 when the video is played back etc.

You can try and add the missing field with a acapssetter element, would be capssetter caps=video/x-h264,pixel-aspect-ratio=1/1


1-aps
_______________________________________________
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: Setting the DAR of a video stream?

pisymbol .


On Thu, May 14, 2020 at 11:54 AM Nicolas Dufresne <[hidden email]> wrote:
Le jeudi 14 mai 2020 à 10:23 -0400, Alexander Sack a écrit :
I have a pipeline that crops a video to a resolution (3040x3040) but I noticed that
when I play back the video the DAR is listed as the original native resolution of the camera.

DAR is a property of your display HW, we use PAR, or pixel-aspect-ratio= in caps.


Is there a way to fix/set the display aspect ratio in the final MKV?

So the streams leading to the muxer look like this:

,, ! video/x-h264, width=(int)3040, height=(int)3040, stream-format=(string)byte-stream ! h264parse ! muxer.video_0 ! matroskamux name=muxer streamable=true ! filesink name=fsink location=whatevermp4

I want the DAR to be 1:1 when the video is played back etc.

You can try and add the missing field with a acapssetter element, would be capssetter caps=video/x-h264,pixel-aspect-ratio=1/1

Nicolas, as always, thank you, I will try!

(I feel better it wasn't too obvious)

-aps

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