Advanced search

Medias (0)

Tag: - Tags -/médias

No media matches your criterion on the site.

Other articles (64)

  • Other interesting software

    13 April 2011, by

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website: http://videopress.com/
    License: GNU/GPL v2
    Source code: (...)

  • Des sites réalisés avec MediaSPIP

    2 May 2011, by

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Taille des images et des logos définissables

    9 February 2011, by

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

On other websites (4349)

  • After transcoding using ffmpeg, I found audio bitrate is not the value I expected

    16 May 2017, by penny

    I used ffmpeg to transcode some files into new format and with certain parameters. After transcoding, I found some output file’s metadata is not what I expected, the output value is not the same with I set in the cmd line.

    Before transcoding I check the media info of the inputfile:

    ffmpeg -i dz2015082000010.mpg

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
    configuration: —enable-static —enable-memalign-hack —enable-libx264
    —enable-gpl —enable-pthreads —enable-version3 —enable-avisynth —enable-bzlib —enable-iconv —enable-zlib —enable-nonfree —extra-cflags=-I/usr/local/include/ —extra-ldflags=-L/usr/local/lib —enable-debug=3 —disable-optimizations —enable-nonfree —enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 /
    57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 /
    54. 1.100 Input #0, mpeg, from ’dz2015082000010.mpg’: Duration: 00:01:49.30, start: 0.685389, bitrate: 15723 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr,
    90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s At least one output file must be specified

    Next, transcoding with the cmd line:

    ffmpeg -i dz2015082000010.mpg -vcodec libx264 -b:v 4000k -s 1920x1080 -r 25 -g 25  -vprofile main -acodec aac -strict -2 -b:a 128k -ac 2 -ar 44100 -y output.ts

    After transcoding, I check the media info of the output file:

    ffmpeg -i output.ts    

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat
    4.8.3-9) configuration: —enable-static —enable-memalign-hack —enable-libx264 —enable-gpl —enable-pthreads —enable-version3 —enable-avisynth —enable-bzlib —enable-iconv —enable-zlib —enable-nonfree —extra-cflags=-I/usr/local/include/ —extra-ldflags=-L/usr/local/lib —enable-debug=3 —disable-optimizations —enable-nonfree —enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101
    / 57. 64.101 libavformat 57. 56.101 / 57. 56.101
    libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100
    / 6. 65.100 libswscale 4. 2.100 / 4. 2.100
    libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100
    / 54. 1.100 Input #0, mpegts, from ’full-2.ts’: Duration:
    00:01:49.30, start: 1.456778, bitrate: 4455 kb/s Program 1
    Metadata:
    service_name : Service01
    service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr,
    90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 4 kb/s At least one output file must be
    specified

    I don’t know why the audio bitrate is changed to 4 kb/s after transcoding, I set the value with -b:a 128k before, anybody can help me? BTW, the output file sounds all right.

  • Reading raw audio samples from a video file using python and ffmpeg

    22 February 2017, by CaptainStiggz

    I want to extract raw audio samples for use with numpy from a video clip. I’m pretty close, but the problem is the audio frequency/timescale seems off. I can hear the sound playback, but it’s lower pitched than it should be. Here’s the code:

    file = 'recordings/sample.mp4'
    audio_frequency = 44100
    audio_channels = 2
    audio_bits_per_sample = 16

    command = [ FFMPEG_BIN,
       '-i', file,
       '-f', 's%dle'%(audio_bits_per_sample),
       '-acodec', 'pcm_s%dle'%(audio_bits_per_sample),
       '-ar', '%d'%(audio_frequency), # ouput will have 44100 Hz
       '-ac', '%d'%(audio_channels), # stereo (set to '1' for mono)
       '-']
    apipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE, stdin=open(os.devnull), bufsize=10**8)

    # pygame audio player
    pygame.init()
    pygame.mixer.init(audio_frequency, -audio_bits_per_sample, audio_channels) # ex: 44100 Hz, 16bit, 2 channels

    # read audio pipe samples for some duration
    def read_audio_from_pipe(pipe, duration):
      bytes_per_sample = int(audio_bits_per_sample / 8)
      frame_size = bytes_per_sample * audio_channels # convert bits/sample to bytes, mult by channels

      # get the audio frame
      raw_audio = pipe.stdout.read(audio_frequency * frame_size * duration)
      apipe.stdout.flush()

      # Reorganize raw_audio as a Numpy array with two-columns (1 per channel)
      audio_array = numpy.fromstring(raw_audio, dtype='int%d'%(audio_bits_per_sample))
      audio_array = audio_array.reshape(int(len(audio_array)/audio_channels), audio_channels)

      sound = pygame.sndarray.make_sound(audio_array)
      sound.play()


    read_audio_from_pipe(apipe, 2)

    The blog post that got me started is here.

    I’m not sure if the problem is in the ffmpeg re-encode, the sampling code, or the pygame mixer. I ran a few tests using ffmpeg from the command line, to see if any settings seemed fishy.

    This worked (produced a playable WAV file that sounds like the original):

    ffmpeg -i recordings/sample.mp4 -acodec pcm_s16le -ac 2 -ar 44100 recordings/sample.wav

    And this fails: (produces an unplayable WAV file)

    ffmpeg -i recordings/sample.mp4 -f s16le -acodec pcm_s16le -ac 2 -ar 44100 recordings/sample.wav

    It seems from the command line -f s16le causes ffmpeg to output garbage. However, if I omit this parameter in my python script, I don’t hear anything at all.

    EDIT: I noticed that, though I was requesting 2sec of playback, I was hearing 4sec of audio. That explains the low pitch output. First I tried:

    pygame.mixer.init(2*audio_frequency, -audio_bits_per_sample, audio_channels)

    No luck. Next I tried:

    audio_array = numpy.fromstring(raw_audio, dtype='int%d'%(2*audio_bits_per_sample))

    This works! But it’s a total hack and I’m at a loss for why it is necessary here. The audio data should be coming in in 16bits/sample, but numpy.fromstring seems to expect 32 bit integers?

  • FFmpeg: -vn option ("no video") ignored

    8 April 2014, by Zumteufel

    I'm having trouble converting and stripping the video part from a video when converting to Ogg and WMA. I'm using the same arguments (apart from the codec) when converting to MP3, and in that case it works as expected.

    Example:

    $ ffmpeg -y -i {input} -vn -ar 44100 -ac 2 -ab 192k -acodec libvorbis -threads 2 {output}

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
     built on May 13 2013 14:06:15 with gcc 4.0.1 (GCC) (Apple Inc. build 5493)
     configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --arch=x86 --enable-runtime-cpudetect
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/jan/Temporary files/b1c5375e311561d509d51c5aadd3162c.part':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2013-12-22 02:38:16
     Duration: 00:01:28.38, start: 0.000000, bitrate: 1143 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 949 kb/s, 29.97 fps, 29.97 tbr, 60k tbn, 59.94 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s
       Metadata:
         creation_time   : 2013-12-22 02:38:16
         handler_name    : IsoMedia File Produced by Google, 5-11-2011
    [flac @ 0x323bc20] encoding as 24 bits-per-sample
    Output #0, ogg, to '/Users/jan/Temporary files/What's this? Amazing brain test!!! Are you different?.ogg':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       title           : What's this? Amazing brain test!!! Are you different?
       author          : Unknown
       artist          : Unknown
       comment         :
       encoder         : Lavf54.63.104
       Stream #0:0(und): Audio: vorbis, 44100 Hz, stereo, fltp, 192 kb/s
       Metadata:
         creation_time   : 2013-12-22 02:38:16
         handler_name    : IsoMedia File Produced by Google, 5-11-2011
    Output #1, ogg, to '/Users/jan/Temporary files/What's this? Amazing brain test!!! Are you different?.ogg':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       encoder         : Lavf54.63.104
       Stream #1:0(und): Video: theora, yuv420p, 1280x720, q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
       Metadata:
         handler_name    : VideoHandler
       Stream #1:1(und): Audio: flac, 44100 Hz, stereo, s32, 128 kb/s
       Metadata:
         creation_time   : 2013-12-22 02:38:16
         handler_name    : IsoMedia File Produced by Google, 5-11-2011
    Stream mapping:
     Stream #0:1 -> #0:0 (aac -> libvorbis)
     Stream #0:0 -> #1:0 (h264 -> libtheora)
     Stream #0:1 -> #1:1 (aac -> flac)

    The interesting part is the last lines, the stream mapping:

    Stream mapping:
     Stream #0:1 -> #0:0 (aac -> libvorbis)
     Stream #0:0 -> #1:0 (h264 -> libtheora)
     Stream #0:1 -> #1:1 (aac -> flac)

    Where does the flac stream come from? Why is the H.264 stream converted with libtheora, when I have told FFmpeg to ignore video with the -vn option?

    If using same procedure as above, but using the libmp3lame codec, I get

    Stream mapping:
     Stream #0:1 -> #0:0 (aac -> libmp3lame)
     Stream #0:1 -> #1:0 (aac -> libmp3lame)

    which is expected.

    Does anyone have any input?

    Thanks in advance!