Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (18)

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

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

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (4380)

  • How to run a ffmpeg command in Powershell and pass variables to it ?

    22 avril 2021, par lucullus

    I would like to run the following command in Powershell :
ffmpeg -i "VIDEO.mp4" -i "AUDIO.m4a" -c copy -map 0:v:0 -map 1:a:0 "OUTPUT VIDEO.mp4"

    


    But I would like to browse for the files. I have tried this :

    


    Add-Type -AssemblyName System.Windows.Forms 

$VideoBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ 
    InitialDirectory = $PSCommandPath
    Filter = 'Video file (*.mp4)|*.mp4|All files (*.*)|*.*'
    Title = 'Choose video file'
}
$null = $VideoBrowser.ShowDialog()
if (!($VideoBrowser.FileName))
{
    return
}

$AudioBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ 
    Filter = 'Video file (*.m4a)|*.m4a|All files (*.*)|*.*'
    Title = 'Choose audio file'
    RestoreDirectory = $true
}
$null = $AudioBrowser.ShowDialog()
if (!($AudioBrowser.FileName))
{
    return
}

$NewVideoBrowser = New-Object System.Windows.Forms.SaveFileDialog -Property @{ 
    Filter = 'Video file (*.mp4)|*.mp4|All files (*.*)|*.*'
    Title = 'Save new video file as'
    RestoreDirectory = $true
}
$null = $NewVideoBrowser.ShowDialog()
if (!($NewVideoBrowser.FileName))
{
    return
}


    


    And all these ways to run the command but all fail :

    


    $ArgumentList = '"{0}" -i "{1}" -c copy -map 0:v:0 -map 1:a:0 "{2}"' -f $VideoBrowser.FileName, $AudioBrowser.FileName, $NewVideoBrowser.FileName;
Start-Process -FilePath ffmpeg.exe -ArgumentList $ArgumentList -Wait -NoNewWindow


    


    OR

    


    $ArgumentList = '"' + $VideoBrowser.FileName + '" -i "' + $AudioBrowser.FileName + '" -c copy -map 0:v:0 -map 1:a:0 "' + $NewVideoBrowser.FileName + '"'
Start-Process -FilePath ffmpeg.exe -ArgumentList $ArgumentList -Wait -NoNewWindow


    


    OR
ffmpeg.exe $VideoBrowser.FileName -i $AudioBrowser.FileName -c copy -map 0:v:0 -map 1:a:0 $NewVideoBrowser.FileName

    


    What should I try ?

    


  • JavaCV FFmpegFrameGrabber & Java2DFrameConverter creating weird looking image

    4 juin 2020, par mega12345mega

    I'm new to JavaCV, so the issue is probably very obvious. I'm trying to do the easy said, difficult done, task of getting the images and audio from a video so I can start making a video editor. After lots of confusion and errors, I am finally getting a result, but it is as odd as the errors. The image appears to be squished in the x direction, with the extra space to the right being transparent (so the image size matches the video's size). Additionally, it has a lot of extra transparent pixels and is multicolored in an odd way.

    



    What the image should look like : https://gofile.io/d/1lQnNd

    



    What the image looks like : https://gofile.io/d/kc09G7

    



    Here is my code :

    



    try {
    FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber("C:/Users/mega12345mega/Desktop/Test Files/video.mp4");
    frameGrabber.setFormat("mp4");
    frameGrabber.start();

    int width = frameGrabber.getImageWidth();
    int height = frameGrabber.getImageHeight();
    System.out.println("width: " + width + ", height: " + height);

    Frame frame = frameGrabber.grabImage();
    if (frame == null)
        throw new Exception("Frame is NULL!");
    if (frame.image == null)
        throw new Exception("Frame Image is NULL!");

    BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    if (bi == null)
        throw new Exception("bi is NULL!");

    Java2DFrameConverter.copy(frame, bi);
    ImageIO.write(bi, "png", new File("C:/Users/mega12345mega/Desktop/Test Files/img.png"));

    frameGrabber.stop();
    frameGrabber.close();
} catch (Exception e) {
    throw new Exception("Error Getting Image", e);
}


    



    If you are interested, here is the console :

    



    width: 1280, height: 720
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:/Users/mega12345mega/Desktop/Test Files/video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:04.95, start: 0.000000, bitrate: 16375 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 16401 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler


    



    Additionally, if I just do frameGrabber.grab() instead of frameGrabber.grabImage() (which I believe leaves out the audio), the frame's image property is null (that is what the frame.image == null statement is there for). I am not sure if that belongs in a new question, but help on that is also appreciated.

    



    Thanks in advance !

    


  • ffmpeg replace central channel with ffmpeg

    24 mai 2020, par Rafal B

    I'm trying to replace central channel in the movie (Movie-A) with another audio stream from another movie (Movie-B).
I was able to extract stereo stream from Movie-B :

    



    ffmpeg.exe" -i "Movie-B.mkv"

Stream #0:1(pol): Audio: ac3, 48000 Hz, stereo, fltp, 320 kb/s (default)


    



    and convert it to mono stream :

    



    ffmpeg.exe" -i "Movie-B.mkv" -vn -ab 320k -ac 1 "Movie-B-Audio.ac3"
Output #0, ac3, to 'Movie-B-Audio.ac3':
Stream #0:0(pol): Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s (default)


    



    For Movie-A :

    



    ffmpeg.exe" -i "Movie-B.mkv"
Stream #0:1(eng): Audio: aac (LC), 48000 Hz, 5.1, fltp (default)


    



    so Layout is 5.1 (FL+FR+FC+LFE+BL+BR), not 5.1(side) (FL+FR+FC+SL+SR)

    



    Media Info shows :

    



    Audio
ID: 2
Format: AAC
Format info: Advanced Audio Codec Low Complexity
Commercial name: AAC
Codec ID: A_AAC-2
Bit rate: 426 kb/s
Channel(s): 6 channels
Channel positions: Front: L C R, Side: L R, LFE
Channel layout: C L R Ls Rs LFE


    



    I have extracted all 6 channels into one stream with containing 6 channels :

    



    ffmpeg.exe" -i "Movie-A.mkv" -vn -ab 320k -ac 6 "Movie-A-Audio.ac3"
Output #0, ac3, to 'Movie-A-Audio.ac3':
Stream #0:0(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 320 kb/s (default)


    



    But at this stage I'm getting different Layout in Movie-A-Audio.ac3 :

    



    Audio
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Duration                                 : 2 h 16 min
Bit rate mode                            : Constant
Bit rate                                 : 320 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs


    



    In source Movie-A.mkv it is : Channel layout : C L R Ls Rs LFE

    



    In output Movie-A-Audio.ac3 it is : Channel layout : L R C LFE Ls Rs

    



    Then I tried to extract those 6 channels into separate mono-stream files :

    



    ffmpeg.exe" -i "Movie-A-Audio.ac3" -filter_complex "channelsplit=channel_layout=5.1[FL][FR][FC][LFE][BL][BR]" -ab 320k -ac 1 -map "[FL]" extr_front_left.ac3 -ab 320k -ac 1 -map "[FR]" extr_front_right.ac3 -ab 320k -ac 1 -map "[FC]" extr_front_center.ac3 -ab 320k -ac 1 -map "[LFE]" extr_subwoofer.ac3 -ab 320k -ac 1 -map "[BL]" extr_back_left.ac3 -ab 320k -ac 1 -map "[BR]" extr_back_right.ac3


    



    With result :

    



    Stream mapping:
  Stream #0:0 (ac3) -> channelsplit
  channelsplit:FL -> Stream #0:0 (ac3)
  channelsplit:FR -> Stream #1:0 (ac3)
  channelsplit:FC -> Stream #2:0 (ac3)
  channelsplit:LFE -> Stream #3:0 (ac3)
  channelsplit:BL -> Stream #4:0 (ac3)
  channelsplit:BR -> Stream #5:0 (ac3)
Press [q] to stop, [?] for help
Output #0, ac3, to 'extr_front_left.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3
Output #1, ac3, to 'extr_front_right.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #1:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3
Output #2, ac3, to 'extr_front_center.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #2:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3
Output #3, ac3, to 'extr_subwoofer.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #3:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3
Output #4, ac3, to 'extr_back_left.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #4:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3
Output #5, ac3, to 'extr_back_right.ac3':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #5:0: Audio: ac3, 48000 Hz, mono, fltp, 320 kb/s
    Metadata:
      encoder         : Lavc58.54.100 ac3


    



    When I'm checking channels layouts of those files extracted I see each of them is having Channel Layout marked with Central, for instant front_left.ac3 :

    



    Audio
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Duration                                 : 2 h 16 min
Bit rate mode                            : Constant
Bit rate                                 : 320 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 48.0 kHz


    



    Then I try to join needed channels :

    



    ffmpeg.exe" -i extr_front_left.ac3 -i extr_front_right.ac3 -i Movie-B-Audio.ac3 -i extr_back_left.ac3 -i extr_back_right.ac3 -i extr_subwoofer.ac3 -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1[a]" -map "[a]" "final-output.ac3


    



    But it is completely messed up : central channel (voice) is heard in front right speaker, in back right speaker is silence (or maybe it is subwoofer ?)

    



    Target is easy :

    



      

    1. convert source stereo central audio channel in Movie-B.mkv to mono channel
and
    2. 


    3. insert it as central channel into Movie-A.mkv that have 5.1 Audio stream with layout C L R Ls Rs LFE
    4. 


    



    So far I was able to complete 1. but I have a problem with mappings.
Can someone try to guide me how to do that ?