0

i am trying to convert a raw video into lossless video that is playable by VLC or QuickTime.

The structure of the input video:

  • pixels are 8-bit grayscale

  • frame size is 1280x1024 pixels

  • frames start from offset XXX bytes from the start of the file

  • each subsequent frame starts with an offset YYY bytes (that is, there is a gap of YYY bytes between frames). It is possible that XXX = YYY but I want to know a more general solution, if achievable.

  • number of frames is not known in advance

I start with:

ffmpeg7 -f rawvideo -pixel_format gray -video_size 1280x1024 -r 1 -i aaa.raw -r 120 -vcodec av1 aaa.mp4

However, this does not accommodate the frame offsets and I end up with garbage.

How do I account for the frame offsets within the file?

I would also appreciate suggestions for lossless codecs and containers, other than AV1 and mp4.

Thank you for your time.

as a follow up, what would be a the arguments for ffplay?

4
  • Is YYY related to the width or height value? Give some concrete numbers.
    – Gyan
    Commented Jul 4 at 4:25
  • YYY is not related to H or W. In files I am dealing with at the moment it's 512 bytes. It can be any other value. It's just the size of the frame metadata.
    – yesh
    Commented Jul 4 at 17:28
  • I looked up and FFV1 is a good lossless codec for MKV container (I see 4x compression). I can also use "-crf 0" or "-qp 0" when encoding with libx264 or libx265 into MP4 containers. None of those, however, can be played with QuickTime. Just FYI.
    – yesh
    Commented Jul 6 at 21:45
  • I went the programming route and wrote a Python program for the conversion.
    – yesh
    Commented Jul 6 at 21:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.