
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (111)
-
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 -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.
Sur d’autres sites (11957)
-
ffmpeg black screen issue for video video generation from a list of frames
11 mai 2023, par arlaineI used a video to generate a list of frames from it, then I wanted to create multiple videos from this list of frames.
I've set starting and ending frames indexes for each "sub video", so for example,

indexes = [[0, 64], [64, 110], [110, 234], [234, 449]]
, and those indexes will help my code generate 4 videos of various durations. The idea is to decompose the original video into multiple sub videos. My code is working just fine, the video generated.

But every sub video start with multiple seconds of black screen, only the first generated video (so the one using
indexes[0]
for starting and ending frames) is generated without this black screen part. I've tried changing the frame rate for eachsub_video
, according to the number of frames and things like that, but I didn't work. You can find my code below

for i, (start_idx, end_idx) in enumerate(self.video_frames_indexes):
 if end_idx - start_idx > 10:
 shape = cv2.imread(f'output/video_reconstitution/{video_name}/final/frame_{start_idx}.jpg').shape
 os.system(f'ffmpeg -r 30 -s {shape[0]}x{shape[1]} -i output/video_reconstitution/{video_name}/final/frame_%d.JPG'
 f' -vf "select=between(n\,{start_idx}\,{end_idx})" -vcodec libx264 -crf 25'
 f' output/video_reconstitution/IMG_7303/sub_videos/serrage_{i}.mp4')



Just the ffmpeg command


ffmpeg -r 30 -s {shape[0]}x{shape[1]} -i output/video_reconstitution/{video_name}/final/frame_%d.JPG -vf "select=between(n\,{start_idx}\,{end_idx})" -vcodec libx264 -crf 25 output/video_reconstitution/IMG_7303/sub_videos/serrage_{i}.mp4



-
Reading RTMP streams using FFMPEG returns AVERROR_EOF randomly
9 octobre 2013, par user2628781I am using FFMpeg to receive RTMP streams. This logic is placed in a custom video player I am building.
I managed to successfully connect to the RTMP stream and display the video correctly. However, after a period in time, the stream terminates prematurely with an AVERROR_EOF when I perform av_read_frame().
This indicates to me that the file has ended so my demux, video and audio threads terminates thinking that the video has ended.
However, the video playback hasn't yet reached its end (in the case of a file streamed through rtmp) or from a live stream (which runs forever). The EOFs are received very randomly so it may run for say 7 min before this occurs or after 3 mins.Is this a characteristic behaviour of RTMP or am I doing something incorrectly ?
I am also having a similar problem with Http Live Streams using FFMpeg.A small snippet of the code is provided below :
AVPacket packet;
//start timeout timer and timeout
__interrupt_timer.start();
int ret = av_read_frame(format_context, &packet); //0: ok, <0: error/end
//invalidate the timer
__interrupt_timer.invalidate();
if (ret != 0) {
if (ret == AVERROR_EOF) { //end of file. FIXME: why no eof if replaying by seek(0)?
if (!eof) {
eof = true;
started_ = false;
pkt->data = QByteArray(); //flush
pkt->markEnd();
qDebug("End of file. %s %d", __FUNCTION__, __LINE__);
emit finished();
return true;
}
pkt->data = QByteArray(); //flush
//return true;
return false; //frames after eof are eof frames
} else if (ret == AVERROR_INVALIDDATA) {
qWarning("AVERROR_INVALIDDATA");
} else if (ret == AVERROR(EAGAIN)) {
return true;
}
qWarning("[AVDemuxer] error: %s", av_err2str(ret));
return false;
} -
os.walk returns file names but when trying to modify the files it says directory not found
13 avril 2021, par epWILLIm trying to walk through music folder and find all sub folders in it and convert the mp4's in all folders to wav. It prints out the correct file name but when it trys to convert it says directory not found.


I would like to us os.walk to go through all folders instead going through 1 folder and changing the name in the code for the other folders


This code works for one folder


import os
import ffmpeg
import time

path = './musicTest/'


os.chdir(path)
aud_files = os.listdir()
count = 0
count2 = 0


 ##convert mp4 to wav
for file in aud_files:
 os.system('ffmpeg -i "{}" -acodec pcm_s16le -ac 1 -ar 16000 output-{}.wav'.format(file, count))
 count = count + 1
 os.remove(file)



this is the code that gives me no directory found when using os.walk but it prints the file name


import os
from pydub import AudioSegment
import ffmpeg

path = "./musicTest/"
count = 0

for i, (root, dirs, files) in enumerate(os.walk(path)):
 if root is not path:
 for file in files:
 print(file)
 os.system('ffmpeg -i "{}" -acodec pcm_s16le -ac 1 -ar 16000 output-{}.wav'.format(file, count))
 count = count + 1