Wrote this bash script to analyse MKVs check what the metadata says the FPS is and check it against the actual file. If there is a mismatch the metadata is updated.
The coding is probably terrible as I don’t know much about writing bash scripts so worked it all out last night from Google and Stack Overflow, but either way might be helpful for someone. You need ffmpeg, mediainfo and mkvtoolnix installed. Just pass through as an argument the file path you want to look through (e.g. /TV Shows/Show/Season/*.mkv).
It shouldn’t cause any major issues I don’t think but obviously use this at your own risk!
for f in "$@"; do
MetaData=`ffprobe -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate "$f"`
MetaDataSum=`echo "scale=3;$MetaData" | bc`
Actual=`mediainfo "--Inform=Video;%FrameRate%;" "$f"`
DefaultDurationFloat=`echo "scale=9;(1/$Actual)*1000000000" | bc`
DefaultDuration=`echo "scale=0;$DefaultDurationFloat/1" | bc`
if [ $MetaDataSum != $Actual ]
echo NO MATCH
mkvpropedit "$f" --edit track:v1 --set default-duration=$DefaultDuration
My only other thought on what could be causing this is there a chance the unit is overheating? It is currently in a cabinet (which has active cooling), with a lot of other hardware.
However I would have expected, if it was overheating that it’d do it more consistently once it starts doing it. For example after it went black yesterday it didn’t occur again whilst I watched the rest of the show.
That is weird, just checking all of the files from that season and looks as though that is a one off. In terms of Plex I use PlexKodiConnect to link my Plex server and OSMC. I disabled the plugin to keep my logs clean though. It is also set up for direct play so there shouldn’t be any transcoding happening.
typing that line will change part of how h.264 files are processed. It will take effect only until you reboot. You will have to either enter that line any time you reboot, or add it to rc.local. He is just looking for you to test the effect and report back.
My rc.local file now looks like this - is that right?
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# By default this script does nothing.
echo 1 | sudo tee /sys/module/amvdec_h264/parameters/error_recovery_mode