Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (103)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • 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 (8127)

  • How can I sync the frames of multiple videos from a multi-camera capture system using FFMPEG

    9 février 2023, par user9114146

    I have a multi-camera capture setup with 2 canon cameras. Each of these cameras have a tentacle sync e timecode generator connected to them.

    


    After a video capture with these 2 cameras, the generated timecode (SMPTE format) is stored in the video files metadata.

    


    It looks like this 00:00:53;30

    


    Is there a bash script that uses FFmpeg to trim the start time of the video that started earlier (based on timecode) to match the other and then trim the end time of the video that ended last to match the one that ended first ?

    


    The two trimmed output videos should be synced based on the timecode and have the same duration.

    


    So far, my bash script looks like this :

    


    file1="A001C002_220101EB_CANON.MXF"
file2="A001C002_220101US_CANON.MXF"

# Get the SMPTE timecodes of the two files
timecode1=$(ffmpeg -i "$file1" 2>&1 | sed -n 's/timecode.*: \(.*\)/\1/p')
timecode2=$(ffmpeg -i "$file2" 2>&1 | sed -n 's/timecode.*: \(.*\)/\1/p')

# Convert the SMPTE timecode to start time in seconds
start_time_1=$(echo "$timecode1" | awk -F ':' '{print 3600*$1 + 60*$2 + $3}')
start_time_2=$(echo "$timecode2" | awk -F ':' '{print 3600*$1 + 60*$2 + $3}')

# Trim the start of the video with the earlier start timecode so that both videos have the same start time
if [ "$start_time_1" -lt "$start_time_2" ]; then
  ffmpeg -i "$file1" -ss "$start_time_2" -c:v libx264 -crf 18 -preset veryfast trimmed_file1.mp4
  ffmpeg -i "$file2" -c:v libx264 -crf 18 -preset veryfast trimmed_file2.mp4
else
  ffmpeg -i "$file2" -ss "$start_time_1" -c:v libx264 -crf 18 -preset veryfast trimmed_file2.mp4
  ffmpeg -i "$file1" -c:v libx264 -crf 18 -preset veryfast trimmed_file1.mp4
fi

# Get the duration of both files
duration_1=$(ffmpeg -i trimmed_file1.mp4 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//)
duration_2=$(ffmpeg -i trimmed_file2.mp4 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//)

# Convert the duration to seconds
duration_1_secs=$(echo $duration_1 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')
duration_2_secs=$(echo $duration_2 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')

# Trim the end time of the video that ended last to match the one that ended first
if [ "$duration_1_secs" -gt "$duration_2_secs" ]; then
  echo "Trimming end time of file1 to match file2"
  ffmpeg -i trimmed_file1.mp4 -t "$duration_2" -c:v libx264 -c:a aac trimmed_file1.mp4
else
  echo "Trimming end time of file2 to match file1"
  ffmpeg -i trimmed_file2.mp4 -t "$duration_1" -c:v libx264 -c:a aac trimmed_file2.mp4
fi


    


    But this does not make the videos have matching frames.

    


    Thanks !

    


  • dashenc : Write segment timelines properly if the timeline has gaps

    28 novembre 2014, par Martin Storsjö
    dashenc : Write segment timelines properly if the timeline has gaps
    

    Write a new start time if the duration of the previous segment
    didn’t match the start of the next one. Check that segments
    actually are continuous before writing a repeat count.

    This makes sure timestamps deduced from the timeline actually
    match the real start timestamp as written in filenames (if
    using a template containing $Time$).

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavformat/dashenc.c
  • How to read percentage from ffmpeg command in java ?

    23 juillet 2019, par Prasab R

    I am trying to convert video file to specific format by executing ffmpeg command. In that process I want to read percentage by using timepattern format. Somehow I am not able to do it.

    I have tried using the below code. Specially I am getting null in the while loop condition.

    import java.io.*;
    import java.util.Scanner;
    import java.util.regex.Pattern;

    class Test {
     public static void main(String[] args) throws IOException {
       ProcessBuilder pb = new ProcessBuilder("ffmpeg","-i","in.webm","out.mp4");
       final Process p = pb.start();

       new Thread() {
         public void run() {

           Scanner sc = new Scanner(p.getErrorStream());

           // Find duration
           Pattern durPattern = Pattern.compile("(?&lt;=Duration: )[^,]*");
           String dur = sc.findWithinHorizon(durPattern, 0);
           if (dur == null)
             throw new RuntimeException("Could not parse duration.");
           String[] hms = dur.split(":");
           double totalSecs = Integer.parseInt(hms[0]) * 3600
                            + Integer.parseInt(hms[1]) *   60
                            + Double.parseDouble(hms[2]);
           System.out.println("Total duration: " + totalSecs + " seconds.");

           // Find time as long as possible.
           Pattern timePattern = Pattern.compile("(?&lt;=time=)[\\d.]*");
           String match;
           while (null != (match = sc.findWithinHorizon(timePattern, 0))) {
             double progress = Double.parseDouble(match) / totalSecs;
             System.out.printf("Progress: %.2f%%%n", progress * 100);
           }
         }
       }.start();

     }
    }

    I am expecting a value in the while condition, but it coming as null.enter code here