Recherche avancée

Médias (91)

Autres articles (23)

  • 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

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Changer son thème graphique

    22 février 2011, par

    Le thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
    Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
    Modifier le thème graphique utilisé
    Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
    Il suffit ensuite de se rendre dans l’espace de configuration du (...)

Sur d’autres sites (5705)

  • FFmpeg "Illegal instruction" Raspberry Pi Zero W

    20 août 2019, par ErezM

    I’ve been struggling with having FFmpeg run on Pi Zero W, as a newbie I can’t say where the root of the problem whether its the compilation configuration of the FFmpeg or maybe the syntax of the command line itself..

    The current configuration is :

    Raspberry Pi Zero Wireless
    Set GPU memory to 256

    Running OS :

    Linux raspberrypi 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux

    PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
    NAME="Raspbian GNU/Linux"
    VERSION_ID="10"
    VERSION="10 (buster)"
    VERSION_CODENAME=buster
    ID=raspbian
    ID_LIKE=debian

    No LSB modules are available.
    Distributor ID: Raspbian
    Description: Raspbian GNU/Linux 10 (buster)
    Release: 10
    Codename: buster

    FFmpeg version and configuration :

    ffmpeg version N-94582-gd0fa1a58da Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 8 (Raspbian 8.3.0-6+rpi1)
    configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-omx --enable-omx-rpi --enable-nonfree
    libavutil 56. 33.100 / 56. 33.100
    libavcodec 58. 55.100 / 58. 55.100
    libavformat 58. 31.101 / 58. 31.101
    libavdevice 58. 9.100 / 58. 9.100
    libavfilter 7. 58.100 / 7. 58.100
    libswscale 5. 6.100 / 5. 6.100
    libswresample 3. 6.100 / 3. 6.100
    libpostproc 55. 6.100 / 55. 6.100
    Hyper fast Audio and Video encoder

    Command to copy 30 seconds clip from the 10 second mark :

    sudo ffmpeg -ss 00:00:10 -t 00:00:30 -i GOPR2546.MP4 -c:v libx264 -c:a copy out.MP4

    The FFmpeg output :

    ffmpeg version N-94582-gd0fa1a58da Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 8 (Raspbian 8.3.0-6+rpi1)
    configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-omx --enable-omx-rpi --enable-nonfree
    libavutil 56. 33.100 / 56. 33.100
    libavcodec 58. 55.100 / 58. 55.100
    libavformat 58. 31.101 / 58. 31.101
    libavdevice 58. 9.100 / 58. 9.100
    libavfilter 7. 58.100 / 7. 58.100
    libswscale 5. 6.100 / 5. 6.100
    libswresample 3. 6.100 / 3. 6.100
    libpostproc 55. 6.100 / 55. 6.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x210d360] Using non-standard frame rate 59/1
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR2546.MP4':
    Metadata:
    major_brand : mp41
    minor_version : 538120216
    compatible_brands: mp41
    creation_time : 2019-08-20T11:09:41.000000Z
    firmware : HD7.01.01.80.00
    Duration: 00:01:00.84, start: 0.000000, bitrate: 45293 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 45043 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
    Metadata:
    creation_time : 2019-08-20T11:09:41.000000Z
    handler_name : GoPro AVC
    encoder : GoPro AVC encoder
    timecode : 11:20:21:32
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
    creation_time : 2019-08-20T11:09:41.000000Z
    handler_name : GoPro AAC
    timecode : 11:20:21:32
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
    creation_time : 2019-08-20T11:09:41.000000Z
    handler_name : GoPro TCD
    timecode : 11:20:21:32
    Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 41 kb/s (default)
    Metadata:
    creation_time : 2019-08-20T11:09:41.000000Z
    handler_name : GoPro MET
    Stream #0:4(eng): Data: none (fdsc / 0x63736466), 13 kb/s (default)
    Metadata:
    creation_time : 2019-08-20T11:09:41.000000Z
    handler_name : GoPro SOS
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    Illegal instruction

    The result is an empty out.MP4 file... I’ve tried different configuration but never got it to work.

    the one minute input file i’m using to test can be downloaded from https://dl.dropboxusercontent.com/s/dxd285zrz6d57da/GOPR2546.MP4

    Thank you all in advance !!

  • Using libav to encode RGBA frames into MP4 but the output is a mess

    5 octobre 2019, par Cu2S

    I’m trying to decode a video into RGB frames, and then postprocess the frames, finally encode the frames into a video. But the output video is completely a mess :
    Screenshot from potplayer

    I wrote a minimal example to illustrate my idea. First, I read some information from some source video :

       AVFormatContext* inputFormatCtx = nullptr;
       int ret = avformat_open_input(&inputFormatCtx, inputParamsVideo, nullptr, nullptr);
       assert(ret >= 0);
       ret = avformat_find_stream_info(inputFormatCtx, NULL);
       av_dump_format(inputFormatCtx, 0, inputParamsVideo, 0);

       assert(ret >= 0);
       AVStream* inputVideoStream = nullptr;
       for (int i = 0; i < inputFormatCtx->nb_streams; i++)
       {
           const auto inputStream = inputFormatCtx->streams[i];
           if (inputStream->codec->codec_type == AVMEDIA_TYPE_VIDEO)
           {
               inputVideoStream = inputStream;
               break;
           }
       }

       assert(inputVideoStream != nullptr);
       AVCodecParameters* inputParams = inputVideoStream->codecpar;
       AVRational framerate = inputVideoStream->codec->framerate;
       auto gop_size = inputVideoStream->codec->gop_size;
       auto maxBFrames = inputVideoStream->codec->max_b_frames;

    Then I assign the information to the output stream :

    AVFormatContext *outputAVFormat = nullptr;
    avformat_alloc_output_context2(&outputAVFormat, nullptr, nullptr, kOutputPath);
    assert(outputAVFormat);
    AVCodec* codec = avcodec_find_encoder(outputAVFormat->oformat->video_codec);
    assert(codec);
    AVCodecContext* encodingCtx = avcodec_alloc_context3(codec);
    avcodec_parameters_to_context(encodingCtx, inputParams);
    encodingCtx->time_base = av_inv_q(framerate);
    encodingCtx->max_b_frames = maxBFrames;
    encodingCtx->gop_size = gop_size;


    if (outputAVFormat->oformat->flags & AVFMT_GLOBALHEADER)
       encodingCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
    AVStream* outStream = avformat_new_stream(outputAVFormat, nullptr);
    assert(outStream != nullptr);
    ret = avcodec_parameters_from_context(outStream->codecpar, encodingCtx);
    assert(ret >= 0);
    outStream->time_base = encodingCtx->time_base;

    Then I convert RGBA frames(which is read from files) into YUV420P via sws_scale, and encoding :

       ret = avcodec_open2(encodingCtx, codec, nullptr);
       assert(ret >= 0);
       av_dump_format(outputAVFormat, 0, kOutputPath, 1);

       ret = avio_open(&outputAVFormat->pb, kOutputPath, AVIO_FLAG_WRITE);
       assert(ret >= 0);
       ret = avformat_write_header(outputAVFormat, nullptr);
       assert(ret >= 0);

       AVFrame* frame = av_frame_alloc();
       frame->width = inputParams->width;
       frame->height = inputParams->height;
       frame->format = inputParams->format;
       frame->pts = 0;
       assert(ret >= 0);

       ret = av_frame_get_buffer(frame, 32);
       int frameCount = 0;
       assert(ret >= 0);
       ret = av_frame_make_writable(frame);
       assert(ret >= 0);
       SwsContext* swsContext = sws_getContext(inputParams->width, inputParams->height,
           AV_PIX_FMT_RGBA, frame->width,
           frame->height, static_cast<avpixelformat>(inputParams->format),
           SWS_BILINEAR, NULL, NULL, NULL);


       for (auto inputPicPath : std::filesystem::directory_iterator(kInputDir))
       {
           int width, height, comp;
           unsigned char* data = stbi_load(inputPicPath.path().string().c_str(), &amp;width, &amp;height, &amp;comp, 4);
           int srcStrides[1] = { 4 * width };
           int ret = sws_scale(swsContext, &amp;data, srcStrides, 0, height, frame->data,
               frame->linesize);
           assert(ret >= 0);
           frame->pts = frameCount;
           //frame->pict_type = AV_PICTURE_TYPE_I;
           frameCount += 1;
           encode(encodingCtx, frame, 0, outputAVFormat);

           stbi_image_free(data);
       }

       while (encode(encodingCtx, nullptr, 0, outputAVFormat))
       {
           ;
       }

       static bool encode(AVCodecContext* enc_ctx, AVFrame* frame, std::uint32_t streamIndex,
           AVFormatContext * formatCtx)
       {
           int ret;
           int got_output = 0;
           AVPacket packet = {};
           av_init_packet(&amp;packet);
           ret = avcodec_encode_video2(enc_ctx, &amp;packet, frame, &amp;got_output);
           assert(ret >= 0);
           if (got_output) {
               packet.stream_index = streamIndex;
               av_packet_rescale_ts(&amp;packet, enc_ctx->time_base, formatCtx->streams[streamIndex]->time_base);
               ret = av_interleaved_write_frame(formatCtx, &amp;packet);
               assert(ret >= 0);
               return true;
           }
           else {
               return false;
           }
       }
    </avpixelformat>

    Finally I cleaned up stuff :

       av_write_trailer(outputAVFormat);
       sws_freeContext(swsContext);
       avcodec_free_context(&amp;encodingCtx);
       avio_closep(&amp;outputAVFormat->pb);
       avformat_free_context(outputAVFormat);
       av_frame_free(&amp;frame);

    I dumped my input format and my output format :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'H:\Me.MP4':
     Metadata:
       major_brand     : mp42
       minor_version   : 1
       compatible_brands: mp41mp42isom
       creation_time   : 2019-04-03T05:44:22.000000Z
     Duration: 00:00:06.90, start: 0.000000, bitrate: 1268 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 540x960, 1238 kb/s, 29.86 fps, 30 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         creation_time   : 2019-04-03T05:44:22.000000Z
         handler_name    : Core Media Video
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 24 kb/s (default)
       Metadata:
         creation_time   : 2019-04-03T05:44:22.000000Z
         handler_name    : Core Media Audio
    [libx264 @ 000002126F90C1C0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 000002126F90C1C0] profile High, level 3.1, 4:2:0, 8-bit
    [libx264 @ 000002126F90C1C0] 264 - core 157 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=12 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=12 rc=abr mbtree=1 bitrate=1238 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to './output.mp4':
       Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 540x960, q=2-31, 1238 kb/s, 29.86 tbn

    Update :

    After I deleted

    encodingCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

    the output video is right. Also, outputting avi works, too.

  • Reverse and areverse crash the computer

    14 août 2019, par Alex

    I am using this command :

    ffmpeg -y -ss 00:03:52.612 -i "H:\DCIM\100GOPRO\GOPR3258.MP4" -r 60 -t 00:00:12.140 -vf reverse -af afade=t=in:ss=0:d=1,afade=t=out:st='00\:00\:11.140':d=1,areverse 6.mp4

    It increases the memory consumption of the computer to a point of collapse.

    Putting it like

    ffmpeg -y -ss 00:03:52.612 -i "H:\DCIM\100GOPRO\GOPR3258.MP4" -r 60 -t 00:00:12.140 -af afade=t=in:ss=0:d=1,afade=t=out:st='00\:00\:11.140':d=1 6.mp4

    Works without a problem.

    Therefore, the issue is in the -vf reverse and -af reverse.

    The output is

    ffmpeg version N-94543-g8fcc5d963e Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 9.1.1 (GCC) 20190807
     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-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-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
     libavutil      56. 33.100 / 56. 33.100
     libavcodec     58. 55.100 / 58. 55.100
     libavformat    58. 30.100 / 58. 30.100
     libavdevice    58.  9.100 / 58.  9.100
     libavfilter     7. 58.100 /  7. 58.100
     libswscale      5.  6.100 /  5.  6.100
     libswresample   3.  6.100 /  3.  6.100
     libpostproc    55.  6.100 / 55.  6.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0000024b71029180] Using non-standard frame rate 59/1
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'H:\DCIM\100GOPRO\GOPR3258.MP4':
     Metadata:
       major_brand     : mp41
       minor_version   : 538120216
       compatible_brands: mp41
       creation_time   : 2019-08-14T13:50:26.000000Z
       firmware        : HD4.02.05.00.00
     Duration: 00:17:43.08, start: 0.000000, bitrate: 30127 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 29972 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro AVC
         encoder         : GoPro AVC encoder
         timecode        : 14:03:41:09
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro AAC
         timecode        : 14:03:41:09
       Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro TCD
         timecode        : 14:03:41:09
       Stream #0:3(eng): Data: none (fdsc / 0x63736466), 13 kb/s (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro SOS
    Only '-vf reverse' read, ignoring remaining -vf options: Use ',' to separate filters
    Only '-af afade=t=in:ss=0:d=1,afade=t=out:st='00\:00\:11.140':d=1,areverse' read, ignoring remaining -af options: Use ',' to separate filters
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0000024b7148cc40] using SAR=1/1
    [libx264 @ 0000024b7148cc40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0000024b7148cc40] profile High, level 4.2, 4:2:0, 8-bit
    [libx264 @ 0000024b7148cc40] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '6.mp4':
     Metadata:
       major_brand     : mp41
       minor_version   : 538120216
       compatible_brands: mp41
       firmware        : HD4.02.05.00.00
       encoder         : Lavf58.30.100
       Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 0.02 fps, 15360 tbn, 60 tbc (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro AVC
         timecode        : 14:03:41:09
         encoder         : Lavc58.55.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         creation_time   : 2019-08-14T13:50:26.000000Z
         handler_name    :         GoPro AAC
         timecode        : 14:03:41:09
         encoder         : Lavc58.55.100 aac
    frame=    0 fps=0.0 q=0.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [aac @ 0000024b71498b40] Qavg: nan

    What I find interesting is

    Only '-vf reverse' read, ignoring remaining -vf options: Use ',' to separate filters

    As there is only -vf reverse

    Only '-af afade=t=in:ss=0:d=1,afade=t=out:st='00\:00\:11.140':d=1,areverse' read, ignoring remaining -af options: Use ',' to separate filters

    Here the same.

    I tried

    ffmpeg -y -ss 00:03:52.612 -i "H:\DCIM\100GOPRO\GOPR3258.MP4" -r 60 -t 00:00:12.140 -vf "reverse" -af "afade=t=in:ss=0:d=1,afade=t=out:st='00\:00\:11.140':d=1,areverse" 6.mp4

    to no avail

    What is causing this issue ?