Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (43)

Sur d’autres sites (7788)

  • Add frame to video in specified position

    28 septembre 2015, par QUANGPHAT ĐINH

    I’m using Aforge libs to read and write video files (the libs is here : http://www.aforgenet.com/framework/features/ffmpeg.html).

    Now I want to export a specific frame to edit, then import it back to the video.

    I could export frame by frame but I don’t know how to add it back to the video in specific frame. what should i do now ?

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

    18 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, &out_size, &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 < (out_size); i += 2) {
       char b1 = pAudioBuffer[i];
       char b2 = pAudioBuffer[i + 1];
       short sample = atoi(&b1) + atoi(&b2);
       shortBuffer[shortBufIndex] = sample;
       shortBufIndex++;
       LOGI("BUFFER_ITEM='%d'", 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.

    UPDATE

    I have tried to access to short as pairs, here is my fixed code, but it not work, i don't hear any sound :

       int shortBufIndex = 0;
       for (int i = 0; i < (out_size); i += 2) {
           char * byte = (char *) pAudioBuffer[i];
           short * sample = byte;
           shortBuffer[shortBufIndex] = sample;
    }

    What i'm doing wrong ?
    I need conversion like this : byte array to short array and back again in java but in c.

  • unconnected output - FFMPEG

    9 avril 2018, par Hernan Quintero

    Im trying to make my first apple Service.

    I want FFMPEG to extract 5.1 Audio from a video with this command line :

    ffmpeg -i infile \
    -filter_complex "channelsplit=channel_layout=5.1[FL][FR][FC][LFE][BL]
    [BR]" \
    -map "[FL]" front_left.wav \
    -map "[FR]" front_right.wav \
    -map "[FC]" front_center.wav \
    -map "[LFE]" lfe.wav \
    -map "[BL]" back_left.wav \
    -map "[BR]" back_right.wav

    It works very good from the Terminal, but when I try to make a Service in Automator I get the following error :

    Filter channelsplit:BR has an unconnected output

    This is the command line for the service :

    on run {input, parameters}
    tell application "Terminal"
       activate
       set filesString to ""
       repeat with file_ in input
           set filesString to filesString & " " & quoted form of (POSIX path of file_)
       end repeat
       do script "for f in" & filesString & "; do
    /usr/local/bin/ffmpeg -i \"$f\" -filter_complex
    channelsplit=channel_layout=5.1[FL][FR][FC][LFE][BL][BR]
    -map [FL] front_left.wav
    -map [FR] front_right.wav
    -map [FC] front_center.wav
    -map [LFE] lfe.wav
    -map [BL] back_left.wav
    -map [BR] back_right.wav
    done"
    end tell
    return input
    end run

    Could you guys help me to figure out what I’m doing wrong ?

    Thank you very much.