Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (36)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (7779)

  • FFMPEG - Get the exact calculated audio filesize after encode

    14 janvier 2016, par Youssef El Gharbaoui

    Im trying to guess an audio (mp3) filesize before encode with ffmpeg, afterward, need to have the exact calculated filesize.

    Here is the formula im using to predict and calculate the filesize (hope im not wrong) :

    ( Bitrates x Duration ) / 8) x 1000 = Filesize in Bytes.

    Im going to give a real example so that everyone can understand the use case.

    Example :

    Having an m4a file with the following data :

    • Name : Assuming xxx.m4a
    • Filesize : 8 304 014 bytes (8,3 Mo)
    • Bitrates : 256k
    • Duration : 260 seconds

    Expected filesize : ( (256 x 260) / 8 ) x 1000 = 8 320 000 bytes

    Then im running the following ffmpeg command :

    ffmpeg -i xxx.m4a -f mp3 -y -minrate 256k -maxrate 256k -bufsize 256k -b:a 256k -fs 8320000 output.mp3

    Console output :

    ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
     built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang     --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
     libavutil      54. 27.100 / 54. 27.100
     libavcodec     56. 41.100 / 56. 41.100
     libavformat    56. 36.100 / 56. 36.100
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 16.101 /  5. 16.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.100 /  1.  2.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'xxx.m4a':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2mp41
       encoder         : Lavf56.36.100
     Duration: 00:04:20.53, start: 0.000000, bitrate: 254 kb/s
       Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 253 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Output #0, mp3, to 'output.mp3':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2mp41
       TSSE            : Lavf56.36.100
       Stream #0:0(und): Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp, 256 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
         encoder         : Lavc56.41.100 libmp3lame
    Stream mapping:
     Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    size=    8127kB time=00:04:20.02 bitrate= 256.1kbits/s    
    video:0kB audio:8127kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.011765%    

    Problem and Questions :

    • Can you tell me why im I getting an output with 8 322 546 bytes and
      not 8 320 000 as expected ?
    • Is there something wrong in my formula or the ffmpeg command ?
    • What solution can you suggest to get the exact predicted filesize ?

    Thank you in advance.

  • passing script variable of filename with spaces in bash to external program (ffmpeg) fails

    13 janvier 2016, par BostonScott

    Short story : I’m trying to write a script that will use FFmpeg to convert the many files stored in one directory to a "standard" mp4 format and save the converted files in another directory. It’s been a learning experience (a fun one !) since I haven’t done any real coding since using Pascal and FORTRAN on an IBM 370 mainframe was in vogue.

    Essentially the script takes the filename, strips the path and extension off it, reassembles the filename with the path and an mp4 extension and calls FFmpeg with some set parameters to do the conversion. If the directory contains only video files with without spaces in the names, then everything works fine. If the filenames contain spaces, then FFmpeg is not able to process the file and moves on to the next one. The error indicates that FFMpeg is only seeing the filename up to the first space. I’ve included both the script and output below.

    Thanks for any help and suggestions you may have. If you think I should be doing this in another way, please by all means, give me your suggestions. As I said, it’s been a long time since I did anything like this. I’m enjoying it though.

    I’ve include the code first followed by example output.

    for file in ./TBC/*.mp4
       do

       echo "Start of iteration"
       echo "Full text of file name:" $file

       #Remove everything up to  "C/" (filename without path)
       fn_orig=${file#*C/}
       echo "Original file name:" $fn_orig

       #Length of file name
       fn_len=${#fn_orig}
       echo "Filename Length:" $fn_len

       #file name without path or extension
       fn_base=${fn_orig:0:$fn_len-4}
       echo "Base file name:" $fn_base

       #new filename suffix
       newsuffix=".conv.mp4"

       fn_out=./CONV/$fn_base$newsuffix
       echo "Converted file name:" $fn_out

       ffmpeg -i $file -metadata title="$fn_orig" -c:v libx264 -c:a libfdk_aac -b:a 128k $fn_out

       echo "End of iteration"
       echo
       done
    echo "Script completed"

    With the ffmpeg line commented out, and two files in the ./TBC directory, this is the output that I get

       Start of iteration
       Full text of file name: ./TBC/Test file with spaces.mp4
       Original filename: Test file with spaces.mp4
       Filename Length: 25
       Base filename: Test file with spaces
       Converted file name: ./CONV/Test file with spaces.conv.mp4
       End of iteration

       Start of iteration
       Full text of file name: ./TBC/Test_file_with_NO_spaces.mp4
       Original file name: Test_file_with_NO_spaces.mp4
       Filename Length: 28
       Base file name: Test_file_with_NO_spaces
       Converted file name: ./CONV/Test_file_with_NO_spaces.conv.mp4
       End of iteration

       Script completed

    I won’t bother to post the results when ffmpeg is uncommented, other than to state that it fails with the error :
    ./TBC/Test : No such file or directory

    The script then continues to the next file which completes successfully because it has no spaces in its name. The actual filename is "Test file with spaces.mp4" so you can see that ffmpeg stops after the word "Test" when it encounters a space.

    I hope this has been clear and concise and hopefully someone will be able to point me in the right direction. There is a lot more that I want to do with this script such as parsing subdirectories and ignoring non-video files, etc.

    I look forward to any insight you can give !

  • How do you create a crossfade transition between multiple videos in FFMPEG ?

    5 janvier 2016, par Katie Yamato

    I am currently looping MP4 videos with audio through FFMPEG. Here is the code

    del intermediate1.ts
    del f.txt
    echo file intermediate1.ts>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt
    echo file intermediate1.ts>>f.txt

    ffmpeg -i "SHORT MUSIC.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts -nostdin
    ffmpeg -f concat -i f.txt -c copy -bsf:a aac_adtstoasc "LONG MUSIC.mp4" -nostdin

    However, the transition between each instance of the videos is not smooth. It cuts off as the next instance is shown. Would there be a way create a blend/crossfade transition for the videos ?

    I have come across this method however, it is only for 2 videos
    http://superuser.com/questions/778762/crossfade-between-2-videos-using-ffmpeg

    Hope someone can help me !
    Thank you very much !!