
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (104)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (11462)
-
How to i find common fragments on two audios
11 septembre 2018, par Endy Bermúdez RI need to know how can i identify and extract a fragment of common audio in two differents auidio files ?
I’m developing a music application and I couldn’t find a way to do it. I have been researching about some libraries as Pyaudio and Librosa, but I think that there aren’t a direct form to make it.
Please, help me. Thanks
-
Encoded Video's path gets changed in database after encoding with ffmpeg and celery and works as normal without celery
16 novembre 2020, par DannyI have this code to transcode video and it works well without celery. With celery, the path of the file in the database shows a different path and the video cannot be played in the browser, but it saves the file in the correct location in the pc.


If I don't use celery, then the file path in database is
media/videos/videos/<filename>.mp4</filename>
and file also gets saved here. This way the template is able to play the video. But if I use celery, the output gets saved inmedia/videos/videos/<filename>.mp4</filename>
but the path in database will bemedia/<filename>.mp4</filename>
somehow and thus template can't play the video.

Is it because my page gets updated before the task ? and not getting saved properly ?


views.py


def post(self, *args, **kwargs):
 form = VideoPostForm(self.request.POST or None, self.request.FILES or None)
 if form.is_valid():
 video = form.save(commit=False)
 video.user = self.request.user
 video.save()
 form.save_m2m()
 # task_video_encoding(video.id)
 task_video_encoding.delay(video.id)
 return redirect('videos:my_video_home')
 else:
 raise ValidationError('Check all form fields.')



encoding.py


def encode_video(video_id):
 video = VideoPost.objects.get(id = video_id)
 input_file_path = video.temp_file.path
 # print(input_file_path)
 input_file_name = video.title
 #get the filename (without extension)
 filename = os.path.basename(input_file_path)
 # print(filename)
 # path to the new file, change it according to where you want to put it
 output_file_name = os.path.join('{}.mp4'.format(filename))
 # print(output_file_name)
 # output_file_path = os.path.join(settings.MEDIA_ROOT, output_file_name)
 output_file_path = os.path.join(settings.MEDIA_ROOT, 'videos', 'videos', output_file_name)
 # print(output_file_path)

 for i in range(1):
 subprocess.call([settings.VIDEO_ENCODING_FFMPEG_PATH, '-i', input_file_path, '-codec:v', 'libx264', '-crf', '-preset',
 '-b:v', '3000k', '-maxrate', '-bufsize', '6000k', '-vf', 'scale=-2:720',
 '-codec:a', 'aac', '128k', '-strict', '-2', output_file_path])
 # Save the new file in the database
 video.file = output_file_name
 video.save(update_fields=['file'])
 print(video.file)
 video.temp_file.delete()



models


class VideoPost(models.Model):
 user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, blank=True, null=True)
 title = models.TextField(max_length=1000)
 temp_file = models.FileField(upload_to='videos/temp_videos/', validators=[validate_file_extension], null=True)
 file = models.FileField(upload_to='videos/videos/', validators=[validate_file_extension], blank=True, max_length=255)
 post_date = models.DateTimeField(auto_now_add=True, verbose_name="Date Posted")
 updated = models.DateTimeField(auto_now_add=True, verbose_name="Date Updated")
 slug = models.SlugField(blank=True, unique=True, max_length=255)



Can anyone help me how to change this code in a way to show the converted video properly in the template.


-
ffmpeg isnt working or giving errors
19 avril 2014, par user3549636FFmpeg isnt converting videos (or saving them, I honestly dont know) and isnt even giving me any error, whats wrong ? heres my code :
@{
WebSecurity.RequireAuthenticatedUser();
var db = Database.Open("PhotoGallery");
var fileName = "";
var uploader = WebSecurity.CurrentUserId;
var date = DateTime.Now.Date;
var extention = "";
if(IsPost){
var numFiles = Request.Files.Count;
if(numFiles <= 0){
ModelState.AddError("fileUpload", "Please specify at least one photo to upload.");
}
else{
var fileSavePath = "";
var uploadedFile = Request.Files[0];
fileName = Path.GetFileNameWithoutExtension(uploadedFile.FileName).Trim();
extention = Path.GetExtension(uploadedFile.FileName).Trim();
string ndom = Path.GetRandomFileName();
var none = ndom.Remove(ndom.Length - 4);
fileSavePath = Server.MapPath("~/Images/userpics/" +
none + extention);
uploadedFile.SaveAs(fileSavePath);
string AppPath = Request.PhysicalApplicationPath;
string inputPath = AppPath + "~/Images/userpics/" + fileName + extention;
string outputPath = AppPath + "~/Images/userpics/" + fileName + ".flv";
string imgpath = AppPath + "~/Images/userpics/thumbnails/";
string cmd = " -i" + " " + inputPath + " " + outputPath;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = Server.MapPath("~/bin/ffmpeg.exe");
proc.StartInfo.Arguments = cmd;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
var insertCommand = "INSERT INTO Videos (FileTitle, UploadDate, UserId, ext, Name) Values(@0, @1, @2, @3, @4)";
db.Execute(insertCommand, fileName, date, uploader, extention, none + extention);
Response.Redirect(Href("~/Photo/View", db.GetLastInsertId()));
}
}
}
<h1>Upload Video</h1>
<form method="post" enctype="multipart/form-data">
@Html.ValidationSummary("Unable to upload:")
<fieldset class="no-legend">
<legend>Upload Photo</legend>
@FileUpload.GetHtml(addText: "Add more files", uploadText: "Upload", includeFormTag: false)
<p class="form-actions">
<input type="submit" value="Upload" title="Upload photo" />
</p>
</fieldset>
</form>
<p class="message info">
The maximum file size is 50MB.
</p>btw i thought i should mention ffmpeg.exe is in my websites bin directory (only ffmpeg.exe)