2024-02-14, 12:18 AM
You would need to write a for/while loop. Any loop would need to modify the command I provided with " < /dev/null" at the end of the ffmpeg command because of the way ffmpeg works. Something like this.
If your files use ASS subs with font attachments, you will need to include "-c:t? copy" after "-c:s copy" so that it copies all the ASS subtitle fonts.
Code:
cd /tv/show/directory
ls *.mkv | while read origFile ; do /usr/lib/jellyfin-ffmpeg/ffmpeg -fflags genpts -i "$origFile" -map 0:v -map 0:a -map 0:s -map_chapters 0 -c:v copy -c:a copy -c:s copy newFile.mkv < /dev/null ; mv newFile.mkv "$origFile" ; done
If your files use ASS subs with font attachments, you will need to include "-c:t? copy" after "-c:s copy" so that it copies all the ASS subtitle fonts.