
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (73)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (8139)
-
problem in making HLS using ffmpeg problem
24 juin 2023, par AMZI have a function do run in background and create m3u8 for some videos : (I is running in background and updating some fields in django).


def convert_to_hls(episode):
 # Set the output directory for HLS files
output_dir = os.path.join(settings.MEDIA_ROOT, 'hls')
os.makedirs(output_dir, exist_ok=True)

# Set the input video file path
input_file_path = episode.videoFile.path

# Set the output filename and path for the HLS playlist
# filename = os.path.splitext(os.path.basename(input_file_path))[0]
characters = string.ascii_letters + string.digits
filename = ''.join(random.choice(characters) for _ in range(45))
playlist_path = os.path.join(output_dir, f'{filename}.m3u8')

# Set the output path for the HLS segments
segments_path = os.path.join(output_dir, f'{filename}_%05d.ts')

# Construct the ffmpeg command for HLS conversion
command = [
 'ffmpeg',
 '-i', input_file_path,
 '-c:v', 'libx264',
 '-crf', '23',
 '-preset', 'medium',
 '-c:a', 'aac',
 '-b:a', '128k',
 '-f', 'hls',
 '-hls_time', '10',
 '-hls_list_size', '0',
 '-hls_segment_filename', segments_path,
 playlist_path
]
# Execute the ffmpeg command
subprocess.run(command, check=True)

episode.hls_created = True
episode.hls_url = playlist_path.replace("/home/debian/project","")
episode.save()

return True



this code works well for most of my videos but for some .mp4 files gets :


[Fri Jun 23 17:05:47.511095 2023] [wsgi:error] [pid 19975:tid 140289048565504] Exception in thread Thread-1:
[Fri Jun 23 17:05:47.511198 2023] [wsgi:error] [pid 19975:tid 140289048565504] Traceback (most recent call last):
[Fri Jun 23 17:05:47.511244 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[Fri Jun 23 17:05:47.512078 2023] [wsgi:error] [pid 19975:tid 140289048565504] self.run()
[Fri Jun 23 17:05:47.512124 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/threading.py", line 870, in run
[Fri Jun 23 17:05:47.512707 2023] [wsgi:error] [pid 19975:tid 140289048565504] self._target(*self._args, **self._kwargs)
[Fri Jun 23 17:05:47.512748 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/home/debian/project/twapp/views/episode_backgrounds.py", line 41, in convert_to_hls
[Fri Jun 23 17:05:47.512950 2023] [wsgi:error] [pid 19975:tid 140289048565504] subprocess.run(command, check=True)
[Fri Jun 23 17:05:47.512989 2023] [wsgi:error] [pid 19975:tid 140289048565504] File "/opt/bitnami/python/lib/python3.8/subprocess.py", line 516, in run
[Fri Jun 23 17:05:47.513500 2023] [wsgi:error] [pid 19975:tid 140289048565504] raise CalledProcessError(retcode, process.args,
[Fri Jun 23 17:05:47.513657 2023] [wsgi:error] [pid 19975:tid 140289048565504] subprocess.CalledProcessError: Command '['ffmpeg', '-i', '/home/debian/project/media/videos/introduction_to_raster_qBhrnAx.mp4', '-c:v', 'libx264', '-crf', '23', '-preset', 'medium', '-c:a', 'aac', '-b:a', '128k', '-f', 'hls', '-hls_time', '10', '-hls_list_size', '0', '-hls_segment_filename', '/home/debian/project/media/hls/ZN3fsJVEfTDEc8MFb5DrP7Y34JFNLj0hfWnGRZAwFdjuG_%05d.ts', '/home/debian/project/media/hls/ZN3fsJVEfTDEc8MFb5DrP7Y34JFNLj0hfWnGRZAwFdjuG.m3u8']' returned non-zero exit status 1.



Also it does not work for .MOV files.


-
Merge .mkv files with already included subtitles using ffmpeg-python
9 mars 2023, par EesheI'm trying to merge two (and more in the future) .mkv files that already have subtitles included in them, this means I DO NOT have .srt files that need to be encoded. Let's call the .mkv files
intro.mkv
andepisode.mkv
.

However, the way I want to merge them is so a portion of the
episode.mkv
file is played until a specified timestamp, thenintro.mkv
plays completely, and after that the rest ofepisode.mkv
.

I've managed to get close with the following code.


import ffmpeg

initial_episode_video = ffmpeg.input('episode.mkv', to='00:00:34.033', hwaccel='cuvid')
intro_video = ffmpeg.input('intro.mkv', hwaccel='cuvid')
remaining_episode_video = ffmpeg.input('episode.mkv', ss='00:00:34.033', hwaccel='cuvid')

full_episode_video = ffmpeg.concat(initial_episode_video, intro_video, remaining_episode_video)

output_video = ffmpeg.output(
 full_episode_video,
 filter_complex='[0:v][0:a][1:v][1:a][2:v][2:a]concat=n=3:v=1:a=1',
 vprofile='main', 
 vcodec='h264_nvenc',
 pix_fmt='yuv420p',
 crf=22,
 map="0:s",
 filename=f'Output/{episode_path}')
ffmpeg.run(output_video)



With this code, the videos are correctly trimmed. The problem is that once
intro.mkv
starts playing, it doesn't show the subtitles corresponding to it, instead it shows theepisode.mkv
subtitles corresponding to the '00:00:34.033' timestamp.

My objective is to display the subtitles of
intro.mkv
, and then, once the full intro is played, continue with the subtitles fromepisode.mkv
.

NOTE : I am aware that I am re-encoding both the
episode.mkv
andintro.mkv
files. If possible, I'd prefer if it only re-encodesepisode.mkv
, sinceintro.mkv
only needs to be re-encoded once (I can do that individually). I am re-encoding to go from H.264 Hi 10 to H.264 main profile.

-
ffmpeg adds silence when used with input text file
1er octobre 2022, par AncientToasterI'm using ffmpeg's concat option to combine a series of still images with an mp3 file. The total duration of my
input.txt
file is 12532 seconds, which is exactly the same as the total duration of my mp3 file (3:28:52, or 12532 seconds).

But ffmpeg is adding 200 seconds of audio-free content to the end of the video. I've tried totaling and re-totaling the total duration of input.txt and it all seems to add up to the same amount. Including or excluding the
-shortest
flag also doesn't seem to matter.

- 

-
ffmpeg command :


ffmpeg -f concat -i input.txt -i input.mp3 -shortest -c:v libx264 -r 1 -pix_fmt yuv420p output.mp4



-


-


-












I'm having the same issue (differing amounts of time) with other videos.


-