Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (109)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

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

Sur d’autres sites (13515)

  • New Piwik Mobile 2 Beta app (Android only)

    9 décembre 2014, par Thomas Steur — Piwik Mobile Releases

    Are you interested in testing our newest features, bug fixes and performance improvements before they make it to our next Piwik Mobile version ?

    Check out our new app Piwik Mobile 2 Beta on Google Play. This beta includes more than 15 bugfixes and improvements.

    We have been testing as much as we could. Now is your time to experiment and help us to track down any bugs, or even suggest usability improvements. Start using it and send us any feedback or issue a bug. We can improve Piwik Mobile much better with your help !

    Be aware that this version may contain bugs, if you are interested in a more stable version install Piwik Mobile 2 instead.

  • New Piwik Mobile 2 Beta app (Android only)

    9 décembre 2014, par Thomas Steur — Piwik Mobile Releases

    Are you interested in testing our newest features, bug fixes and performance improvements before they make it to our next Piwik Mobile version ?

    Check out our new app Piwik Mobile 2 Beta on Google Play. This beta includes more than 15 bugfixes and improvements.

    We have been testing as much as we could. Now is your time to experiment and help us to track down any bugs, or even suggest usability improvements. Start using it and send us any feedback or issue a bug. We can improve Piwik Mobile much better with your help !

    Be aware that this version may contain bugs, if you are interested in a more stable version install Piwik Mobile 2 instead.

  • error with ffmpeg, when trying to upload a video

    14 juillet 2021, par James

    I recently downloaded a script, which is similar to a social network. And all items in this script related to publish, for example. The button to publish images, video and polls are included. However the video upload button has a problem, the host I'm hosting this site doesn't accept ffmpeg conversion, and so far so good because in the script if there isn't you can leave the ffmpeg field (in the adm panel) empty , and I did that, the problem is that when I try to upload a video, I always get an error saying that it was not possible to relazie the operation, I went to take a look at the script to process the video, and found that it uploads because the video goes to the uploads folder, but it doesn't deliver anything to the bank and doesn't even preview the video on the publish page, that is, the ffmpeg code is running even with the host not allowing it, giving an error soon.

    


    I've tried to do everything like deleting the ffmpeg part of the code, trying to change the input names and many other small attempts like changing some name there or here, but the error still persists.

    


    The code is right below, could someone tell me what I can change in this code so that it uploads the normal video ? (this host allows video uploading, but without ffmpeg). And what could be wrong with him ?

    


    I tested it on localhost but everything worked fine

    


    the whole code

    


    <?php 

if (empty($cl['is_logged'])) {
    $data         = array(
        'code'    => 401,
        'data'    => array(),
        'message' => 'Unauthorized Access'
    );
}

else {
    $post_data  = $me['draft_post'];
    $media_type = fetch_or_get($_POST["type"], false);

    if (empty($media_type) || in_array($media_type, array("image", "video")) != true) {
        $data['code']    = 400;
        $data['message'] = "Media file type is missing or invalid";
        $data['data']    = array();
    }

    else {
        if ($media_type == "image") {
            if (not_empty($_FILES['file']) && not_empty($_FILES['file']['tmp_name'])) {
                if (empty($post_data)) {
                    $post_id   = cl_create_orphan_post($me['id'], "image");
                    $post_data = cl_get_orphan_post($post_id);

                    cl_update_user_data($me['id'], array(
                        'last_post' => $post_id
                    ));
                }
                
                if (not_empty($post_data) && $post_data["type"] == "image") {
                    if (empty($post_data['media']) || count($post_data['media']) < 10) {
                        $file_info      =  array(
                            'file'      => $_FILES['file']['tmp_name'],
                            'size'      => $_FILES['file']['size'],
                            'name'      => $_FILES['file']['name'],
                            'type'      => $_FILES['file']['type'],
                            'file_type' => 'image',
                            'folder'    => 'images',
                            'slug'      => 'original',
                            'crop'      => array('width' => 300, 'height' => 300),
                            'allowed'   => 'jpg,png,jpeg,gif'
                        );

                        $file_upload = cl_upload($file_info);

                        if (not_empty($file_upload['filename'])) {
          
                            $img_id      = cl_db_insert(T_PUBMEDIA, array(
                                "pub_id" => $post_data["id"],
                                "type"   => "image",
                                "src"    => $file_upload['filename'],
                                "time"   => time(),
                                "json_data" => json(array(
                                    "image_thumb" => $file_upload['cropped']
                                ),true)
                            ));

                            if (is_posnum($img_id)) {
                                $data['message'] = 'Media file uploaded successfully';
                                $data['code']    = 200;
                                $data['data']    = array(
                                    "media_id"   => $img_id, 
                                    "url"        => cl_get_media($file_upload['cropped']),
                                    "type"       => "Image"
                                );
                            }
                        }
                        else {
                            $data['code']    = 400;
                            $data['message'] = "Something went wrong while saving a uploaded media file. Please check your details and try again";
                            $data['data']    = array();
                        }
                    }
                    else {
                        $data['code']    = 400;
                        $data['message'] = "You cannot attach more than 10 images to a post";
                        $data['data']    = array();
                    }
                }
                else {
                    cl_delete_orphan_posts($me['id']);
                    cl_update_user_data($me['id'],array(
                        'last_post' => 0
                    ));

                    $data['code']    = 500;
                    $data['message'] = "An error occurred while processing your request. Please try again later.";
                    $data['data']    = array();
                }
            }
            else {
                $data['code']    = 500;
                $data['message'] = "Media file is missing or invalid";
                $data['data']    = array();
            }
        }

        else if($media_type == "video") {
            if (not_empty($_FILES['file']) && not_empty($_FILES['file']['tmp_name'])) {
                if (empty($post_data)) {
                    $post_id   = cl_create_orphan_post($me['id'], "video");
                    $post_data = cl_get_orphan_post($post_id);

                    cl_update_user_data($me['id'],array(
                        'last_post' => $post_id
                    ));
                }

                if (not_empty($post_data) && $post_data["type"] == "video") {
                    if (empty($post_data['media'])) {
                        $file_info      =  array(
                            'file'      => $_FILES['file']['tmp_name'],
                            'size'      => $_FILES['file']['size'],
                            'name'      => $_FILES['file']['name'],
                            'type'      => $_FILES['file']['type'],
                            'file_type' => 'video',
                            'folder'    => 'videos',
                            'slug'      => 'original',
                            'allowed'   => 'mp4,mov,3gp,webm',
                        );

                        $file_upload = cl_upload($file_info);
                        $upload_fail = false;
                        $post_id     = $post_data['id'];

                        if (not_empty($file_upload['filename'])) {
                            try {
                                require_once(cl_full_path("core/libs/ffmpeg-php/vendor/autoload.php"));

                                $ffmpeg         = new FFmpeg(cl_full_path($config['ffmpeg_binary']));
                                $thumb_path     = cl_gen_path(array(
                                    "folder"    => "images",
                                    "file_ext"  => "jpeg",
                                    "file_type" => "image",
                                    "slug"      => "poster",
                                ));

                                $ffmpeg->input($file_upload['filename']);
                                $ffmpeg->set('-ss','3');
                                $ffmpeg->set('-vframes','1');
                                $ffmpeg->set('-f','mjpeg');
                                $ffmpeg->output($thumb_path)->ready();
                            } 

                            catch (Exception $e) {
                                $upload_fail = true;
                            }

                            if (empty($upload_fail)) {
                                $vid_id      = cl_db_insert(T_PUBMEDIA, array(
                                    "pub_id" => $post_id,
                                    "type"   => "video",
                                    "src"    => $file_upload['filename'],
                                    "time"   => time(),
                                    "json_data" => json(array(
                                        "poster_thumb" => $thumb_path
                                    ),true)
                                ));

                                if (is_posnum($vid_id)) {
                                    $data['message'] = 'Media file uploaded successfully';
                                    $data['code']    = 200;
                                    $data['data']    = array(
                                        "media_id"   => $vid_id, 
                                        "type"       => "Video",
                                        "source"     => cl_get_media($file_upload['filename']),
                                        "poster"     => cl_get_media($thumb_path),
                                    );
                                }
                            }

                            else {
                                $data['code']    = 400;
                                $data['message'] = "Something went wrong while saving a uploaded media file. Please check your details and try again";
                                $data['data']    = array();
                            }
                        }
                    }
                    else {
                        $data['code']    = 400;
                        $data['message'] = "You cannot attach more than 1 video to a post";
                        $data['data']    = array();
                    }
                }
                else {
                    cl_delete_orphan_posts($me['id']);
                    cl_update_user_data($me['id'], array(
                        'last_post' => 0
                    ));
                }
            }

            else {
                $data['code']    = 500;
                $data['message'] = "Media file is missing or invalid";
                $data['data']    = array();
            }
        }
    }
}


    


    I dosen't made this code so, i dont know nothing about him