Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (81)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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 (...)

Sur d’autres sites (10698)

  • 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`
  • Evolution #2173 : Date de création / publication

    18 juillet 2017, par tcharlss (*´_ゝ`)

    Cool, super idée nicod_
    Pour ma gouverne, comment tu comptes faire pour ajouter ce champ quand on installe des nouveaux plugins ?

    Il reste la question de la date de 1ère publication, un article pouvant rester en gestation très longtemps avant d’être publié. Pour gérer ce cas, on pourrait considérer que la date de création d’un objet ayant un statut de publication correspond à la date de la 1ère publication (quand il y a $flux['args']['table']['statut']['publie']).

    Concrètement quelque chose comme ça : dans pre_insertion, ne remplir date_ceation que si l’objet ne possède pas de statut de publication, et dans objet_instituer remplir date_creation si ce champ est vide et si l’objet est publié.

  • FFMPEG set -ss and -to with string

    12 mai 2017, par NewUser

    I know I can set the start with -ss and end with -to but can someone please help me to format the following so that I can enter the -ss and -to with a string ?

    I want -ss to come from

    String start = editStart.getText().toString();

    and -to to come from

    String end = editEnd.getText().toString();

    Here is my ffmpeg string I want to edit, I have entered -ss and -to to show where I want the above strings to be.

    String s = "-i" + " " + mVideoUri.toString().replace("file:///", "") + " -i " + newBackgroundBitmap.getPath() +  " -filter_complex [1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v] -ss -to -map [v] -c:v libx264 -preset ultrafast " + directoryToStore + "/" + FileName + mp4;

    String[] arguments = s.split(" ");

    ExecuteFFMPEG(arguments);

    EDIT

    Here is the full ffmpeg

    //Button onclick
    public void onButtonClicked(View view) {
       switch (view.getId()) {

       //WHEN THE EXPORT BUTTON IS CLICKED
       case Export:
           String s = "-i" + " " + mVideoUri.toString() + " -i " + newBackgroundBitmap.getPath() + " -filter_complex [1:v][0:v]scale2ref=iw:ih[ovr][base];[ovr]colorchannelmixer=aa=0.7[ovrl];[base][ovrl]overlay[v] -map [v] -c:v libx264 -preset ultrafast " + directoryToStore + "/" + lastSaved + mp;
           String[] arguments = s.split(" ");
           ExecuteFFMPEG(arguments);

       }
    }

    //Added onLoad FFMPEG
    public void LoadFFMPEG() {

       FFmpeg ffmpeg = FFmpeg.getInstance(getBaseContext());
       try {
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {
                   super.onStart();

               }

               @Override
               public void onFailure() {
                   super.onFailure();
               }

               @Override
               public void onSuccess() {
                   super.onSuccess();

               }

               @Override
               public void onFinish() {
                   super.onFinish();
               }
           });
       } catch (FFmpegNotSupportedException e1) {
           e1.printStackTrace();
           Log.d("[FFMPEGMain Exception]-", e1.toString());
       }
    }

    //Added Exceute FFMPEG
    public void ExecuteFFMPEG(String[] command) {


       FFmpeg ffmpeg = FFmpeg.getInstance(getBaseContext());
       try {

           ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {

               @Override
               public void onStart() {
                   super.onStart();
                   Log.d("[Start]", "start");

               }

               @Override
               public void onProgress(String message) {
                   Log.d("[Progress]", message);
               }

               @Override
               public void onFailure(String message) {
                   Log.d("[fail]", message);
               }

               @Override
               public void onSuccess(String message) {
                   Log.d("[Success]", message);


               }


               @Override
               public void onFinish() {
                   super.onFinish();
                   Log.d("[Finish]", "file output done");

               }

           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           // Handle if FFmpeg is already running
           Log.d("[FFMPEG Exception]-", e.toString());

       }


    }

    The above works perfectly as I was hoping. Now I want to set the start and end of the video (depending on the position the user selected). I get the start and end of the video back as a string, like this :

    String valueRight = formatter.format(getValueRight);
    String valueLeft = formatter.format(getValueLeft);

    //this strings will return 00:00:00.000 DEPENDING on the position from the user
    //just like when you would normally call -ss 00:00:50.849 -to 00:02:05.100

    As I mentioned above that I know it should be set as -ss and -to but I am looking for a wat to format my string to enter -ss and -to with a string, somthing like this :

    -ss valueLeft -to valueRight