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!
#!/bin/bash
for f in "$@"; do
printf "$f\n"
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"`
echo $MetaDataSum
echo $Actual
DefaultDurationFloat=`echo "scale=9;(1/$Actual)*1000000000" | bc`
DefaultDuration=`echo "scale=0;$DefaultDurationFloat/1" | bc`
echo $DefaultDuration
if [ $MetaDataSum != $Actual ]
then
echo NO MATCH
mkvpropedit "$f" --edit track:v1 --set default-duration=$DefaultDuration
else
echo MATCH
fi
printf "\n"
done
I am still getting black screens when watching media. I don’t think it is always an FPS issue that we were seeing earlier in the thread.
I thought it might be a cable issue, but have swapped a known good cable and it is still happening. Got the log from this evening but can’t see anything obvious in there:
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.
Scratching my head over why you keep getting this:
Oct 20 21:38:23 osmc kernel: codec:vdec1 video changed to 3840 x 2160 60 fps clk->667MHZ
Your desktop is 1080p, the video you are playing is 1280x720 (although the filename implies it’s 1080p). The word Plex appears also so is that converting the stream, and if so how?
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.
It was a H264 file, the majority of my library will be H264 but I can’t say for sure it only occurs with H264 files as it isn’t something I have checked before now.
Sure, can run that - I’m not with the Vero now is that going to output something I need to share, or is that a potential fix?
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?
#!/bin/sh -e
#
# rc.local
#
# 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
# bits.
#
# By default this script does nothing.
echo 1 | sudo tee /sys/module/amvdec_h264/parameters/error_recovery_mode
exit 0