
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (39)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (6319)
-
FFmpeg stream extraction modifies subtitles [closed]
21 mai 2024, par user18812922I have a video with the following ffprobe output :


Input #0, matroska,webm, from 'video.mkv':
 Metadata:
 title : Video - 01
 creation_time : 2021-07-14T02:49:59.000000Z
 ENCODER : Lavf58.29.100
 Duration: 00:22:57.28, start: 0.000000, bitrate: 392 kb/s
 Chapters:
 Chapter #0:0: start 0.000000, end 86.169000
 Metadata:
 title : Opening
 Chapter #0:1: start 86.169000, end 641.266000
 Metadata:
 title : Part A
 Chapter #0:2: start 641.266000, end 651.359000
 Metadata:
 title : Eyecatch
 Chapter #0:3: start 651.359000, end 1286.160000
 Metadata:
 title : Part B
 Chapter #0:4: start 1286.160000, end 1356.355000
 Metadata:
 title : Ending
 Chapter #0:5: start 1356.355000, end 1376.876000
 Metadata:
 title : Preview
 Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709), 854x480 [SAR 1280:1281 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
 Metadata:
 DURATION : 00:22:56.959000000
 Stream #0:1(eng): Audio: vorbis, 48000 Hz, stereo, fltp (default)
 Metadata:
 title : English [FLAC 2.0]
 DURATION : 00:22:57.278000000
 Stream #0:2(jpn): Audio: vorbis, 48000 Hz, stereo, fltp
 Metadata:
 title : Japanese [FLAC 2.0]
 DURATION : 00:22:57.276000000
 Stream #0:3(eng): Subtitle: ass (ssa)
 Metadata:
 title : Signs and Songs [FMA1394/Redc4t]
 DURATION : 00:22:51.090000000
 Stream #0:4(eng): Subtitle: ass (ssa)
 Metadata:
 title : English [FMA1394/Redc4t]
 DURATION : 00:22:51.090000000
 Stream #0:5(eng): Subtitle: hdmv_pgs_subtitle (pgssub), 1920x1080
 Metadata:
 title : Full English Retail
 DURATION : 00:22:51.120000000
 Stream #0:6: Attachment: ttf
 Metadata:
 filename : 8bitoperator.ttf
 mimetype : application/x-truetype-font
 Stream #0:7: Attachment: ttf
 Metadata:
 filename : Cabin-Bold.ttf
 mimetype : application/x-truetype-font
 Stream #0:8: Attachment: ttf
 Metadata:
 filename : calibrib.ttf
 mimetype : application/x-truetype-font
 Stream #0:9: Attachment: ttf
 Metadata:
 filename : daniel_0.ttf
 mimetype : application/x-truetype-font
 Stream #0:10: Attachment: ttf
 Metadata:
 filename : DEATH_FONT.TTF
 mimetype : application/x-truetype-font
 Stream #0:11: Attachment: ttf
 Metadata:
 filename : Dominican.ttf
 mimetype : application/x-truetype-font
 Stream #0:12: Attachment: ttf
 Metadata:
 filename : gishabd.ttf
 mimetype : application/x-truetype-font
 Stream #0:13: Attachment: ttf
 Metadata:
 filename : PATRICK_0.TTF
 mimetype : application/x-truetype-font
 Stream #0:14: Attachment: ttf
 Metadata:
 filename : Qlassik-Medium.ttf
 mimetype : application/x-truetype-font
Unsupported codec with id 98304 for input stream 6
Unsupported codec with id 98304 for input stream 7
Unsupported codec with id 98304 for input stream 8
Unsupported codec with id 98304 for input stream 9
Unsupported codec with id 98304 for input stream 10
Unsupported codec with id 98304 for input stream 11
Unsupported codec with id 98304 for input stream 12
Unsupported codec with id 98304 for input stream 13
Unsupported codec with id 98304 for input stream 14



I am trying to extract the subtitles, edit them and reattach them to the video.
(I need my program to do that so I don't want to use other software)


Command 1


ffmpeg -i video.mkv -map 0:3 -c:s ssa subs.ass
ffmpeg -i video.mkv -i subs.ass -map 0 -map -0:s -map 1 -c copy out.mkv



Command 2


ffmpeg -i video.mkv -map 0:3 subs.ass
ffmpeg -i video.mkv -i subs.ass -map 0 -map -0:s -map 1 -c copy out.mkv



Command 3


ffmpeg -i video.mkv -map 0:3 subs.srt
ffmpeg -i video.mkv -i subs.srt -map 0 -map -0:s -map 1 -c copy out.mkv



Command 4


ffmpeg -i video.mkv -map 0:3 subs.srt
ffmpeg -i subs.srt subs.ass
ffmpeg -i video.mkv -i subs.ass -map 0 -map -0:s -map 1 -c copy out.mkv



Command 5


ffmpeg -i video.mkv -map 0:3 subs.ass
ffmpeg -i subs.ass subs.srt
ffmpeg -i video.mkv -i subs.srt -map 0 -map -0:s -map 1 -c copy out.mkv



The problem


After extraction the subtitles seem to be really quick, meaning they are displayed and disappear really quickly.


For example the first subtitle is as follows in srt :


1
00:00:03,100 --> 00:00:03,560
<font face="Dominican" size="77" color="#f7f7f7">Within the spreading darkness</font>



Now, in srt it also has wrong size but I assume that's because of the conversion from ass to srt.


If I reattach the subtitle file in the video and open it, it is displayed and disappears way too fast and it doesn't match the original subtitles in the video.


(ie, the original video subtitles are showing for at least a second)


Expected behaviour


The subtitles should be displayed for the same duration as the original subtitles.


NOTE


It's my first question for ffmpeg related issues so feel free to ask me for anything else you may need.


UPDATE 1


I realized that the subtitles were ok for the timings as they had the same line multiple times, so the problem for not playing is something else.


Example of the file


1
00:00:03,100 --> 00:00:03,560
<font face="Dominican" size="77" color="#f7f7f7">Within the spreading darkness</font>

2
00:00:03,560 --> 00:00:04,650
<font face="Dominican" size="77" color="#f7f7f7">Within the spreading darkness</font>

3
00:00:04,650 --> 00:00:05,100
<font face="Dominican" size="77" color="#f7f7f7">Within the spreading darkness</font>



So the problem is that VLC doesn't show more than the first subtitle.


The strange thing is when I use the below command


ffmpeg -i video.mkv -i subs.srt -map 0 -map -0:s -map 1 -c copy -c:s subrip out.mkv



Then more lines of the subtitle (but not all) play.


It stops at the 17th line.


I believe that's an encoder's problem ? but I really don't know.


Also what I noticed is that VLC stops the subtitles but Windows Media Player (Windows 11 version) display the subtitles correctly even after the 17th line.


BUT, if I add subtitles from another video they are played correctly in both VLC and Windows Media Player.


Update 2
As @Gyan said in his answer I should use the following command


ffmpeg -i video.mkv -map 0:3 -c:s copy subs.ass



But then if I attach the subs again with


ffmpeg -i video.mkv -i subs.ass -map 0 -map -0:s -map 1 -c copy -c:s ass out.mkv



The subtitles show up to 17th line in both VLC and Windows Media Player.


or


ffmpeg -i video.mkv -i .\subs.ass -map 0 -map -0:s -map 1 -c copy out.mkv



The subtitles do not show up at all. (Not even in Windows Media Player)


-
Virginia Consumer Data Protection Act (VCDPA) Guide
27 septembre 2023, par Erin — Privacy -
Meta Receives a Record GDPR Fine from The Irish Data Protection Commission
29 mai 2023, par Erin — GDPR