Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera Rotation and Flipping / passing args to ffmpeg #41

Open
SealedJoy opened this issue Oct 15, 2021 · 1 comment
Open

Camera Rotation and Flipping / passing args to ffmpeg #41

SealedJoy opened this issue Oct 15, 2021 · 1 comment

Comments

@SealedJoy
Copy link

Currently using v4l2-tools (specifically v4l2compress and v4l2rtspserver)
Its working for the most part but i am struggling to find a way to rotate the video feed (ideally in the v4l2compress program?) sadly my driver contains no such controls, so i cannot seem to set image rotation through the driver which leaves me with only software as option. The ffmpeg args: ' -vf "transpose=dir=1" ' seems to work okay, but i would like to do this through v4l2compress is this possible? otherwise afaik i will need to make 2 dummy devices and perform reencoding again.

Full command below:

ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x1080 -i /dev/video0 -pix_fmt yuyv422 -vf "transpose=dir=1" -f v4l2 /dev/video5

@mpromonet
Copy link
Owner

Hi SealedJoy,

I guess this should be possible in the libyuv conversion before encoding for instance in https://github.com/mpromonet/v4l2tools/blob/master/include/x264encoder.h#L90

				libyuv::ConvertToI420((const uint8*)buffer, rsize,
						m_pic_in.img.plane[0], m_width,
						m_pic_in.img.plane[1], (m_width+1)/2,
						m_pic_in.img.plane[2], (m_width+1)/2,
						0, 0,
						m_width, m_height,
						m_width, m_height,
						libyuv::kRotate0, m_informat);

Best Regards,
Michel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants