Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (64)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (8830)

  • rtmp streaming video does not work [on hold]

    12 mai 2017, par 김동영

    I want to develop rtmp live streaming. It uses ffmpeg and sdl. First, I want to output a simple image. Packets come in but no image is output. Please let me know why the following sources do not work.
    I can not find the answer throughout the week and I ask.
    It is being developed as an iOS objective-c.
    I hope you help me.
    Have a good day

    thank you.

    <code>

    #import <libavcodec></libavcodec>avcodec.h>
    #import <libavformat></libavformat>avformat.h>
    #import <libswscale></libswscale>swscale.h>
    #import <libavfilter></libavfilter>avfilter.h>
    #import <libavfilter></libavfilter>avfiltergraph.h>
    #import <libavfilter></libavfilter>buffersrc.h>
    #import <libswresample></libswresample>swresample.h>
    #import
    #import

    @implementation hello2



    - (void)viewDidLoad {
       [super viewDidLoad];

       AVFormatContext *pFormatCtx;
       int             i, videoindex;
       AVCodecContext  *pCodecCtx;
       AVCodec         *pCodec;
       AVFrame *pFrame,*pFrameYUV;
       uint8_t *out_buffer;
       AVPacket *packet;
       int y_size;
       int ret, got_picture;
       struct SwsContext *img_convert_ctx;
       //SDL---------------------------
       int screen_w=0,screen_h=0;
       SDL_Window *screen;
       SDL_Renderer* sdlRenderer;
       SDL_Texture* sdlTexture;
       SDL_Rect sdlRect;

       FILE *fp_yuv;

       av_register_all();
       avformat_network_init();
       pFormatCtx = avformat_alloc_context();

       SDL_SetMainReady();

       //rtmp://www.planeta-online.tv:1936/live/channel_4
       if(avformat_open_input(&amp;pFormatCtx,"rtmp://live.hkstv.hk.lxdns.com/live/hks",NULL,NULL)!=0){
           printf("Couldn't open input stream.\n");
           return;
       }
       if(avformat_find_stream_info(pFormatCtx,NULL)&lt;0){
           printf("Couldn't find stream information.\n");
           return;
       }
       videoindex=-1;
       for(i=0; inb_streams; i++)
           if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){
               videoindex=i;
               break;
           }
       if(videoindex==-1){
           printf("Didn't find a video stream.\n");
           return;
       }
       pCodecCtx=pFormatCtx->streams[videoindex]->codec;
       pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
       if(pCodec==NULL){
           printf("Codec not found.\n");
           return;
       }
       if(avcodec_open2(pCodecCtx, pCodec,NULL)&lt;0){
           printf("Could not open codec.\n");
           return;
       }

       pFrame=av_frame_alloc();
       pFrameYUV=av_frame_alloc();
       out_buffer=(uint8_t *)av_malloc(avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height));
       avpicture_fill((AVPicture *)pFrameYUV, out_buffer, AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);
       packet=(AVPacket *)av_malloc(sizeof(AVPacket));
       //Output Info-----------------------------
       printf("--------------- File Information ----------------\n");
       av_dump_format(pFormatCtx,0,"rtmp://live.hkstv.hk.lxdns.com/live/hks",0);
       printf("-------------------------------------------------\n");
       img_convert_ctx = sws_getContext(pCodecCtx->width, pCodecCtx->height, pCodecCtx->pix_fmt,
                                        pCodecCtx->width, pCodecCtx->height, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL);

    #if OUTPUT_YUV420P
       fp_yuv=fopen("output.yuv","wb+");
    #endif

       if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER)) {
           printf( "Could not initialize SDL - %s\n", SDL_GetError());
           return;
       }

       screen_w = pCodecCtx->width;
       screen_h = pCodecCtx->height;
       //SDL 2.0 Support for multiple windows
       screen = SDL_CreateWindow("Simplest ffmpeg player", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
                                 screen_w, screen_h,
                                 SDL_WINDOW_OPENGL);

       if(!screen) {
           printf("SDL: could not create window - exiting:%s\n",SDL_GetError());
           return;
       }

       sdlRenderer = SDL_CreateRenderer(screen, -1, 0);
       //IYUV: Y + U + V  (3 planes)
       //YV12: Y + V + U  (3 planes)
       sdlTexture = SDL_CreateTexture(sdlRenderer, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STREAMING,pCodecCtx->width,pCodecCtx->height);

       sdlRect.x=0;
       sdlRect.y=0;
       sdlRect.w=screen_w;
       sdlRect.h=screen_h;

       SDL_SetTextureBlendMode(sdlTexture, SDL_BLENDMODE_BLEND);

       //SDL End----------------------
       while(av_read_frame(pFormatCtx, packet)>=0){
           if(packet->stream_index==videoindex){
               ret = avcodec_decode_video2(pCodecCtx, pFrame, &amp;got_picture, packet);
               if(ret &lt; 0){
                   printf("Decode Error.\n");
                   return;
               }

               //NSLog(@"write packet pst = %lld, dts = %lld, stream = %d", packet->pts, packet->dts, packet->stream_index);

               if(got_picture){
                   sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height,
                             pFrameYUV->data, pFrameYUV->linesize);

    #if OUTPUT_YUV420P
                   y_size=pCodecCtx->width*pCodecCtx->height;
                   fwrite(pFrameYUV->data[0],1,y_size,fp_yuv);    //Y
                   fwrite(pFrameYUV->data[1],1,y_size/4,fp_yuv);  //U
                   fwrite(pFrameYUV->data[2],1,y_size/4,fp_yuv);  //V
    #endif
                   //SDL---------------------------
    #if 0
                   SDL_UpdateTexture( sdlTexture, NULL, pFrameYUV->data[0], pFrameYUV->linesize[0] );
    #else
                   SDL_UpdateYUVTexture(sdlTexture, &amp;sdlRect,
                                        pFrameYUV->data[0], pFrameYUV->linesize[0],
                                        pFrameYUV->data[1], pFrameYUV->linesize[1],
                                        pFrameYUV->data[2], pFrameYUV->linesize[2]);

    #endif

                   SDL_RenderClear( sdlRenderer );
                   SDL_RenderCopy( sdlRenderer, sdlTexture,  NULL, &amp;sdlRect);
                   SDL_RenderPresent( sdlRenderer );

                   //SDL End-----------------------
                   //Delay 40ms
                   SDL_Delay(20);


               }
           }
           av_free_packet(packet);
       }
       //flush decoder
       //FIX: Flush Frames remained in Codec
       while (1) {
           ret = avcodec_decode_video2(pCodecCtx, pFrame, &amp;got_picture, packet);
           if (ret &lt; 0)
               break;
           if (!got_picture)
               break;
           sws_scale(img_convert_ctx, (const uint8_t* const*)pFrame->data, pFrame->linesize, 0, pCodecCtx->height,
                     pFrameYUV->data, pFrameYUV->linesize);
    #if OUTPUT_YUV420P
           int y_size=pCodecCtx->width*pCodecCtx->height;
           fwrite(pFrameYUV->data[0],1,y_size,fp_yuv);    //Y
           fwrite(pFrameYUV->data[1],1,y_size/4,fp_yuv);  //U
           fwrite(pFrameYUV->data[2],1,y_size/4,fp_yuv);  //V
    #endif
           //SDL---------------------------
           SDL_UpdateTexture( sdlTexture, &amp;sdlRect, pFrameYUV->data[0], pFrameYUV->linesize[0] );
           SDL_RenderClear( sdlRenderer );
           SDL_RenderCopy( sdlRenderer, sdlTexture,  NULL, &amp;sdlRect);
           SDL_RenderPresent( sdlRenderer );
           //SDL End-----------------------
           //Delay 40ms
           SDL_Delay(40);
       }

       sws_freeContext(img_convert_ctx);

    #if OUTPUT_YUV420P
       fclose(fp_yuv);
    #endif

       SDL_Quit();

       av_frame_free(&amp;pFrameYUV);
       av_frame_free(&amp;pFrame);
       avcodec_close(pCodecCtx);
       avformat_close_input(&amp;pFormatCtx);


    }

    @end`
  • RN 0.74.7 can't find repo for ffmpeg-kit-react-native 6.0.2

    9 mai, par user938363

    My React Native 0.74.7 (on MacOS) app has hard time to find the ffmpeg-kit-react-native repo when run-android. It constantly complains no repo found on maven. Here is the error when react-native run-android :

    &#xA;

    * What went wrong:&#xA;Could not determine the dependencies of task &#x27;:app:processDebugResources&#x27;.&#xA;> Could not resolve all task dependencies for configuration &#x27;:app:debugRuntimeClasspath&#x27;.&#xA;   > Could not find com.arthenica:ffmpeg-kit-full-gpl:6.0.&#xA;     Searched in the following locations:&#xA;       - https://oss.sonatype.org/content/repositories/snapshots/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom&#xA;       - https://repo.maven.apache.org/maven2/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom&#xA;       - file:/Users/macbook/Documents/code/js/VmonFront/node_modules/jsc-android/dist/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom&#xA;       - https://dl.google.com/dl/android/maven2/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom&#xA;       - https://www.jitpack.io/com/arthenica/ffmpeg-kit-full-gpl/6.0/ffmpeg-kit-full-gpl-6.0.pom&#xA;     Required by:&#xA;         project :app > project :ffmpeg-kit-react-native&#xA;

    &#xA;

    In android/build.gradle, the repo was specified :

    &#xA;

    buildscript {&#xA;    ext {&#xA;        buildToolsVersion = "34.0.0"&#xA;        minSdkVersion = 23&#xA;        compileSdkVersion = 34&#xA;        targetSdkVersion = 34&#xA;        ndkVersion = "26.1.10909125"&#xA;        kotlinVersion = "1.9.22"&#xA;&#xA;        ffmpegKitPackage = "full-gpl"&#xA;    }&#xA;&#xA;    repositories {&#xA;        google()&#xA;        mavenCentral()&#xA;        maven { url "https://jitpack.io" }&#xA;        // You can comment out the below line if it causes issues:&#xA;        maven { url &#x27;https://maven.arthenica.com/public/&#x27; } //&lt;&lt;&lt;===repo here&#xA;    }&#xA;&#xA;    dependencies {&#xA;        classpath("com.android.tools.build:gradle")&#xA;        classpath("com.facebook.react:react-native-gradle-plugin")&#xA;        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")&#xA;    }&#xA;}&#xA;&#xA;&#xA;apply plugin: "com.facebook.react.rootproject"&#xA;

    &#xA;

    Also the following code is added to android/app/build.gradle :

    &#xA;

    // &#128293; Add this block to override the wrong version in ffmpeg&#x27;s gradle.properties&#xA;configurations.all {&#xA;    resolutionStrategy {&#xA;        force "com.arthenica:ffmpeg-kit-https:6.0". //&lt;&lt;&lt;===6.0.2 or 6 didn&#x27;t work&#xA;        force "com.arthenica:ffmpeg-kit-full-gpl:6.0" // Include if using other packages&#xA;    }&#xA;}&#xA;

    &#xA;

    The problem seems to be with RN 0.74.7 only, as my RN 0.78.0 with ffmpeg-kit-react-native installed was able to download full-gpl version and installed successfully. What is missing here to install ffmpeg-kit on RN 0.74.7 ?

    &#xA;

  • Failed to find two consecutive MPEG audio frames [closed]

    3 décembre 2024, par matrixebiz

    I'm receiving this error trying to download/convert an m3u8

    &#xA;

    [mp3 @ 000001c8f5112200] Format mp3 detected only with low score of 1, misdetection possible!&#xA;[mp3 @ 000001c8f5112200] Failed to find two consecutive MPEG audio frames.&#xA;[in#0 @ 000001c8f5111f40] Error opening input: Invalid data found when processing input&#xA;

    &#xA;

    Any way to fix this in my ffmpeg command line ? Also, playing the stream in VLC and other apps shows this in the path /%EF%BB%BF for some reason.&#xA;VLC is unable to open the MRL 'file :///C :/Temp/%EF%BB%BF'. Check the log for details. Then it will play the actual video.

    &#xA;

    Do i need to change the beginning of the m3u8 ?&#xA;#EXTM3U&#xA;#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000,RESOLUTION=640x360,

    &#xA;

    Even if I remove it and just leave the URL that is inside the m3u8, will still display the %EF%BB%BF which I need to stop from happening

    &#xA;

    EDIT : Adding the PowerShell script I'm using to output my file :

    &#xA;

    function Replace-FileText&#xA;{&#xA;    [CmdletBinding()]&#xA;    Param&#xA;    (&#xA;        $File1,&#xA;        $File2,&#xA;        $File1StartAnchor,&#xA;        $File1EndAnchor = "$",&#xA;        $File2StartAnchor,&#xA;        $File2EndAnchor = "$"&#xA;    )&#xA;    &#xA;    #Escape the regex meta characters, this assumes literals are used in the input&#xA;    $File1StartAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File1StartAnchor)&#xA;    $File2StartAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File2StartAnchor)&#xA;&#xA;    if ($PSBoundParameters.ContainsKey(&#x27;File1EndAnchor&#x27;))&#xA;    {&#xA;        $File1EndAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File1EndAnchor)&#xA;    }&#xA;    else&#xA;    {&#xA;        $File1EndAnchorEscaped = $File1EndAnchor&#xA;    }&#xA;&#xA;    if ($PSBoundParameters.ContainsKey(&#x27;File2EndAnchor&#x27;))&#xA;    {&#xA;        $File2EndAnchorEscaped = [System.Text.RegularExpressions.Regex]::Escape($File2EndAnchor)&#xA;    }&#xA;    else&#xA;    {&#xA;        $File2EndAnchorEscaped = $File2EndAnchor&#xA;    }&#xA;&#xA;&#xA;    if ((Get-Content $File1 -Raw) -match "$File1StartAnchorEscaped(.*?)$File1EndAnchorEscaped")&#xA;    {&#xA;        Write-Host "Found the following string in between the anchors in $File1 :$($Matches[1])"&#xA;        $TextToInject = $Matches[1]&#xA;    }&#xA;    else&#xA;    {&#xA;        Write-Host "Could not find the Start and end Anchors in $File1"&#xA;        return&#xA;    }&#xA; &#xA;    if ((Get-Content $File2 -Raw) -match "$File2StartAnchorEscaped(.*?)$File2EndAnchorEscaped")&#xA;    {&#xA;        Write-Host "Found the following string in between the anchors in $File2 :$($Matches[1])"&#xA;        $TextToReplace = $Matches[1]&#xA;    }&#xA;    else&#xA;    {&#xA;        Write-Host "Could not find the Start Anchor in $File2"&#xA;        return&#xA;    }&#xA; &#xA;    (Get-Content $File2 -Raw) -replace $TextToReplace,$TextToInject | Out-File $File2 -NoNewline&#xA;}&#xA; &#xA; &#xA;Replace-FileText -File1 &#x27;C:\EQDA\File1.txt&#x27; -File2 &#x27;C:\EQDA\File2.txt&#x27; -File1StartAnchor &#x27;two&#x27; -File1EndAnchor &#x27;"&#x27; -File2StartAnchor &#x27;four&#x27;&#xA;Replace-FileText -File1 &#x27;C:\EQDA\File1.txt&#x27; -File2 &#x27;C:\EQDA\File2.txt&#x27; -File1StartAnchor &#x27;server-&#x27; -File1EndAnchor &#x27;-name&#x27; -File2StartAnchor &#x27;server-&#x27; -File2EndAnchor &#x27;-name&#x27;&#xA;

    &#xA;