Recherche avancée

Médias (1)

Mot : - Tags -/illustrator

Autres articles (75)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (8362)

  • Why does avcodec_send_frame give invalid argument error ?

    23 mai 2020, par Rich

    I'm trying to learn how to use the libav libraries from FFmpeg. When I run my code, it gives "Invalid argument" the first time I try to encode a frame. I'm using an mp4 as input and output to mp4. What are the possibilities for why it would give that error ? What arguments is it looking for that might be wrong ?

    



    #include <libavformat></libavformat>avformat.h>&#xA;#include &#xA;#include &#xA;&#xA;void die(const char *msg)&#xA;{&#xA;    printf("ERROR: %s\n", msg);&#xA;    exit(1);&#xA;}&#xA;&#xA;void checkRC(int rc, const char *msg)&#xA;{&#xA;    if (rc != 0) {&#xA;        char avErrMsg[1024];&#xA;        av_strerror(rc, avErrMsg, sizeof(avErrMsg));&#xA;&#xA;        int length = strlen(avErrMsg) &#x2B; strlen(msg) &#x2B; 2 &#x2B; 1;&#xA;        char *errMsg = (char *)malloc(length);&#xA;        sprintf(errMsg, "%s: %s", msg, avErrMsg);&#xA;&#xA;        die(errMsg);&#xA;    }&#xA;}&#xA;&#xA;void checkNull(void *ptr, const char *msg)&#xA;{&#xA;    if (ptr == NULL) {&#xA;        die(msg);&#xA;    }&#xA;}&#xA;&#xA;char *copyString(const char *str)&#xA;{&#xA;    int length = strlen(str);&#xA;    char *newStr = (char *)malloc(length &#x2B; 1);&#xA;&#xA;    strcpy(newStr, str);&#xA;&#xA;    return newStr;&#xA;}&#xA;&#xA;int main(int argc, char const *argv[])&#xA;{&#xA;    argc--;&#xA;    argv&#x2B;&#x2B;;&#xA;&#xA;    if (argc != 2) {&#xA;        die("Please give an input file and output file");&#xA;    }&#xA;&#xA;    int rc = 0;&#xA;    const char *inputFile = argv[0];&#xA;    const char *outputFile = argv[1];&#xA;&#xA;    AVFormatContext *inputFmtCtx = NULL;&#xA;    AVFormatContext *outputFmtCtx = NULL;&#xA;    AVIOContext *ioCtx = NULL;&#xA;    AVStream *inputStream = NULL;&#xA;    AVStream *outputStream = NULL;&#xA;    AVCodec *decoder = NULL;&#xA;    AVCodec *encoder = NULL;&#xA;    AVCodecContext *inputCodecCtx = NULL;&#xA;    AVCodecContext *outputCodecCtx = NULL;&#xA;    AVFrame *frame = NULL;&#xA;    AVPacket inPacket;&#xA;&#xA;    rc = avformat_open_input(&amp;inputFmtCtx, inputFile, NULL, NULL);&#xA;    checkRC(rc, "Failed to open input format");&#xA;&#xA;    rc = avformat_find_stream_info(inputFmtCtx, NULL);&#xA;    checkRC(rc, "Failed to find input streams");&#xA;&#xA;    rc = avio_open(&amp;ioCtx, outputFile, AVIO_FLAG_WRITE);&#xA;    checkRC(rc, "Failed to open output IO context");&#xA;&#xA;    outputFmtCtx = avformat_alloc_context();&#xA;    checkNull(outputFmtCtx, "Failed to allocate output format context");&#xA;&#xA;    outputFmtCtx->pb = ioCtx;&#xA;    outputFmtCtx->oformat = av_guess_format(NULL, outputFile, NULL);&#xA;    outputFmtCtx->url = copyString(outputFile);&#xA;&#xA;    inputStream = inputFmtCtx->streams[0];&#xA;    decoder = avcodec_find_decoder(inputStream->codecpar->codec_id);&#xA;    checkNull(decoder, "Failed to find decoder");&#xA;&#xA;    inputCodecCtx = avcodec_alloc_context3(decoder);&#xA;    checkNull(inputCodecCtx, "Failed to allocate codec context");&#xA;&#xA;    rc = avcodec_parameters_to_context(inputCodecCtx, inputStream->codecpar);&#xA;    checkRC(rc, "Failed to copy parameters to context");&#xA;&#xA;    rc = avcodec_open2(inputCodecCtx, decoder, NULL);&#xA;    checkRC(rc, "Failed to open codec");&#xA;&#xA;    outputStream = avformat_new_stream(outputFmtCtx, NULL);&#xA;    checkNull(outputStream, "Failed to create new stream");&#xA;&#xA;    encoder = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    checkNull(encoder, "Failed to find encoder");&#xA;&#xA;    outputCodecCtx = avcodec_alloc_context3(encoder);&#xA;    checkNull(outputCodecCtx, "Failed to allocate encoder context");&#xA;&#xA;    outputCodecCtx->bit_rate = inputCodecCtx->bit_rate;&#xA;    outputCodecCtx->width = inputCodecCtx->width;&#xA;    outputCodecCtx->height = inputCodecCtx->height;&#xA;    outputCodecCtx->time_base = (AVRational){1, 25};&#xA;    outputCodecCtx->framerate = (AVRational){25, 1};&#xA;    outputCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    outputCodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;&#xA;    rc = avcodec_parameters_from_context(outputStream->codecpar, outputCodecCtx);&#xA;    checkRC(rc, "Failed to copy parameters from context");&#xA;&#xA;    frame = av_frame_alloc();&#xA;    checkNull(frame, "Failed to allocate frame");&#xA;&#xA;    rc = avformat_write_header(outputFmtCtx, NULL);&#xA;    checkRC(rc, "Failed to write header");&#xA;&#xA;    rc = av_read_frame(inputFmtCtx, &amp;inPacket);&#xA;    checkRC(rc, "Failed to read frame");&#xA;&#xA;    rc = avcodec_send_packet(inputCodecCtx, &amp;inPacket);&#xA;    checkRC(rc, "Failed to send packet");&#xA;&#xA;    rc = avcodec_receive_frame(inputCodecCtx, frame);&#xA;    checkRC(rc, "Failed to receive frame");&#xA;&#xA;    rc = avcodec_send_frame(outputCodecCtx, frame);&#xA;    checkRC(rc, "Faied to send frame");&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

  • Moving ffmpeg from root to user/local

    25 janvier 2015, par Edward Meaderds

    I noticed that when I followed a guide to install ffmpeg (some time ago), that all of the scripts i want to use, say that ffmpeg need to be in the /usr/local/bin/ffmpeg mine is in root, how do I move the folder to the correct location without messing anything up ? My server is centos 6.5

  • Revision 997db6fc3f : Merge "Add a speed feature to give the tighter search range"

    16 août 2014, par Pengchong Jin

    Changed Paths :
     Modify /vp9/encoder/vp9_encodeframe.c


     Modify /vp9/encoder/vp9_speed_features.c


     Modify /vp9/encoder/vp9_speed_features.h



    Merge "Add a speed feature to give the tighter search range"