Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (82)

  • 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

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (7576)

  • How to concat videos using ffmpeg ?

    5 septembre 2021, par schissmantics

    I'm trying to concat several videos using ffmpeg on macOS BigSur. I tried :

    


    ffmpeg -i concat:"01-vid.mov|02-vid.mov|03-vid.mov|04-vid.mov" out.mov


    


    which results in only 01-vid.mov being re-encoded for some reason and saved to out.mov.

    


    and :

    


    cat '01-vid.mov' > vid.txt
cat '02-vid.mov' > vid.txt
cat '03-vid.mov' > vid.txt
cat '04-vid.mov' > vid.txt
ffmpeg -f concat -safe 0 -i vid.txt -c copy out.mp4


    


    Which results in the same outcome.

    


    and :

    


    cat 01-vid.mov 02-vid.mov 03-vid.mov 04-vid.mov > out.mov


    


    which results in out.mov having the size of the 4 combined but a duration of only the first one.

    


    and :

    


    I join the vids using quicktime but whenever I try to re-encode the resulting vid using ffmpeg, it produces a corrupt video despite the input seemingly ok.

    


  • FFMPEG/C++ How to simply write out/passthrough h264 stream ?

    11 août 2021, par Schuerta

    Im trying to learn the basics of ffmpeg writing (reading already works), so im just trying to take in an input .ts file and write out/passthrough the exact same h264 stream to a new output file. I dont get any compilation errors, but for some reason i cant figure out why my output file's framerate is very wrong. Also when i read in my output file, i get printouts saying "Packet corrupt (stream = 0, dts = #)"

    


    I followed the instructions in the ffmpeg library comments so im not sure what im missing. I call initOutStream(), then initH264encoder(), then during the reading/decoding readH264Packet() is called repeatedly. (Removed code for readability sake, left relevant sections below) ;

    


    Edit : If i put my output file through the actuall ffmpeg cmd app, the framerate issue seems to get fixed. Wonder where im messing up

    


    void test::initOutStream() {

//create muxing context
outstreamContext = avformat_alloc_context();

//oformat
AVOutputFormat *guessFormat; //Populate oformat
guessFormat = av_guess_format(NULL, inputVideoUrl.c_str(), NULL);
outstreamContext->oformat = guessFormat; 
outstreamContext->oformat->video_codec = AV_CODEC_ID_H264; 
//outstreamContext->bit_rate = 400000; //No affect; 

//pb
AVIOContext *outAVIOContext = nullptr;
//int result = avio_open(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE);
int result = avio_open2(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE, NULL, NULL); //Documentain said to use this method
outstreamContext->pb = outAVIOContext;
}


    


    .

    


    void test::initH264encoder() { //Frame -> packet&#xA;int result;&#xA;&#xA;h264OutCodec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;&#xA;h264OutStream = avformat_new_stream(outstreamContext, h264OutCodec);&#xA;h264OutStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;h264OutStream->codecpar->codec_id = AV_CODEC_ID_H264;&#xA;h264OutStream->codecpar->width = 640;&#xA;h264OutStream->codecpar->height = 480;&#xA;h264OutStream->id = H264_STREAM_ID;&#xA;h264OutStream->codecpar->color_range = AVCOL_RANGE_MPEG;&#xA;//h264OutStream->codecpar->bit_rate = 400000;&#xA;&#xA;h264OutContext = avcodec_alloc_context3(h264OutCodec);&#xA;&#xA;h264OutContext->width = 640;&#xA;h264OutContext->height = 480;&#xA;h264OutContext->time_base = (AVRational){1,static_cast<int>(29.97)};&#xA;h264OutContext->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;&#xA;result = avcodec_open2(h264OutContext, h264OutCodec, nullptr);&#xA;&#xA;//Alloc packet &#x2B; finish&#xA;outPacket = av_packet_alloc();&#xA;&#xA;//Write header&#xA;result = avformat_write_header(outstreamContext, NULL);&#xA;}&#xA;</int>

    &#xA;

    Assume that reading was set up correctly

    &#xA;

    void test::readH264Packet(__unused uint64_t tick) {&#xA;//...av_read_frame(streamContext, inPacket);&#xA;//...avcodec_send_packet(h264Context, inPacket);&#xA;//...avcodec_receive_frame(h264Context, yuvFrame)&#xA;//My passthrough:&#xA;if(shouldOutputH264Stream){&#xA;        result = avcodec_send_frame(h264OutContext, yuvFrame); //1. Encode frame to packet&#xA;        result = avcodec_receive_packet(h264OutContext, outPacket2); //2. get encoded packet&#xA;        result = av_interleaved_write_frame(outstreamContext, outPacket2); //3. write packet&#xA;        //Write trailer and free happens later&#xA;    }&#xA;}&#xA;

    &#xA;

  • PyDub : ffmpeg header missing

    7 février 2024, par Ray Siplao

    I made a simple Python program that add short pauses at the start of mp3 files

    &#xA;

    import os&#xA;&#xA;from pydub import AudioSegment&#xA;&#xA;AUDIO_DIR = &#x27;C:\\Users\\Ray\\Downloads\\sentence-audio&#x27;&#xA;OUT_DIR = &#x27;C:\\Users\\Ray\\Downloads\\out-audio&#x27;&#xA;&#xA;pause = AudioSegment.silent(duration=400)&#xA;&#xA;for fname in os.listdir(AUDIO_DIR):&#xA;    print(f&#x27;Processing {fname}&#x27;)&#xA;    newf = os.path.join(OUT_DIR, os.path.basename(fname))&#xA;    if os.path.isfile(newf):&#xA;        print(f&#x27;{fname} exists&#x27;)&#xA;        continue&#xA;    audio = AudioSegment.from_mp3(os.path.join(AUDIO_DIR, fname))&#xA;    new = pause &#x2B; audio&#xA;    new.export(newf, format=&#x27;mp3&#x27;)&#xA;    print(f&#x27;{fname} lengthened&#x27;)&#xA;

    &#xA;

    While running this program, I received the below error message for a particular mp3 file

    &#xA;

    Traceback (most recent call last):&#xA;  File "C:\Users\Ray\Downloads\lengthen.py", line 16, in <module>&#xA;    audio = AudioSegment.from_mp3(os.path.join(AUDIO_DIR, fname))&#xA;  File "C:\Python39\lib\site-packages\pydub\audio_segment.py", line 796, in from_mp3&#xA;    return cls.from_file(file, &#x27;mp3&#x27;, parameters=parameters)&#xA;  File "C:\Python39\lib\site-packages\pydub\audio_segment.py", line 773, in from_file&#xA;    raise CouldntDecodeError(&#xA;pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1&#xA;&#xA;Output from ffmpeg/avlib:&#xA;&#xA;ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 9.3.1 (GCC) 20200328&#xA;  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-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 42.102 / 56. 42.102&#xA;  libavcodec     58. 77.101 / 58. 77.101&#xA;  libavformat    58. 42.100 / 58. 42.100&#xA;  libavdevice    58.  9.103 / 58.  9.103&#xA;  libavfilter     7. 77.101 /  7. 77.101&#xA;  libswscale      5.  6.101 /  5.  6.101&#xA;  libswresample   3.  6.100 /  3.  6.100&#xA;  libpostproc    55.  6.100 / 55.  6.100&#xA;[mp3float @ 0000016489995380] Header missing&#xA;    Last message repeated 71 times&#xA;[mp3 @ 000001648998b500] decoding for stream 0 failed&#xA;[mp3 @ 000001648998b500] Could not find codec parameters for stream 0 (Audio: mp3 (mp3float), 0 channels, fltp): unspecified frame size&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; and &#x27;probesize&#x27; options&#xA;Input #0, mp3, from &#x27;C:\Users\Ray\Downloads\sentence-audio\354.mp3&#x27;:&#xA;  Duration: N/A, start: 0.000000, bitrate: N/A&#xA;    Stream #0:0: Audio: mp3, 0 channels, fltp&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))&#xA;Press [q] to stop, [?] for help&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;[mp3float @ 0000016489995800] Header missing&#xA;Error while decoding stream #0:0: Invalid data found when processing input&#xA;...&#xA;</module>

    &#xA;

    I thought at first that the mp3 file is corrupt, thus it is unplayable. But, when I played the file in a media player, it was fine.

    &#xA;

    I don't know how to resolve this issue. Is there any workarounds ?

    &#xA;