
{"id":662,"date":"2023-10-26T21:07:21","date_gmt":"2023-10-26T20:07:21","guid":{"rendered":"https:\/\/tty.tartux.net\/?p=662"},"modified":"2024-08-22T17:34:54","modified_gmt":"2024-08-22T16:34:54","slug":"encodage-de-sous-titres-handbrake-defaillant","status":"publish","type":"post","link":"https:\/\/tty.tartux.net\/?p=662","title":{"rendered":"Encodage de sous-titres (Handbrake d\u00e9faillant)"},"content":{"rendered":"<p>Sur ubuntu :<\/p>\n<blockquote><p>apt install ffmpeg ogmrip tesseract-ocr tesseract-ocr-fra subtitleeditor<\/p><\/blockquote>\n<p>Disposer des infos avec ffmpeg :<\/p>\n<blockquote><p>ffmpeg -i VTS_01_1.VOB<\/p><\/blockquote>\n<p>R\u00e9cup\u00e9rer les .idx et .sub pour le titre 1:<\/p>\n<blockquote><p>mencoder dvd:\/\/1 -nosound -ovc frameno -o \/dev\/null -vobsuboutindex 0 -sid 0 -vobsubout nom_du_fichier<\/p><\/blockquote>\n<p>Le sid est la piste \u00e0 lire, elle sera pass\u00e9e en sid 0 par l'instruction vobsuboutindex.<br \/>\nScript d'ocr (Tesseract.sh) \u00e0 placer dans le dossier (le paquet tesseract-ocr-fra est n\u00e9cessaire):<\/p>\n<blockquote><p>#!\/bin\/bash<\/p>\n<p>NPROC=$(nproc --all| awk '{ print $1 - 1 }') # Set number of processor<br \/>\nfor fichier in *.tif<br \/>\ndo<br \/>\n(<br \/>\necho \"$fichier\"<br \/>\ntesseract \"$fichier\" \"$fichier\" -l fra --psm 6 &amp;&gt;\/dev\/null<br \/>\n) &amp;<br \/>\nif [[ $(jobs -r -p | wc -l) -gt $NPROC ]]; then<br \/>\nwait -n<br \/>\nfi<br \/>\ndone<br \/>\nwait<\/p><\/blockquote>\n<p>Cr\u00e9ation des fichiers tiff et du xml index\u00e9 :<\/p>\n<blockquote><p>subp2tiff --sid=0 -n nom_du_fichier<\/p><\/blockquote>\n<p>On lance le script qui va oc\u00e9riser les fichiers:<\/p>\n<blockquote><p>.\/Tesseract.sh<\/p><\/blockquote>\n<p>C'est long.<\/p>\n<p>On assemble les fichiers txt et l'index xml :<\/p>\n<blockquote><p>subptools -s -w -t srt -i nom_du_fichier.xml -o nom_du_fichier.srt<\/p><\/blockquote>\n<p>Normalement, le tour est jou\u00e9.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sur ubuntu : apt install ffmpeg ogmrip tesseract-ocr tesseract-ocr-fra subtitleeditor Disposer des infos avec ffmpeg : ffmpeg -i VTS_01_1.VOB R\u00e9cup\u00e9rer les .idx et .sub pour le titre 1: mencoder dvd:\/\/1 -nosound -ovc frameno -o \/dev\/null -vobsuboutindex 0 -sid 0 -vobsubout nom_du_fichier Le sid est la piste \u00e0 lire, elle sera pass\u00e9e en sid 0 par [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[135],"tags":[183,137],"class_list":["post-662","post","type-post","status-publish","format-standard","hentry","category-video","tag-handbrake","tag-video"],"_links":{"self":[{"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/posts\/662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=662"}],"version-history":[{"count":21,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions"}],"predecessor-version":[{"id":758,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=\/wp\/v2\/posts\/662\/revisions\/758"}],"wp:attachment":[{"href":"https:\/\/tty.tartux.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tty.tartux.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}