
Recherche avancée
Autres articles (44)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (3994)
-
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.

-
Force x264 to encode all frames relative to the first (IDR) frame
12 décembre 2019, par cloudravenI want to generate a h.264 stream in which P-frames are using references exclusively using a long-term reference to the first frame (an IDR frame). This would also require the first frame to be an IDR frame.



This is an academic experiment to understand the encoding behavior of long-term references and the consequences of forcing frames to refer to a specific (single) frame rather than several.



It would be great if I could do this from the command line, but if not possible I am open to modifying x264 for this purpose.



Could anyone point me to where in the source code it is determined :



- 

- the reference frame / macroblock / partition for the current macroblock
- changes made to the short term, long term reference frame list
- whether to use a short term reference frame or a long term reference frame.









Using another encoder like nvenc is also acceptable.


-
Force x264 to encode all frames relative to the first (IDR) frame
12 décembre 2019, par cloudravenI want to generate a h.264 stream in which P-frames are using references exclusively using a long-term reference to the first frame (an IDR frame). This would also require the first frame to be an IDR frame.



This is an academic experiment to understand the encoding behavior of long-term references and the consequences of forcing frames to refer to a specific (single) frame rather than several.



It would be great if I could do this from the command line, but if not possible I am open to modifying x264 for this purpose.



Could anyone point me to where in the source code it is determined :



- 

- the reference frame / macroblock / partition for the current macroblock
- changes made to the short term, long term reference frame list
- whether to use a short term reference frame or a long term reference frame.









Using another encoder like nvenc is also acceptable.