Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (104)

  • Participer à sa traduction

    10 avril 2011

    Vous 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, par

    Formulaire 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, par

    Les 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 R

    I 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 Danny

    I 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 in media/videos/videos/<filename>.mp4</filename> but the path in database will be media/<filename>.mp4</filename> somehow and thus template can't play the video.

    &#xA;

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

    &#xA;

    views.py

    &#xA;

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

    &#xA;

    encoding.py

    &#xA;

    def encode_video(video_id):&#xA;    video = VideoPost.objects.get(id = video_id)&#xA;    input_file_path = video.temp_file.path&#xA;    # print(input_file_path)&#xA;    input_file_name = video.title&#xA;    #get the filename (without extension)&#xA;    filename = os.path.basename(input_file_path)&#xA;    # print(filename)&#xA;    # path to the new file, change it according to where you want to put it&#xA;    output_file_name = os.path.join(&#x27;{}.mp4&#x27;.format(filename))&#xA;    # print(output_file_name)&#xA;    # output_file_path = os.path.join(settings.MEDIA_ROOT, output_file_name)&#xA;    output_file_path = os.path.join(settings.MEDIA_ROOT, &#x27;videos&#x27;, &#x27;videos&#x27;, output_file_name)&#xA;    # print(output_file_path)&#xA;&#xA;    for i in range(1):&#xA;        subprocess.call([settings.VIDEO_ENCODING_FFMPEG_PATH, &#x27;-i&#x27;, input_file_path, &#x27;-codec:v&#x27;, &#x27;libx264&#x27;, &#x27;-crf&#x27;, &#x27;-preset&#x27;,&#xA;                    &#x27;-b:v&#x27;, &#x27;3000k&#x27;, &#x27;-maxrate&#x27;, &#x27;-bufsize&#x27;, &#x27;6000k&#x27;, &#x27;-vf&#x27;, &#x27;scale=-2:720&#x27;,&#xA;                    &#x27;-codec:a&#x27;, &#x27;aac&#x27;, &#x27;128k&#x27;, &#x27;-strict&#x27;, &#x27;-2&#x27;, output_file_path])&#xA;    # Save the new file in the database&#xA;    video.file = output_file_name&#xA;    video.save(update_fields=[&#x27;file&#x27;])&#xA;    print(video.file)&#xA;    video.temp_file.delete()&#xA;

    &#xA;

    models

    &#xA;

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

    &#xA;

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

    &#xA;

  • ffmpeg isnt working or giving errors

    19 avril 2014, par user3549636

    FFmpeg 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 &lt;= 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)