I wrote a post process script to convert my files from .ts to .mp4 on my QNAP TS-853A making use of the hardware transcoding ability of the celeron processor.
The script works great, apart from when the script is finished plex reports that the recording has failed, so it goes about finding a second, third or forth copy of the show to record. It also removes the history of the recording so it is difficult to work out from the schedule whether the show recorded or not. The recording has not failed, its just been transcoded to an mp4. How can I tell plex that the recording has been successful?
My script -
#!/bin/sh
#This part “refreshes” the NAS that it can do it! HW transcoding! I couldn’t fix this into the memory between reboots
export LD_LIBRARY_PATH=/share/CACHEDEV1_DATA/Multimedia/ffmpeg/lib:/share/CACHEDEV1_DATA/Multimedia/ffmpeg/lib/samba:$LD_LIBRARY_PATH
export LIBVA_DRIVER_NAME=i965
export LIBVA_DRIVERS_PATH=/share/CACHEDEV1_DATA/Multimedia/ffmpeg/lib/dri
export PATH=/share/CACHEDEV1_DATA/Multimedia/ffmpeg/bin:$PATH
/share/CACHEDEV1_DATA/Multimedia/ffmpeg/ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128
The actual FFMpeg options
-hwaccel_output_format vaapi -i “$1” -c:v h264_vaapi -c:a aac -b:a 256k -ac 2 “$1”.mp4
#Remove the original ts file. Plex was just moving the ts not the mp4 which didnt work for me
rm “$1”