
Recherche avancée
Autres articles (65)
-
Les images
15 mai 2013 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...)
Sur d’autres sites (6688)
-
Youtube processing stuck at 95%
10 avril 2019, par lcssanchesWell I’m trying to upload a video recorded with ffmpeg, but Youtube fail at processing it.
Here’s the video information :
Here’s the link https://www.youtube.com/watch?v=7XlxLh0usnY. -
Python buffered IO ending early streaming with multiple pipes
5 octobre 2022, par MalibuI'm trying to make a continuous livestream of videos downloaded via yt-dlp. I need to port this (working) bash command into Python.


(
 youtube-dl -v --buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 -o - | ffmpeg -i - -f mpegts -c copy - ;
 youtube-dl -v --buffer-size 16k https://youtube.com/watch?v=QiInzFHIDp4 -o - | ffmpeg -i - -f mpegts -c copy - ;
) | ffmpeg -re -i - -c:v libx264 -f flv rtmp://127.0.0.1/live/H1P_x5WPF



My Python attempt is cutting off the last 2 seconds of each video. My suspicion is that although the first pipe, yt-dlp, has an empty stdout, there is still data travelling between the second and third pipe. I haven't been able to figure out a way to properly handle the data between those two pipes at the end of the video.


from subprocess import Popen, PIPE, DEVNULL

COPY_BUFSIZE = 65424

playlist = [
 {
 # 15 second video
 "url": "https://youtube.com/watch?v=QiInzFHIDp4"
 },
 {
 # 15 second video
 "url": "https://youtube.com/watch?v=QiInzFHIDp4"
 },
 {
 # 15 second video
 "url": "https://youtube.com/watch?v=QiInzFHIDp4"
 },
]

if __name__ == "__main__":
 stream_cmd = [
 "ffmpeg", "-loglevel", "error",
 "-hide_banner", "-re", "-i", "-",
 "-c:v", "libx264",
 "-f", "flv",
 "-b:v", "3000k", "-minrate", "3000k",
 "-maxrate", "3000k", "-bufsize", "3000k",
 "-r", "25", "-pix_fmt", "yuv420p",
 "rtmp://127.0.0.1/live/H1P_x5WPF"
 ]
 print(f'Stream command:\n"{" ".join(stream_cmd)}"')

 encoder_cmd = [
 "ffmpeg", "-re", "-i", "-", "-f", "mpegts",
 "-c", "copy", "-"
 ]
 print(f'Encoder command:\n"{" ".join(encoder_cmd)}"')

 stream_p = Popen(stream_cmd, stdin=PIPE, stderr=DEVNULL)

 for video in playlist:
 yt_dlp_cmd = [
 "yt-dlp", "-q",
 video["url"],
 "-o", "-"
 ]

 print("Now playing: " + video["url"])

 with Popen(yt_dlp_cmd, stdout=PIPE) as yt_dlp_p:
 with Popen(encoder_cmd, stdin=PIPE, stdout=PIPE, stderr=DEVNULL) as encoder_p:
 while True:
 yt_dlp_buf = yt_dlp_p.stdout.read(COPY_BUFSIZE)
 print("READ: yt_dlp")
 if not yt_dlp_buf:
 print("yt-dlp buffer empty")
 # Handle any data in 2nd/3rd pipes before breaking?
 break

 written = encoder_p.stdin.write(yt_dlp_buf)
 print("WRITE: encoder. Bytes: " + str(written))

 encoder_buf = encoder_p.stdout.read(COPY_BUFSIZE)
 # if not encoder_buf:
 # print("encoder_buf empty")
 # break
 print("READ: encoder")

 stream_bytes_written = stream_p.stdin.write(encoder_buf)
 print("WRITE: stream, Bytes: " + str(stream_bytes_written))



Running Python 3.6.9 on MacOS.


-
Watching a livestream that is being ripped by ffmpeg to disk - file updating problem
22 mai 2021, par merlinI am automatically recording daily tv news with ffmpeg, so I can watch them later.


ffmpeg -i https://mcdn.daserste.de/daserste/de/master.m3u8 -c copy Tagesschau.mkv



This works. But let's say ffmpeg recorded for 2 minutes and I open the currently saved file and begin to watch the video stops after some time.
It doesn't continue playing (but ffmpeg is still recording so there must be more video).


Strange thing is even by closing and reopening the file I don't see the new content. Sometimes I have to wait 1-2 minutes till the new content shows up. But in the file manager I see the file is growing in size continuous.


But when I copy/paste the file e.g. in the same directory and reopen the file I can immediately see the complete video content up to date recorded.


Maybe it has to do with file system write buffer ? I tried on ZFS and ext4 (mounted on a samba share). By copy/paste I "trigger" the file system to update the file content ?


Is there a workaround so when I start watching it will play without stopping ?