
Recherche avancée
Autres articles (100)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.
Sur d’autres sites (15269)
-
Why do my Windows filenames keep getting converted in FFMPEG ?
14 avril 2024, par GeneralTullyI'm running a script that walks through a large library of
.flac
music, making a mirror library with the same structure but converted to.opus
. I'm doing this on Windows 11, so I believe the source filenames are all inUTF-16
. The script calls FFMPEG to do the converting.

For some reason, uncommon characters keep getting converted to different but similar characters when the script runs, for example :


06 xXXi_wud_nvrstøp_ÜXXx.flac



gets converted to :


06 xXXi_wud_nvrstøp_ÜXXx.opus



They look almost identical, but the
Ü
and I believe also theø
are technically slightly different characters before and after the conversion.

The function which calls
FFMPEG
for the conversion looks like this :

def convert_file(pool, top, file):
 fullPath = os.path.join(top, file)
 # Pass count=1 to str.replace() just in case .flac is in the song
 # title or something.
 newPath = fullPath.replace(src_dir, dest_dir, 1)
 newPath = newPath.replace(".flac", ".opus", 1)

 if os.path.isfile(newPath):
 return None
 else:
 print("{} does not exist".format(newPath))
 
 cvt = [
 "Ffmpeg", "-v", "debug", "-i", fullPath, "-c:a", "libopus", "-b:a", "96k", newPath]
 print(cvt)

 return (
 fullPath,
 pool.apply_async(subprocess.run, kwds={
 "args": cvt,
 "check": True,
 "stdin": subprocess.DEVNULL}))



The arguments are being supplied by
os.walk
with no special parameters.

Given that the script is comparing filenames to check if a conversion needs to happen, and the filenames keep getting changed, it keeps destroying and recreating the same files every time the script runs.


Why might this be happening ?


edit : I have confirmed that if I manually execute the FFMPEG command in CMD, bypassing Python completely, it converts the original Unicode 0125 + 01410 to 0334 (U with umlaut), so this doesn't seem to be a Python problem.


-
Running command Subprocess python failed but the same exact command runs well in Terminal
15 juillet 2023, par willAs the title says : weird problem. I've been struggling to make this work for a whole day but to no avail. Any help would be deeply appreciated.


# I've tried every one of the below path but still errors: Fontconfig error: Cannot load default config file: No such file: (null)

FONT_LOC = r'C\\:/Users/acer/AppData/Local/Microsoft/Windows/Fonts/jf-openhuninn-1.1.ttf'
FONT_LOC = 'C:/Users/acer/AppData/Local/Microsoft/Windows/Fonts/jf-openhuninn-1.1.ttf'
FONT_LOC = 'C://Users/acer/AppData/Local/Microsoft/Windows/Fonts/jf-openhuninn-1.1.ttf'


duration = '30
subtitle='abc'
comd = [
 "ffmpeg",
 "-f", "lavfi",
 "-i", "color=c=black:s=1280x720:d={duration}".format(duration=duration),
 "-vf", f'''drawtext=fontfile="{FONT_LOC}":text='{subtitle}':fontcolor=white:fontsize=24:x=(w-text_w)/2:y=(h-text_h)/2''',
 "-c:v", "libx264",
 "-t", duration,
 "-pix_fmt", "yuv420p",
 output_file+'.mp4'
 ]
print(' '.join(comd))
subprocess.run(comd, check=True, capture_output=True, text=True) # Failed


# The below command runs successfully in the terminal.
# ffmpeg -f lavfi -i color=c=black:s=1280x720:d=2.352000 -vf drawtext=fontfile="C\\://Users/acer/AppData/Local/Microsoft/Windows/Fonts/jf-openhuninn-1.1.ttf":text='abc':fontcolor=white:fontsize=24:x=(w-text_w)/2:y=(h-text_h)/2 -c:v libx264 -t 2.352000 -pix_fmt yuv420p output_Test-0004.mp3.mp4




I expect the subprocess.run() would produce the same result. I've tried all versions of paths (different kind of escaping) but none of the aforementioned one worked.


-
FFmpeg - invalid argument on a creation of MP4 with .SRT - Help Needed to Correctly Set Filename of .srt in a FFMPEG Command
23 mai 2023, par sKunZelI have been experiencing a persistent issue while developing a command in FFMPEG to combine a .mp4 file (composed of a static image & audio from a .mp3) with burnt-in subtitles from a stylized .srt file into a new MP4.


This is the command I have been using :


command = f"""ffmpeg -report -i "{input_video_arg_abs}" -vf "subtitles='{input_srt_arg_abs}':original_size=816x1456:force_style='FontName=Open Sans Italic,FontSize=13,MarginR=10,MarginV=149'" -c:v libx264 -crf 18 -c:a copy -movflags +faststart "{output_video}" """ 



My script includes the main variable definitions and function calls as shown below :


input_srt = os.path.normpath(os.path.join(input_directory, srt_file))
print(f"SRT file path: {input_srt}")
reformat_srt(input_srt)
final_video_output=os.path.normpath(os.path.join(output_directory, os.path.splitext(mp3_file)[0] + '.mp4'))
time.sleep(0.5)
create_final_video(temp_video_output, input_srt, final_video_output)



Despite appearing to run successfully, the output file generated is 0 Kb. All logs that I could find suggested an error in the way I've written the .srt, but the input_srt seems to print out correctly.


Here are the log details :
...
[Parsed_subtitles_0 @ 0000028068d97d00] Setting 'filename' to value 'E'
[Parsed_subtitles_0 @ 0000028068d97d00] Unable to open E
...
Error reinitializing filters !
Failed to inject frame into filter network : No such file or directory
Error while processing the decoded data for stream #0:0
Conversion failed !


I am currently speculating that "E :" might be causing the problem. This would be correctly interpreted by Windows, but I'm unsure about FFMPEG's interpretation.
I'm hoping someone might be able to assist me in solving this issue. I'd be delighted if the solution involves an ingenious trick. Otherwise, my apologies for the rookie question. I appreciate your help in advance.


Best,
sKunZel