Gstreamer Video Flip and Save Flipped video
Nicolas Dufresne
nicolas.dufresne at gmail.com
Tue May 24 18:33:40 UTC 2016
Le mardi 24 mai 2016 à 09:14 -0700, tgn1 a écrit :
> Well, I got this pipeline working just fine, but I wanted to make it
> save the
> file with the flipped video. It seems its only possible to flip the
> test
> video, but is there any way I could save the file with the rotation?
>
> Here's my pipeline:
> gst-launch-1.0 -e v4l2src device=/dev/video1 \ ! video/x-h264,
> width=800,
> height=448, framerate=30/1 ! tee name=t \ t. ! queue ! h264parse !
> avdec_h264 ! videoconvert ! videoflip method=2 ! xvimagesink
> sync=false \ t.
> ! queue ! h264parse ! matroskamux \ ! filesink
> location='raw.dual.mkv'
> sync=false
If you want to save an matroska file with the video flipped in a way
all players will support, you need to transcode. So basically you will
have to decode before the tee, flip, and then inside the branch with
filesink, re-encode.
Another approach would be to inject the GST_TAG_IMAGE_ORIENTATION. See
taginject element for how to inject such a tag.
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-g
ood-plugins/html/gst-plugins-good-plugins-taginject.html
Then decoding this file with recent totem should do the right thing. If
you build your own player, you need to use videoflip method=8. The
method 8 means automatic, it will automatically choose a flip direction
base on the image-orientation tag. Generic player may ignore this tag.
Nicolas
More information about the gstreamer-devel
mailing list