openastroproject / openastro

Open Astro Project
GNU General Public License v3.0
91 stars 27 forks source link

SER saving bug for YUYV recording #518

Open vladtcvs opened 2 years ago

vladtcvs commented 2 years ago

Steps to reproduce:

  1. (optional) Select crop area
  2. Select YUYV mode for v4l2 camera
  3. Select save to SER
  4. Record video

And oaCapture creates SER file with resolution, equal to specified in crop (or original resolution of video, if no crop)

But YUYV format require some sort of conversion, so if you just crop RAW YUYV frame to, for example, 200x200 pixels, after conversion to (Y, Cb, Cr) or (R, G, B) the resulting image will be cut, and only top half of the image will be present.

Here is an example of 200x200 cropped image, created by oaCapture, when saving to SER

frame

And after decoding it, it transforms to example

which has size 200x100.

vladtcvs commented 2 years ago

Here is the full original SER file, generated by oaCapture

https://drive.google.com/file/d/186xBa5X_qTlwjbz2YihYjc94k_m7HHIE/view?usp=sharing

vladtcvs commented 2 years ago

Also, if I save with YUYV format with ffmpeg, like

ffmpeg -f v4l2 -input_format yuyv422 -i /dev/video2 -c:v copy test3.yuv

in this case saved RAW YUV images have height twice of specified in camera options, and after decoding them to (Y,Cb,Cr) and (R,G,B) I have full size image