Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (37)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • L’espace de configuration de MediaSPIP

    29 novembre 2010, par

    L’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
    Il permet de configurer finement votre site.
    La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (8018)

  • FFMPEG : Converting from raw audio to audio/mp4 (audio is being converted with slow speed)

    29 décembre 2017, par Valdir

    If I convert from mp3 to mp4 directly everything works perfectly. But if I try to convert from raw pcm, the audio speed is slowed down.

    I’ve tried the following (this works) :

    ffmpeg -i mp3/1.mp3 -strict -2 final.mp4

    This doesn’t work as expected :

    ffmpeg -f s16le -i final.raw -strict -2 -r 26 final.mp4

    With the following output :

    Input #0, s16le, from 'final.raw':
     Duration: 00:08:37.38, bitrate: 705 kb/s
       Stream #0:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
    File 'final.mp4' already exists. Overwrite ? [y/N] y
    Output #0, mp4, to 'final.mp4':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc56.60.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
    Press [q] to stop, [?] for help
    size=    8273kB time=00:08:37.38 bitrate= 131.0kbits/s
    video:0kB audio:8185kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.073808%

    I’ve tried to set parameters like :

    ffmpeg -ar 44100 -f s16le -i final.raw -strict -2 -r 26 final.mp4

    With no luck.

    In order to get the PCM from mp3 I’m using nodejs lame decoder :

    var decoder = new lame.Decoder({
           channels: 2,
           bitDepth: 16,
           sampleRate: 44100,
           bitRate: 128,
           outSampleRate: 44100, // 22050
           mode: lame.STEREO
       });
  • Nix package : Pass build flag —extra-cflags to ffmpeg at compile time

    13 mai 2024, par catleeball

    I'm a little inexperienced with Nix and NixOS and am struggling a bit with this ffmpeg source build. Any advice is appreciated !

    


    Goal

    


    Build ffmpeg from source with --extra-cflags="-pipe -O3 -march=znver3 -ffat-lto-objects", ideally using a flake or overlay or similar so that I can build off the existing ffmpeg nix package and maybe even reproducible builds.

    


    Attempts

    


    I've been trying to follow different advice I've seen online, but looking at ffmpeg in nixpkgs, I'm not sure what I could patch or override. Since configureFlags happens inside the stdenv.mkderivation block, when I try to override it, it doesn't seem to have scope into this variable (and since the derivation explicitly sets onfigurePlatforms = [];, I'm not sure if that would clobber the override changes unless I tried to override the whole long derivation).

    


    Looking at the ffmpeg configure script, it seemed like environment variable cflags / cxxflags won't be respected, but it will take them from the --extra-cflags argument, but I could be missing something.

    


    Flake attempt

    


    Here's an example flake.nix I forked from an example I saw at this github repo

    


    {
  description = "A full build of ffmpeg, including the proprietary stuff";

  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true;
        };

        overrides = {
          ffmpeg = pkgs.ffmpeg-full;
          # If this did work, I'm not sure how it would combine with the derivation in the existing package, e.g. if it would get overridden
          configureFlags = [ "--extra-cflags -march=znver3 -O3 -pipe -ffat-lto-objects" ];
          withHeadlessDeps = true;
          nonfreeLicensing = true;
          # more options here once things are working above
        };
      in
      rec {
        packages.ffmpeg-custom = pkgs.ffmpeg-full.override overrides;
        defaultPackage = packages.ffmpeg-custom;
      }
    );
}


    


    when building with nix profile install, I encounter the error :

    


           error: function 'anonymous lambda' called with unexpected argument 'configureFlags'

       at /nix/store/d9wpzgyjlpw1424kw2lyilah6690fnk3-source/pkgs/development/libraries/ffmpeg-full/default.nix:1:1:

            1| { lib, stdenv, buildPackages, ffmpeg, addOpenGLRunpath, pkg-config, perl, texinfo, yasm
             | ^
            2| /*


    


    presumably since configureFlags is defined in the derivation in the original package.

    


    Overlay in configuration.nix attempt

    


    I tried adding this to my /etc/nixos/configuration.nix also without success :

    


    nixpkgs.overlays = [
  (self: super: {
    ffmpeg-full = super.ffmpeg-full.override {
      configureFlags = [
        "--enable-hardcoded-tables"
        "--extra-cflags -march=znver3 -O3 -pipe -ffat-lto-objects"
      ] ++ super.ffmpeg-full.configureFlags;
    };
  })
];


    


    when building with nixos-rebuild switch I get the same error :

    


           error: function 'anonymous lambda' called with unexpected argument 'configureFlags'

       at /nix/store/amxbqlhq11xfrbs4vdsyi04fap0abx0v-nixos-23.11/nixos/pkgs/development/libraries/ffmpeg/generic.nix:3:1:

            2|
            3| { lib, stdenv, buildPackages, removeReferencesTo, addOpenGLRunpath, pkg-config, perl, texinfo, yasm
             | ^
            4|


    


    Context

    


    I have a NixOS machine that does very long-running ffmpeg encodes nearly all the time. I was hoping to rebuild headless ffmpeg with more aggressive cflags and maybe some extra options. I hope to benchmark performance differences between different builds.

    


    I'll probably use this as an excuse to also build ffmpeg with some extra nonfree dependencies too.

    


  • Concatenate / Join MP4 files using ffmpeg and windows command line batch NOT LINUX

    10 septembre 2022, par julesverne

    I've written a batch script that attempts to take a generic introductory title video (MP4) that runs for 12 seconds and attaches it to the beginning of 4 other MP4 videos (same video but each has a different language audio track)

    



    According to ffmpeg syntax here : http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files the concat demuxer needs to be run from a text file that looks like this :

    



    # this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'


    



    I believe everything in my script up until the point of joining the files appears to be working correctly. But I get this error :

    



    [concat @ 04177d00] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\frenchfile.mp4'
filelistFrench.txt: Invalid data found when processing input
[concat @ 03b70a80] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\spanishfile.mp4'
filelistSpanish.txt: Invalid data found when processing input
[concat @ 0211b960] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\basquefile.mp4'
filelistBasque.txt: Invalid data found when processing input
[concat @ 03a20a80] Line 2: unknown keyword ''C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4'
filelistEnglish.txt: Invalid data found when processing input


    



    I believe the issue lies in the text file I'm creating. Please excuse my n00b ignorance, but sometimes new script makers like myself get confused about developer jargon and may take things literally.

    



    So when I look at that example text file they gave, am I correct in thinking THIS is what my text file should look like ?

    



    # this is a comment
Titlefile.mp4 'C:\Users\Joe\1May\session3\readyforfinalconversion\Titlefile.mp4'
Englishfile.mp4 'C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4'


    



    Again, am I being too literal ? are the quotations correct ? Are the slashes correct ? In the example they provide the slashes in the path are / instead of normal windows \ . I'll provide the entire script in case it helps.

    



    @echo off

setlocal EnableDelayedExpansion

rem Create an array of languages
set i=0
for %%a in (French Spanish Basque English) do (
   set /A i+=1
   set term[!i!]=%%a
)

rem Get the title video file name from user

set /p titlevideofilename=What is the title video file 

name?

rem create a path variable for the title video file

set pathtotitlevideo=%~dp0%titlevideofilename%

rem Get the names of the different language video files to append to the title video
rem create a path variable for each different language video files

for /L %%i in (1,1,4) do (
   set /p language[%%i]=what is the name of the !term

[%%i]! file you want to append after the title video?
   set pathtofile[%%i]=%~dp0!language[%%i]!
)

rem create data file for ffmpeg based on variable data

for /L %%i in (1,1,4) do (
    echo # this is a comment>>filelist!term[%

%i]!.txt
    echo file '%pathtotitlevideo%'>>filelist!term[%

%i]!.txt
    echo file '!pathtofile[%%i]!'>>filelist!term[%

%i]!.txt
)

cls

rem join files using ffmpeg concat option

for /L %%i in (1,1,4) do (
   c:\ffmpeg\ffmpeg\bin\ffmpeg.exe -loglevel error -f 

concat -i filelist!term[%%i]!.txt -c copy !language[%

%i]!.!term[%%i]!.withtitle.mp4
)

endlocal

:eof
exit


    



    EDIT
    
Thanks to @foxidrive making me look at the simplicity of it... it occurred to me that Apparently I wasn't being literal enough. I made these 3 changes and script works perfectly now
1 : "file" in there example literally meant the word "file" 
2 : needed the use of single quotes not double quotes as it shows in there example. 
3 : Used "\" instead of "/" as they have in there example.

    



    So NOW my code to create the text files looks like this :

    



    rem create data file for ffmpeg based on variable data

for /L %%i in (1,1,4) do (
    echo # this is a comment>>filelist!term[%

%i]!.txt
    echo file '%pathtotitlevideo%'>>filelist!term[%

%i]!.txt
    echo file '!pathtofile[%%i]!'>>filelist!term[%

%i]!.txt
)


    



    So NOW my text file looks like this :

    



    # this is a comment    
file 'C:\Users\Joe\1May\session3\readyforfinalconversion\Titlefile.mp4'
file 'C:\Users\Joe\1May\session3\readyforfinalconversion\Englishfile.mp4'