Hi guys, Got fedup with tvdb.com not having images for aired episodes…so decided to fix it.
I’m new to coding so please forgive if I appear very stupid:slight_smile:
I’ve spent past days trying to get sonarr to run post processing script which would use FFmpeg to generate a poster for the episode.
I can use a batch D:/Image.bat file to make ffmpeg generate the required image using the following command in batch file:
ffmpeg -ss 100 -i c:/test/mytest_episode_file.mkv -vf "scale='if(gt(dar,400/225),225*dar,400)':'if(gt(dar,400/225),225,400/dar)',setsar=1,crop=400:225" -frames:v 1 c:/test/mytest_episode_file.jpg
This will generate the image for the episode perfectly.
So now I am trying to get Sonarr to pass the “%Sonarr_EpisodeFile_Path%” to the batch file, without success:(
I thought following would work:
Set File="%Sonarr_EpisodeFile_Path%" ffmpeg -ss 100 -i %File% -vf "scale='if(gt(dar,400/225),225*dar,400)':'if(gt(dar,400/225),225,400/dar)',setsar=1,crop=400:225" -frames:v 1 %File%.jpg
In sonarr, connect - custom script.
Arguments: /c D:\Image.bat
Im sure many people would appreciate such an addon for the community as many eps dont have images for 3-4days after airing.
Thanks to anyone for your help.