Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (32)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5340)

  • Merge commit 'a25dac976a4478331e4db86d44c3db4456c93eff'

    27 septembre 2017, par James Almer
    Merge commit 'a25dac976a4478331e4db86d44c3db4456c93eff'
    

    * commit 'a25dac976a4478331e4db86d44c3db4456c93eff' :
    Use bitstream_init8() where appropriate

    This commit is a noop, see
    http://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209609.html

    Merged-by : James Almer <jamrial@gmail.com>

  • Android. Problems with AudioTrack class. Sound sometimes lost

    29 janvier 2014, par bukka.wh

    I have found open source video player for Android, which uses ffmpeg to decode video.
    I have some problems with audio, that sometimes plays with jerks, but video picture is shown well. The basic idea of player is that audio and video are decoded in two different streams, and then in the third stream the are passed back, video picture is shown on SurfaceView and video sound is passed in byte array to AudioTrack and then plays. But sometimes sound is lost or playing with jerks. Can anyone give me start point for what to do (some basic concepts). May be I should change buffer size for AudioTrack or add some flags to it. Here is a piece of code, where AudioTrack class is created.

    private AudioTrack prepareAudioTrack(int sampleRateInHz,
           int numberOfChannels) {

       for (;;) {
           int channelConfig;
           if (numberOfChannels == 1) {
               channelConfig = AudioFormat.CHANNEL_OUT_MONO;
           } else if (numberOfChannels == 2) {
               channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
           } else if (numberOfChannels == 3) {
               channelConfig = AudioFormat.CHANNEL_OUT_FRONT_CENTER
                       | AudioFormat.CHANNEL_OUT_FRONT_RIGHT
                       | AudioFormat.CHANNEL_OUT_FRONT_LEFT;
           } else if (numberOfChannels == 4) {
               channelConfig = AudioFormat.CHANNEL_OUT_QUAD;
           } else if (numberOfChannels == 5) {
               channelConfig = AudioFormat.CHANNEL_OUT_QUAD
                       | AudioFormat.CHANNEL_OUT_LOW_FREQUENCY;
           } else if (numberOfChannels == 6) {
               channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
           } else if (numberOfChannels == 8) {
               channelConfig = AudioFormat.CHANNEL_OUT_7POINT1;
           } else {
               channelConfig = AudioFormat.CHANNEL_OUT_STEREO;
           }
           try {
               Log.d("MyLog","Creating Audio player");
               int minBufferSize = AudioTrack.getMinBufferSize(sampleRateInHz,
                       channelConfig, AudioFormat.ENCODING_PCM_16BIT);
               AudioTrack audioTrack = new AudioTrack(
                       AudioManager.STREAM_MUSIC, sampleRateInHz,
                       channelConfig, AudioFormat.ENCODING_PCM_16BIT,
                       minBufferSize, AudioTrack.MODE_STREAM);
               return audioTrack;
           } catch (IllegalArgumentException e) {
               if (numberOfChannels > 2) {
                   numberOfChannels = 2;
               } else if (numberOfChannels > 1) {
                   numberOfChannels = 1;
               } else {
                   throw e;
               }
           }
       }
    }

    And this is a piece of native code where sound bytes are written to AudioTrack

    int player_write_audio(struct DecoderData *decoder_data, JNIEnv *env,
       int64_t pts, uint8_t *data, int data_size, int original_data_size) {
    struct Player *player = decoder_data->player;
    int stream_no = decoder_data->stream_no;
    int err = ERROR_NO_ERROR;
    int ret;
    AVCodecContext * c = player->input_codec_ctxs[stream_no];
    AVStream *stream = player->input_streams[stream_no];
    LOGI(10, "player_write_audio Writing audio frame")

    jbyteArray samples_byte_array = (*env)->NewByteArray(env, data_size);
    if (samples_byte_array == NULL) {
       err = -ERROR_NOT_CREATED_AUDIO_SAMPLE_BYTE_ARRAY;
       goto end;
    }

    if (pts != AV_NOPTS_VALUE) {
       player->audio_clock = av_rescale_q(pts, stream->time_base, AV_TIME_BASE_Q);
       LOGI(9, "player_write_audio - read from pts")
    } else {
       int64_t sample_time = original_data_size;
       sample_time *= 1000000ll;
       sample_time /= c->channels;
       sample_time /= c->sample_rate;
       sample_time /= av_get_bytes_per_sample(c->sample_fmt);
       player->audio_clock += sample_time;
       LOGI(9, "player_write_audio - added")
    }
    enum WaitFuncRet wait_ret = player_wait_for_frame(player,
           player->audio_clock + AUDIO_TIME_ADJUST_US, stream_no);
    if (wait_ret == WAIT_FUNC_RET_SKIP) {
       goto end;
    }

    LOGI(10, "player_write_audio Writing sample data")

    jbyte *jni_samples = (*env)->GetByteArrayElements(env, samples_byte_array,
           NULL);
    memcpy(jni_samples, data, data_size);
    (*env)->ReleaseByteArrayElements(env, samples_byte_array, jni_samples, 0);

    LOGI(10, "player_write_audio playing audio track");
    ret = (*env)->CallIntMethod(env, player->audio_track,
           player->audio_track_write_method, samples_byte_array, 0, data_size);
    jthrowable exc = (*env)->ExceptionOccurred(env);
    if (exc) {
       err = -ERROR_PLAYING_AUDIO;
       LOGE(3, "Could not write audio track: reason in exception");
       // TODO maybe release exc
       goto free_local_ref;
    }
    if (ret &lt; 0) {
       err = -ERROR_PLAYING_AUDIO;
       LOGE(3,
               "Could not write audio track: reason: %d look in AudioTrack.write()", ret);
       goto free_local_ref;
    }

    free_local_ref:
    LOGI(10, "player_write_audio releasing local ref");
    (*env)->DeleteLocalRef(env, samples_byte_array);

    end: return err;

    }

    I will be pleased for any help !!!! Thank you very much !!!!

  • VideoView does not play Audio in Video properly

    30 janvier 2014, par Jay

    I have an *.mp4 file which is duration of 2 min. Now it has audio track starting from 30 seconds upto 1.10 min. The rest before 30s and after 1.10min is blank.

    Now the problem is when I try to play it in videoview or mediaplayer then, it plays audio right from beginning of the video rather from its actual position. I tried this on multiple phones with same result.

    When I play the same video in MXPlayer or in Windows(VLC) ; it plays properly.

    What is the solution to this problem ?

    Edit

    I have used -itsoffset command of Ffmpeg for achieving above video.

    ffmpeg -y -i a.mp4 -itsoffset 00:00:30 sng.m4a -map 0:0 -map 1:0 -c:v copy -preset ultrafast out.mp4

    Thanks in advance.