summaryrefslogtreecommitdiffstats
path: root/magic/Magdir/subtitle
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:52:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:52:51 +0000
commit71507ca5d2410b11889ca963fafcd1bcad5044c3 (patch)
tree17e6d07243d49e29e4b75887e0d07f24ec2b66e8 /magic/Magdir/subtitle
parentInitial commit. (diff)
downloadfile-71507ca5d2410b11889ca963fafcd1bcad5044c3.tar.xz
file-71507ca5d2410b11889ca963fafcd1bcad5044c3.zip
Adding upstream version 1:5.44.upstream/1%5.44upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'magic/Magdir/subtitle')
-rw-r--r--magic/Magdir/subtitle38
1 files changed, 38 insertions, 0 deletions
diff --git a/magic/Magdir/subtitle b/magic/Magdir/subtitle
new file mode 100644
index 0000000..cfbe293
--- /dev/null
+++ b/magic/Magdir/subtitle
@@ -0,0 +1,38 @@
+
+#------------------------------------------------------------------------------
+# $File: subtitle,v 1.2 2022/09/07 11:29:09 christos Exp $
+# subtitle: file(1) magic for subtitles files
+
+# EBU-STL
+# https://tech.ebu.ch/docs/tech/tech3264.pdf
+3 string STL EBU-STL subtitles
+>6 regex =^[0-9][0-9] \b, rate %s
+>>8 string .01 \b, v1
+!:mime application/x-ebu-stl
+>>>16 regex =^[^\ ]{0,32} \b, title "%s"
+>>>>224 regex =^[0-9]{2} \b, created %-.2s
+>>>>>&0 regex =^[0-9]{2} \b-%-.2s
+>>>>>>&0 regex =^[0-9]{2} \b-%-.2s
+!:ext stl
+
+# SubRip (srt) subtitles
+0 regex/20 =^1[\r\n]+0[01]:[0-9]{2}:[0-9]{2},[0-9]{3}\040--> SubRip
+!:mime application/x-subrip
+!:ext srt
+
+# WebVTT subtitles
+# https://www.w3.org/TR/webvtt1/
+0 string/t WEBVTT
+>&0 regex/255 =[0-9]{2}:[0-9]{2}\\.[0-9]{3}\040--> WebVTT subtitles
+!:mime text/vtt
+!:ext vtt
+
+# XML TTML subtitles
+# https://www.w3.org/TR/ttml2/
+0 string/t \<?xml
+>20 search/400 \020xmlns=
+>>&0 regex ['"]http://www.w3.org/ns/ttml TTML subtitles
+!:mime application/ttml+xml
+# Augment strength to beat plain XML
+!:strength * 3
+!:ext ttml