Recording gray16_le mkv files, but not playable with VLC

Hi all,

I am recording from a camera in gray 16-bit format, passing into matroska and filesink, but the file is ending up with a fourcc that VLC does not recognise. Matroskamux uses fourcc Y1[0][16], but it seems VLC’s only accepted fourcc for 16-bit grayscale is “GRFL”. I have posted on the VideoLAN forums, but perhaps someone on this side has some advice about my Gstreamer pipeline.

The pipeline has an odd aspect: the camera declares its pixel format as YUY2, I suppose for compatibility, but the pixels are actually 16 bit big-endian. Here’s my pipeline:

mfvideosrc device-index=0
    ! video/x-raw,format=YUY2,width=1288,height=1024,framerate=**differs between devices**
    ! videorate ! video/x-raw,format=YUY2,width=1288,height=1024,framerate=30/1
    ! tee name=t
        t.  ! queue name=q_appsink flush-on-eos=true max-size-buffers=2 leaky=downstream
            ! appsink name=appsink emit-signals=true max-buffers=1 drop=true
        t.  ! queue name=q_file_branch flush-on-eos=true leaky=downstream
                max-size-buffers=100 max-size-bytes=250000000 max-size-time=3500000000
            ! capssetter replace=true caps="video/x-raw,format=GRAY16_BE,width=1288,height=1024,framerate=30/1"
            ! videoconvert ! video/x-raw,format=GRAY16_LE,width=1288,height=1024,framerate=30/1
            ! matroskamux
            ! filesink name=filesink location=...

I’m currently using videorate for another quirk, but should be removing it. I’m leaving it in in case it affects this issue.

Any advice would be appreciated. It seems that 16-bit grayscale might be common in scientific devices, but not widely supported in the wider media community.