happycube / ld-decode

Software defined LaserDisc decoder
GNU General Public License v3.0
312 stars 83 forks source link

ld-chroma-encoder json output has wrong sample rate for line locked PAL output. #898

Open ali1234 opened 3 months ago

ali1234 commented 3 months ago

To reproduce:

  1. Get some image and resize and convert it to RGB48 with ffmpeg:

    ffmpeg -i in.png -vf scale=928:576 -f rawvideo -pix_fmt rgb48 out.raw

  2. Convert to TBC with and without -c option:

    tools/ld-chroma-decoder/encoder/ld-chroma-encoder out.raw out.cvbs-ll tools/ld-chroma-decoder/encoder/ld-chroma-encoder -c out.raw out.cvbs-sl

Now out.cvbs-sl.json contains:

    "isSubcarrierLocked":true,
    "sampleRate":17734475

As far as I am aware, this is correct.

But out.cvbs-ll.json contains:

    "isSubcarrierLocked":false,
    "sampleRate":17734475

My understanding is that the sample rate should be 17734375, exactly 100Hz less.

I have not yet checked whether the actual output samples are correct in either case.