Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (111)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (10067)

  • Video width is different in different devices

    8 novembre 2017, par David

    I have a special video when i want to get this video’s width code returns different value for Samsung galaxy s6 and Samsung note 3. I tested many different codes and libraries, but result is the same.
    in Samsung galaxy s6 : 640x480
    in Samsung note 3 : 853x480
    when I open this video with Gspot program it shows :

    Recommended Display Size : 853x480

    and this is the same value is returned by our IOS app tested in Iphone 7. aspect radio is not the same and this is big problem.

    here is some of codes I tested :

    (1)

       MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
       metaRetriever.setDataSource(path);
       Bitmap bmp = metaRetriever.getFrameAtTime(-1);

       int height = bmp.getHeight();
       int width = bmp.getWidth();

    (2)

       MediaPlayer myMediaPlayer= MediaPlayer.create(ApplicationLoader.applicationContext,
                                        Uri.fromFile(new File(path)));

       width = myMediaPlayer.getVideoWidth();
       height = myMediaPlayer.getVideoHeight();

    (3)

    MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
           metaRetriever.setDataSource(path);
    String heights = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
           String widths = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
       int height = Integer.valueOf(heights);
           int width = Integer.valueOf(widths);

    (4)

     MediaPlayer myMediaPlayer= MediaPlayer.create(ApplicationLoader.applicationContext, Uri.fromFile(new File(path)));
               myMediaPlayer.setOnVideoSizeChangedListener((mp, width, height) -> {
           int videoWidth = width;
           int videoHeight = height;
       );
               myMediaPlayer.setDataSource(path);
               myMediaPlayer.prepare();

    FFmpegMediaMetadataRetriever, FFmpeg Java, ExoPlayer and some other libraries returns the same result.

  • ffmpeg conversion from Flac to Ogg produces corrupted files

    8 avril 2021, par experimental

    i transcoded flac files to ogg using this command

    


    ffmpeg -i input.flac -c:a libvorbis -b:a 500k  output.ogg


    


    yes i use 500k to keep the highest quality possible, some of the files are ok, but some of them can not be played - Unsupported format or corrupted file says the foobar - also my icecast streamer cant read it. So there is something wrong with the files.

    


    I believed it was due to the high bitrate so I tried

    


    ffmpeg -i input.flac -c:a libvorbis -b:a 320k  output.ogg


    


    the same happened, some files were ok, some were not playable.
so I tried again with default using this command

    


    ffmpeg -i input.flac -c:a libvorbis output.ogg


    


    same thing. some files were ok, some were corrupted and not playable.

    


    i have no clue why.

    


    both flac and ogg are in the same family, what happened during the transcoding that it became a corrupted file ?

    


    the spectral analysis does not show anything wrong - here it the ogg https://prnt.sc/115zdjl, here is the original flac https://prnt.sc/115zegw

    


    i am really interested what is going on and how to make it work ?

    


    can anyone explain ?

    


    here is complete log

    


        C:\Users\lukas.kotatko>ffmpeg -i "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac" -c:a libvorbis -b:a 500k "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg"
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.1 (GCC) 20200726
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, flac, from '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac':
  Metadata:
    GENRE           : Tribal / Ambient
    ORGANIZATION    : Waveform Records
    ISRC            : 01101-2
    COMMENT         : US reissue featuring the six original tracks plus two taken from the Invocation album.
    MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
    ORIGINALDATE    : 1993
    ORIGINALYEAR    : 1993
    RELEASETYPE     : album
    MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
    ALBUM           : One Thousand Years
    BARCODE         : 789060110125
    MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
    album_artist    : Tuu
    ALBUMARTISTSORT : Tuu
    ASIN            : B00005B9TT
    SCRIPT          : Latn
    RELEASESTATUS   : official
    LABEL           : Waveform Records
    CATALOGNUMBER   : 01101-2
    RELEASECOUNTRY  : US
    DATE            : 2001-05-08
    TOTALDISCS      : 1
    disc            : 1
    TOTALTRACKS     : 8
    MEDIA           : CD
    MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
    TITLE           : One Thousand Years
    MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
    ARTIST          : Tuu
    ARTISTSORT      : Tuu
    ARTISTS         : Tuu
    MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
    track           : 2
    TRACKTOTAL      : 8
    DISCTOTAL       : 1
  Duration: 00:08:03.67, start: 0.000000, bitrate: 792 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Cover (front)
Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg (native) -> theora (libtheora))
  Stream #0:0 -> #0:1 (flac (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[swscaler @ 0000015307581a00] deprecated pixel format used, make sure you did set range correctly
[ogg @ 00000153073f1680] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, ogg, to '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg':
  Metadata:
    GENRE           : Tribal / Ambient
    ORGANIZATION    : Waveform Records
    ISRC            : 01101-2
    COMMENT         : US reissue featuring the six original tracks plus two taken from the Invocation album.
    MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
    ORIGINALDATE    : 1993
    ORIGINALYEAR    : 1993
    RELEASETYPE     : album
    MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
    ALBUM           : One Thousand Years
    BARCODE         : 789060110125
    MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
    album_artist    : Tuu
    ALBUMARTISTSORT : Tuu
    ASIN            : B00005B9TT
    SCRIPT          : Latn
    RELEASESTATUS   : official
    LABEL           : Waveform Records
    CATALOGNUMBER   : 01101-2
    RELEASECOUNTRY  : US
    DATE            : 2001-05-08
    TOTALDISCS      : 1
    disc            : 1
    TOTALTRACKS     : 8
    MEDIA           : CD
    MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
    TITLE           : One Thousand Years
    MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
    ARTIST          : Tuu
    ARTISTSORT      : Tuu
    ARTISTS         : Tuu
    MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
    track           : 2
    TRACKTOTAL      : 8
    DISCTOTAL       : 1
    encoder         : Lavf58.45.100
    Stream #0:0: Video: theora (libtheora), yuv420p(progressive), 600x600 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic)
    Metadata:
      DESCRIPTION     : Cover (front)
      encoder         : Lavc58.91.100 libtheora
      GENRE           : Tribal / Ambient
      ORGANIZATION    : Waveform Records
      ISRC            : 01101-2
      MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
      ORIGINALDATE    : 1993
      ORIGINALYEAR    : 1993
      RELEASETYPE     : album
      MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
      ALBUM           : One Thousand Years
      BARCODE         : 789060110125
      MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
      ALBUMARTIST     : Tuu
      ALBUMARTISTSORT : Tuu
      ASIN            : B00005B9TT
      SCRIPT          : Latn
      RELEASESTATUS   : official
      LABEL           : Waveform Records
      CATALOGNUMBER   : 01101-2
      RELEASECOUNTRY  : US
      DATE            : 2001-05-08
      TOTALDISCS      : 1
      DISCNUMBER      : 1
      TOTALTRACKS     : 8
      MEDIA           : CD
      MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
      TITLE           : One Thousand Years
      MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
      ARTIST          : Tuu
      ARTISTSORT      : Tuu
      ARTISTS         : Tuu
      MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
      TRACKNUMBER     : 2
      TRACKTOTAL      : 8
      DISCTOTAL       : 1
    Stream #0:1: Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp (16 bit), 500 kb/s
    Metadata:
      encoder         : Lavc58.91.100 libvorbis
      GENRE           : Tribal / Ambient
      ORGANIZATION    : Waveform Records
      ISRC            : 01101-2
      DESCRIPTION     : US reissue featuring the six original tracks plus two taken from the Invocation album.
      MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50
      ORIGINALDATE    : 1993
      ORIGINALYEAR    : 1993
      RELEASETYPE     : album
      MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc
      ALBUM           : One Thousand Years
      BARCODE         : 789060110125
      MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
      ALBUMARTIST     : Tuu
      ALBUMARTISTSORT : Tuu
      ASIN            : B00005B9TT
      SCRIPT          : Latn
      RELEASESTATUS   : official
      LABEL           : Waveform Records
      CATALOGNUMBER   : 01101-2
      RELEASECOUNTRY  : US
      DATE            : 2001-05-08
      TOTALDISCS      : 1
      DISCNUMBER      : 1
      TOTALTRACKS     : 8
      MEDIA           : CD
      MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71
      TITLE           : One Thousand Years
      MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad
      ARTIST          : Tuu
      ARTISTSORT      : Tuu
      ARTISTS         : Tuu
      MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0
      TRACKNUMBER     : 2
      TRACKTOTAL      : 8
      DISCTOTAL       : 1
frame=    1 fps=0.1 q=-0.0 Lsize=   25860kB time=00:08:03.66 bitrate= 438.0kbits/s speed=44.6x
video:8kB audio:25721kB subtitle:0kB other streams:0kB global headers:7kB muxing overhead: 0.511663%


    


  • Error decoding a simple audio file using FFmpeg library

    29 mars 2017, par satyres

    After successfuly compiling the latest version of FFmpeg library and generated .a library in Ubuntu I’ve been struggling now for more than a week to decode and play a simple mp3 file in Android without a success !
    I’ve followed this tutorial given by FFmpeg team in Github i’ve tried to use it in Android but no luck !
    here is the Native code.

    void Java_com_example_home_hellondk_MainActivity_audio_1decode_1example(JNIEnv * env, jobject obj, jstring file, jbyteArray array) {
       jboolean isfilenameCopy;
       const char * filename = ( * env) - > GetStringUTFChars(env, file, &
           isfilenameCopy);
       jclass cls = ( * env) - > GetObjectClass(env, obj);
       jmethodID play = ( * env) - > GetMethodID(env, cls, "playSound", "([BI)V");
       AVCodec * codec;
       AVCodecContext * c = NULL;
       int len;
       FILE * f, * outfile;
       uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
       AVPacket avpkt;
       AVFrame * decoded_frame = NULL;

       av_init_packet( & avpkt);

       printf("Decode audio file %s \n", filename);
       LOGE("Decode audio file %s\n", filename);
       /* find the MPEG audio decoder */
       codec = avcodec_find_decoder(AV_CODEC_ID_MP3);
       if (!codec) {
           fprintf(stderr, "Codec not found\n");
           LOGE("Codec not found\n");
           exit(1);
       }

       c = avcodec_alloc_context3(codec);
       if (!c) {
           fprintf(stderr, "Could not allocate audio codec context\n");
           LOGE("Could not allocate audio codec context\n");
           exit(1);
       }

       /* open it */
       if (avcodec_open2(c, codec, NULL) < 0) {
           fprintf(stderr, "Could not open codec\n");
           LOGE("Could not open codec\n");
           exit(1);
       }

       f = fopen(filename, "rb");
       if (!f) {
           fprintf(stderr, "Could not open %s\n", filename);
           LOGE("Could not open %s\n", filename);
           exit(1);
       }


       /* decode until eof */
       avpkt.data = inbuf;
       avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);

       while (avpkt.size > 0) {
           int i, ch;
           int got_frame = 0;

           if (!decoded_frame) {
               if (!(decoded_frame = av_frame_alloc())) {
                   fprintf(stderr, "Could not allocate audio frame\n");
                   LOGE("Could not allocate audio frame\n");
                   exit(1);
               }
           }

           len = avcodec_decode_audio4(c, decoded_frame, & got_frame, & avpkt);
           if (len < 0) {
               fprintf(stderr, "Error while decoding\n");
               LOGE("Error while decoding\n");
               exit(1);
           }
           if (got_frame) {
               /* if a frame has been decoded, output it */
               int data_size = av_get_bytes_per_sample(c - > sample_fmt);
               if (data_size < 0) {
                   /* This should not occur, checking just for paranoia */
                   fprintf(stderr, "Failed to calculate data size\n");
                   LOGE("Failed to calculate data size\n");
                   exit(1);
               }
               if (data_size > 0) {

                   jbyte * bytes = ( * env) - > GetByteArrayElements(env, array, NULL);
                   memcpy(bytes, decoded_frame, got_frame); //
                   ( * env) - > ReleaseByteArrayElements(env, array, bytes, 0);
                   ( * env) - > CallVoidMethod(env, obj, play, array, got_frame);
                   LOGE("DECODING ERROR5");
               }
           }
           avpkt.size -= len;
           avpkt.data += len;
           avpkt.dts =
               avpkt.pts = AV_NOPTS_VALUE;
           if (avpkt.size < AUDIO_REFILL_THRESH) {
               /* Refill the input buffer, to avoid trying to decode
                * incomplete frames. Instead of this, one could also use
                * a parser, or use a proper container format through
                * libavformat. */
               memmove(inbuf, avpkt.data, avpkt.size);
               avpkt.data = inbuf;
               len = fread(avpkt.data + avpkt.size, 1,
                   AUDIO_INBUF_SIZE - avpkt.size, f);
               if (len > 0)
                   avpkt.size += len;
           }
       }


       fclose(f);

       avcodec_free_context( & c);
       av_frame_free( & decoded_frame);

    }

    The Java code :

    package com.example.home.hellondk;

    import android.media.AudioFormat;
    import android.media.AudioManager;
    import android.media.AudioTrack;
    import android.media.MediaPlayer;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.util.Log;

    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;

    public class MainActivity extends AppCompatActivity {
       static {
           System.loadLibrary("MyLibraryPlayer");
       }
       public native void createEngine();

       public native void audio_decode_example(String outfilename, byte[] array);



       private AudioTrack track;
       private FileOutputStream os;

       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_main);
           createEngine();

    /*        MediaPlayer mp = new MediaPlayer();
           mp.start();*/

           int bufSize = AudioTrack.getMinBufferSize(32000,
                   AudioFormat.CHANNEL_CONFIGURATION_STEREO,
                   AudioFormat.ENCODING_PCM_16BIT);

           track = new AudioTrack(AudioManager.STREAM_MUSIC,
                   32000,
                   AudioFormat.CHANNEL_CONFIGURATION_STEREO,
                   AudioFormat.ENCODING_PCM_16BIT,
                   bufSize,
                   AudioTrack.MODE_STREAM);

           byte[] bytes = new byte[bufSize];

           try {
               os = new FileOutputStream("/storage/emulated/0/Cloud Radio/a.out", false);
           } catch (FileNotFoundException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }
      audio_decode_example("/storage/emulated/0/Cloud Radio/test.mp3", bytes);

       }

       void playSound(byte[] buf, int size) {
           //android.util.Log.v("ROHAUPT", "RAH Playing");
           if (track.getPlayState() != AudioTrack.PLAYSTATE_PLAYING)
               track.play();
           track.write(buf, 0, size);

           try {
               os.write(buf, 0, size);
           } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }
       }
    }

    I always got this error : Error while decoding .
    i’ve tried to change the decoder "AV_CODEC_ID_MP3" no sucess !
    Thank you so much for your help.
    Kind regards