Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (43)

Sur d’autres sites (7941)

  • Revert "avcodec/decode : copy the output parameters from the last bsf in the chain...

    12 septembre 2018, par James Almer
    Revert "avcodec/decode : copy the output parameters from the last bsf in the chain back to the AVCodecContext"
    

    This reverts commit f631c328e680a3dd491936b92f69970c20cdcfc7.

    The avcodec_parameters_to_context() call was freeing and reallocating
    AVCodecContext->extradata, essentially taking ownership of it, which according
    to the doxy is user owned. This is an API break and has produced crashes in
    some library users like Firefox[1].

    Revert until a better solution is found to internally propagate the filtered
    extradata back into the decoder context, or a decision is made to change the
    API.

    [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1486080

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

    • [DH] libavcodec/decode.c
  • ffprobe json output not working in exec, but works in CMD

    26 novembre 2015, par Nicholas Walker

    I’ve installed ffmpeg on my windows 2008 server.

    I use this string in CMD and i get what i want to get in my

    PHP file :

    ffprobe -v quiet -print_format json -show_format -show_streams "C:\wamp\www\uploads\fc30e528b500b26a391ed4f5ed484310.mp4"

    This is my PHP function i found on another stackoverflow question, it had great feedback so i tested it.

    $file_name = 'fc30e528b500b26a391ed4f5ed484310';
    $file_ext = 'mp4';
    $ffprobe = 'C:\\ffmpeg\\bin\\ffprobe.exe';
    $videoFile = 'C:\\wamp\\www\\uploads\\'.$file_name.'.'.$file_ext;

    $cmd = shell_exec($ffprobe .' ffprobe -v quiet -print_format json -show_format -show_streams "'.$videoFile.'"');
    $parsed = json_decode($cmd, true);
    print_r($parsed);

    What is get back is nothing. I also tried using the same function i used with ffmpeg(which i got working for ffmpeg).

    $cmd = $ffprobe.' ffprobe -v quiet -print_format json -show_format -show_streams "'.$videoFile.'" 2>&amp;1';
    echo shell_exec($cmd);

    This also brings back nothing.

    Any ideas ?

  • convert char buffer (with pcm audio data) to short buffer

    15 décembre 2012, par testCoder

    I have char pAudioBuffer buffer which i got from function ffmpeg :

    int len = avcodec_decode_audio3(av_codec_context,
               (int16_t *) pAudioBuffer, &amp;out_size, &amp;packet);

    I know that audio format is two bytes per sample, i need to convert every two bytes to short value, i have tried to use code snippet below, but i often got zero instead of short value :

    int shortBufIndex = 0;
    for (int i = 0; i &lt; (out_size); i += 2) {
       char b1 = pAudioBuffer[i];
       char b2 = pAudioBuffer[i + 1];
       short sample = atoi(&amp;b1) + atoi(&amp;b2);
       shortBuffer[shortBufIndex] = sample;
       shortBufIndex++;
       LOGI("BUFFER_ITEM=&#39;%d&#39;", sample);
    }

    What i'm doing wrong, how to convert every two bytes in char buffer to short and and back.

    UPDATE :

    system's byte order is LITTLE_ENDIAN i have test it like this : Endianness of Android NDK

    How can i convert every two bytes in buffer to sample of short type and back. Please can you provide any code sample.