
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (26)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (4424)
-
Open letter to the European Parliament’s LIBE committee
28 novembre 2019, par Joselyn Khor — Uncategorized -
Multiple Dialogue lines of an ASS subtitle file is displayed at the same time on the video file
14 janvier 2024, par Furkan GözükaraI am trying to code an ASS subtitle burner.


Converting given SRT file into ASS subtitle


Let me show examples


Below is given SRT file - generated with Whisper


1
00:00:00,000 --> 00:00:00,080
<u>American</u> XL Bully Dog

2
00:00:00,080 --> 00:00:00,640
American <u>XL</u> Bully Dog

3
00:00:00,640 --> 00:00:01,140
American XL <u>Bully</u> Dog

4
00:00:01,140 --> 00:00:01,280
American XL Bully <u>Dog</u>

5
00:00:01,280 --> 00:00:01,520
<u>is</u> a danger to

6
00:00:01,520 --> 00:00:01,640
is <u>a</u> danger to

7
00:00:01,640 --> 00:00:01,800
is a <u>danger</u> to

8
00:00:01,800 --> 00:00:02,220
is a danger <u>to</u>

9
00:00:02,220 --> 00:00:02,380
<u>our</u> communities, particularly our

10
00:00:02,380 --> 00:00:02,680
our <u>communities,</u> particularly our

11
00:00:02,680 --> 00:00:03,360
our communities, particularly our

12
00:00:03,360 --> 00:00:03,580
our communities, <u>particularly</u> our

13
00:00:03,580 --> 00:00:04,060
our communities, particularly <u>our</u>

14
00:00:04,060 --> 00:00:04,280
<u>children.</u>



Then this above SRT file is converted into the below ASS subtitle


[Script Info]
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,16,&H00FFFFFF,&H0000FF00,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,00:00:00.000,00:00:00.080,Default,,0,0,0,,{\c&H00FF00&}American{\c&HFFFFFF&} XL Bully Dog
Dialogue: 0,00:00:00.080,00:00:00.640,Default,,0,0,0,,American {\c&H00FF00&}XL{\c&HFFFFFF&} Bully Dog
Dialogue: 0,00:00:00.640,00:00:01.140,Default,,0,0,0,,American XL {\c&H00FF00&}Bully{\c&HFFFFFF&} Dog
Dialogue: 0,00:00:01.140,00:00:01.280,Default,,0,0,0,,American XL Bully {\c&H00FF00&}Dog{\c&HFFFFFF&}
Dialogue: 0,00:00:01.280,00:00:01.520,Default,,0,0,0,,{\c&H00FF00&}is{\c&HFFFFFF&} a danger to
Dialogue: 0,00:00:01.520,00:00:01.640,Default,,0,0,0,,is {\c&H00FF00&}a{\c&HFFFFFF&} danger to
Dialogue: 0,00:00:01.640,00:00:01.800,Default,,0,0,0,,is a {\c&H00FF00&}danger{\c&HFFFFFF&} to
Dialogue: 0,00:00:01.800,00:00:02.220,Default,,0,0,0,,is a danger {\c&H00FF00&}to{\c&HFFFFFF&}
Dialogue: 0,00:00:02.220,00:00:02.380,Default,,0,0,0,,{\c&H00FF00&}our{\c&HFFFFFF&} communities, particularly our
Dialogue: 0,00:00:02.380,00:00:02.680,Default,,0,0,0,,our {\c&H00FF00&}communities,{\c&HFFFFFF&} particularly our
Dialogue: 0,00:00:02.680,00:00:03.360,Default,,0,0,0,,our communities, particularly our
Dialogue: 0,00:00:03.360,00:00:03.580,Default,,0,0,0,,our communities, {\c&H00FF00&}particularly{\c&HFFFFFF&} our
Dialogue: 0,00:00:03.580,00:00:04.060,Default,,0,0,0,,our communities, particularly {\c&H00FF00&}our{\c&HFFFFFF&}
Dialogue: 0,00:00:04.060,00:00:04.280,Default,,0,0,0,,{\c&H00FF00&}children.{\c&HFFFFFF&}



Both when playing the subtitle in any video player or burning into video via FFMPEG, what happens is, multiple Dialogue lines are being displayed at the same time on the screen.


I am doing a lot of research regarding this but still couldn't find out the issue.


Here screenshot of what I mean. So how can I fix this issue ? What is wrong with my ASS file format ?




Here below the functio that I am use to generate that ASS format


def convert_srt_to_ass(srt_content):
 # ASS header
 ass_header = (
 "[Script Info]\n"
 "ScriptType: v4.00+\n"
 "PlayResX: 384\n"
 "PlayResY: 288\n\n"
 "[V4+ Styles]\n"
 "Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding\n"
 "Style: Default,Arial,16,&H00FFFFFF,&H0000FF00,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1\n\n"
 "[Events]\n"
 "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n"
 )

 ass_content = ass_header
 # Adjust regex to properly capture subtitle number, start time, end time, and text
 matches = list(re.finditer(r'(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})\n(.+?)\n\n', srt_content, re.DOTALL))

 prev_end = None
 
 for match in matches:
 start, end, text = match.group(2), match.group(3), match.group(4)
 start = start.replace(',', '.')
 end = end.replace(',', '.')

 # Calculate the correct start and end times to ensure no overlap
 if prev_end and start <= prev_end:
 # Adjust the previous end time to be a bit before the current start time
 prev_end_time = datetime.strptime(prev_end, '%H:%M:%S.%f')
 adjusted_end_time = prev_end_time - timedelta(milliseconds=100) # Adjust by 100 milliseconds
 prev_end = adjusted_end_time.strftime('%H:%M:%S.%f')[:-3] # Truncate to 3 decimal places

 ass_content = ass_content.rstrip()
 ass_content = re.sub(r'(\d{2}:\d{2}:\d{2}\.\d{3}),Default,,$', f'{prev_end},Default,,', ass_content, 1)
 ass_content += '\n'

 prev_end = end

 # Formatting the text and adding it to the content
 text = text.replace('<u>', '{\\c&H00FF00&}').replace('</u>', '{\\c&HFFFFFF&}')
 text = text.replace('\n', '\\N') # Convert newlines within text for ASS format
 ass_content += f"Dialogue: 0,{start},{end},Default,,0,0,0,,{text}\n"

 
 # Conversion of text and other formatting remains the same

 return ass_content



-
"ffmpeg has text relocations" error in Android
5 janvier 2015, par djzmoI’m building an Android video-sending application. I need the video to be compressed before being uploaded. In this case, I chose to use this Android wrapper of FFmpeg : https://github.com/hiteshsondhi88/ffmpeg-android-java
FFmpeg error: WARNING: linker: /data/data/com.mycompany.myapplication/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Camera/VID_20150104_235926.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2015-01-04 16:00:40
Duration: 00:01:12.60, start: 0.000000, bitrate: 19590 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 19364 kb/s, SAR 65536:65536 DAR 16:9, 26.73 fps, 26.92 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2015-01-04 16:00:40
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
Metadata:
creation_time : 2015-01-04 16:00:40
handler_name : SoundHandle
[libx264 @ 0x40208800] using SAR=1/1
[libx264 @ 0x40208800] frame MB size (120x68) > level limit (1620)
[libx264 @ 0x40208800] DPB size (1 frames, 8160 mbs) > level limit (0 frames, 8100 mbs)
[libx264 @ 0x40208800] MB rate (219640) > level limit (40500)
[libx264 @ 0x40208800] using cpu capabilities: none!
[libx264 @ 0x40208800] profile Constrained Baseline, level 3.0
[libx264 @ 0x40208800] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=28.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2500 vbv_bufsize=1835 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, mp4, to '/storage/emulated/0/Android/data/com.mycompany.myapplication/cache/VID_20150104_235926.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf56.4.101
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 65536:65536 DAR 16:9], q=-1--1, 2500 kb/s, 26.92 fps, 10336 tbn, 26.92 tbc (default)
Metadata:
creation_time : 2015-01-04 16:00:40
handler_name : VideoHandle
encoder : Lavc56.1.100 libx264
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 4Everything seemed fine when I compress small files (below 20 seconds), but when I tried to compress larger files, I seldom get the above error in the middle of the compression process, and the process was also terminated immediately. I need the application to be able to compress one minute video to about 20-35 MB.
Here is the FFmpeg command I used :
ffmpeg -y -i -codec:v libx264 -profile:v baseline -level 3.0 -b:v 2500k -minrate 2500k -maxrate 2500k -bufsize 1835k -pix_fmt yuv420p -preset ultrafast -crf 28 -codec:a copy
Any idea on what went wrong ?
Any kind of help would be very appreciated.