#1 Le 26/02/2018, à 14:53
- ljere
perte de sous titre durant conversion
Bonjour,
pour lire mes animés sur ma freebox je dois en convertir certains, car la free n'est pas assez puissante pour lire le x265, voici le mini-script
#!/bin/bash
cd x264/travail/
INPUT="$1"
for i in *.mkv ; do
ffmpeg -i "$i" -bsf:v h264_mp4toannexb -sn -map 0:0 -map 0:1 -vcodec libx264 "$i.ts"
sleep 3
done
Il fonctionne très bien sauf qu'après traitement il n'y a plus les sous-titres, y a t'il moyen de les conserver?
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#2 Le 26/02/2018, à 15:05
- Nasman
Re : perte de sous titre durant conversion
C'est pas l'option -sn qui supprimerait la piste de sous titres ?
PC fixe sous Bionic 64 bits et portable avec Focal 64 bits
Hors ligne
#3 Le 26/02/2018, à 15:29
- inbox
Re : perte de sous titre durant conversion
Salut,
Sur cette page, il y a un paragraphe sur les Picture-based subtitles.
You can burn "picture-based" subtitles into a movie as well, by using the overlay video filter to overlay the images. For instance, dvdsub is a type of picture-based overlay subtitles. Example of an MKV with dvdsub subtitles in a separate stream:
ffmpeg -i input.mkv -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a <output options> output.mkv
If you have multiple subtitle streams, you can select which one to use by replacing [0:s] with [0:s:0] to select the first subtitle stream or [0:s:1] to select the second subtitle stream, and so on. See also the official documentation; search for "hardcode".
Sometimes adding this filter have a side effect of breaking encoding when input file has multiple audio streams and some of those may have problems; in this case selecting one (or more) of the audio streams should fix the problem:
ffmpeg -i input.ts -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a:0 <output options> output.mkv
A+
Un problème résolu ? Indiquez le en modifiant le titre du sujet.
Hors ligne
#4 Le 27/02/2018, à 12:03
- ljere
Re : perte de sous titre durant conversion
Bonjour,
alors j'ai testé sans le -sn
ffmpeg -ss 240 -t 60 -i Sola_03_VostFr_\[BD_720p_10bit\]_\[dbc68b5f\].mkv -bsf:v h264_mp4toannexb -map 0:0 -map 0:1 -vcodec libx264 Sola_03_VostFr_\[BD_720p_10bit\].mkv.ts
pas de sous titre puis,
ffmpeg -ss 240 -t 60 -i Sola_03_VostFr_\[BD_720p_10bit\]_\[dbc68b5f\].mkv -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a -bsf:v h264_mp4toannexb -sn -map 0:0 -map 0:1 -vcodec libx264 Sola_03_VostFr.mkv.ts
pas de sous titre non plus, de là j'ai refouillé la doc et j'ai retrouvé une autre commande
ffmpeg -ss 240 -t 60 -i Sola_03_VostFr_\[BD_720p_10bit\]_\[dbc68b5f\].mkv -f matroska -vcodec libx264 -crf 20 -acodec libvorbis -ab 192k -ar 44100 -ac 2 Sola_031_VostFr.mkv
et là j'ai enfin les sous titre, sauf que l'encodage prend encore plus de temps, j'ai lancé un fichier d'1,5g hier à 18h00 il est 12h00 le fichier de sortie n'atteint que les 71mo
Dernière modification par ljere (Le 27/02/2018, à 12:34)
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne
#5 Le 27/02/2018, à 12:12
- Nasman
Re : perte de sous titre durant conversion
Je crois que tu avais deux problèmes :
Je pense que l'option -sn signifie pas de sous titre (-an=pas d'audio, -vn=pas de vidéo)
Et tous les conteneurs ne permettent pas d'avoir une piste de sous titres - le mkv le peut.
Ainsi dans ton script, supprimer le -sn et remplacer le "$i.ts" par "$i.mkv" devrait répondre à ton souhait.
PC fixe sous Bionic 64 bits et portable avec Focal 64 bits
Hors ligne
#6 Le 27/02/2018, à 12:35
- ljere
Re : perte de sous titre durant conversion
je me suis trompé c'est bien le -sn que j'ai supprimé et qui ne fonctionne pas
ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon
Hors ligne