Zend certified PHP/Magento developer

Force media info rewrite with ffmpeg

I have a bunch of video files created by MKVToolnix that have a Codec ID like: V_MS/VFW/FOURCC / HEVC.

I tried to run this:

ffmpeg -i test.mkv -c copy test.avi

to turn it to avi and then this:

ffmpeg -fflags +genpts -i test.avi -c:v copy -c:a copy test2.mkv

to convert it back to mkv

Now the file has the correct Codec ID: V_MPEGH/ISO/HEVC

I need this because while test.mkv will not play on Kodi, test2.mkv will do.

Hence the question: can I do it in just one passage, i.e. force the fixing of the codec ID keeping all the streams and metadata of the original file?

Thanks to everyone,

Fabio