Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (56)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8736)

  • Revision 36037 : s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas ...

    9 mars 2010, par kent1@… — Log

    s’assurer que la class ffmpeg_movie est disponible sinon cela ne sert pas à grand chose

  • FFServer streaming H.264 from Logitech C920

    23 octobre 2014, par Ricardo Frederico Leote Mota

    I’m having some trouble trying to implement a web live stream from my Logitech C920 webcam w/ H.264 encoding using ffmpeg/ffserver.

    Here is the configuration file I’m using for the ffserver :

    # Port on which the server is listening. You must select a different
    # port from your standard HTTP web server if it is running on the same
    # computer.
    Port 8090

    # Address on which the server is bound. Only useful if you have
    # several network interfaces.
    BindAddress 0.0.0.0

    # Number of simultaneous HTTP connections that can be handled. It has
    # to be defined *before* the MaxClients parameter, since it defines the
    # MaxClients maximum limit.
    MaxHTTPConnections 2000

    # Number of simultaneous requests that can be handled. Since FFServer
    # is very fast, it is more likely that you will want to leave this high
    # and use MaxBandwidth, below.
    MaxClients 1000

    # This the maximum amount of kbit/sec that you are prepared to
    # consume when streaming to clients.
    MaxBandwidth 1000

    # Access log file (uses standard Apache log file format)
    # '-' is the standard output.
    CustomLog -

    ##################################################################
    # Definition of the live feeds. Each live feed contains one video
    # and/or audio sequence coming from an ffmpeg encoder or another
    # ffserver. This sequence may be encoded simultaneously with several
    # codecs at several resolutions.

    <feed>

    # You must use 'ffmpeg' to send a live feed to ffserver. In this
    # example, you can type:
    #

    File /tmp/feed.ffm
    FileMaxSize 100M

    # You could specify
    # ReadOnlyFile /saved/specialvideo.ffm
    # This marks the file as readonly and it will not be deleted or updated.

    # Only allow connections from localhost to the feed.
    ACL allow 127.0.0.1

    </feed>


    ##################################################################
    # Now you can define each stream which will be generated from the
    # original audio and video stream. Each format has a filename (here
    # 'test1.mpg'). FFServer will send this stream when answering a
    # request containing this filename.

    <stream>

    Feed feed.ffm
    Format mp4

    # Audio settings
    NoAudio

    # Video Settings
    #VideoSize 1280x720                      # Video resolution
    #VideoFrameRate 30                      # Video FPS
    #AVOptionVideo flags +global_header          # Parameters passed to encoder
    #AVOptionVideo cpu-used 0
    #AVOptionVideo qmin 10
    #AVOptionVideo qmax 42
    #AVOptionVideo quality good
    PreRoll 0
    StartSendOnKey
    #VideoBitRate 400                      # Video bitrate

    </stream>

    # Server status

    <stream>
    Format status

    # Only allow local people to get the status
    ACL allow localhost
    ACL allow 192.168.0.0 192.168.255.255

    </stream>


    # Redirect index.html to the appropriate site

    And here is the command I’m issuing through the command line and the respective output :

    ffmpeg -s 1280x720 -f video4linux2 -r 30 -vcodec h264 -re -i /dev/video0 -copyinkf -codec copy h**p://localhost:8090/feed.ffm
    ffmpeg version N-67036-g04a4fb8 Copyright (c) 2000-2014 the FFmpeg developers
     built on Oct 20 2014 17:39:50 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --enable-gpl --enable-libx264
     libavutil      54. 10.100 / 54. 10.100
     libavcodec     56.  8.102 / 56.  8.102
     libavformat    56.  9.101 / 56.  9.101
     libavdevice    56.  1.100 / 56.  1.100
     libavfilter     5.  2.100 /  5.  2.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 12614.859199, bitrate: N/A
       Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc
    Output #0, ffm, to 'h**p://localhost:8090/feed.ffm':
     Metadata:
       creation_time   : now
       encoder         : Lavf56.9.101
       Stream #0:0: Video: h264, yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, -5 kb/s, 30 fps, 1000k tbn, 30 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 0, current: -166263; changing to 1. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1, current: -134365; changing to 2. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 2, current: -102381; changing to 3. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 3, current: -66434; changing to 4. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 4, current: -34548; changing to 5. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 5, current: -2645; changing to 6. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232857, current: 138514; changing to 232858. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232858, current: 167942; changing to 232859. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232859, current: 197415; changing to 232860. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 232860, current: 227037; changing to 232861. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 997959, current: 938599; changing to 997960. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 997960, current: 995052; changing to 997961. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1240745, current: 1232841; changing to 1240746. This may result in incorrect timestamps in the output file.
    [ffm @ 0x28c7ea0] Non-monotonous DTS in output stream 0:0; previous: 1293561, current: 1282157; changing to 1293562. This may result in incorrect timestamps in the output file.
    frame=   69 fps= 34 q=-1.0 Lsize=     912kB time=00:00:02.01 bitrate=3702.1kbits/s

    When I try to play the stream with VLC for example - vlc h**p ://localhost:8090/stream.mp4 - i get the following error :

    [00007f5234003948] core stream error : cannot pre fill buffer

    And I can’t watch the stream on the web browser side also.

    Could someone give me an hint on this ?

    Many thanks and your help is much appreciated ! ;)

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

    &#xA;

    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.

    &#xA;

    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 ?

    &#xA;

    I tested it on localhost but everything worked fine

    &#xA;

    the whole code

    &#xA;

    &lt;?php &#xA;&#xA;if (empty($cl[&#x27;is_logged&#x27;])) {&#xA;    $data         = array(&#xA;        &#x27;code&#x27;    => 401,&#xA;        &#x27;data&#x27;    => array(),&#xA;        &#x27;message&#x27; => &#x27;Unauthorized Access&#x27;&#xA;    );&#xA;}&#xA;&#xA;else {&#xA;    $post_data  = $me[&#x27;draft_post&#x27;];&#xA;    $media_type = fetch_or_get($_POST["type"], false);&#xA;&#xA;    if (empty($media_type) || in_array($media_type, array("image", "video")) != true) {&#xA;        $data[&#x27;code&#x27;]    = 400;&#xA;        $data[&#x27;message&#x27;] = "Media file type is missing or invalid";&#xA;        $data[&#x27;data&#x27;]    = array();&#xA;    }&#xA;&#xA;    else {&#xA;        if ($media_type == "image") {&#xA;            if (not_empty($_FILES[&#x27;file&#x27;]) &amp;&amp; not_empty($_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;])) {&#xA;                if (empty($post_data)) {&#xA;                    $post_id   = cl_create_orphan_post($me[&#x27;id&#x27;], "image");&#xA;                    $post_data = cl_get_orphan_post($post_id);&#xA;&#xA;                    cl_update_user_data($me[&#x27;id&#x27;], array(&#xA;                        &#x27;last_post&#x27; => $post_id&#xA;                    ));&#xA;                }&#xA;                &#xA;                if (not_empty($post_data) &amp;&amp; $post_data["type"] == "image") {&#xA;                    if (empty($post_data[&#x27;media&#x27;]) || count($post_data[&#x27;media&#x27;]) &lt; 10) {&#xA;                        $file_info      =  array(&#xA;                            &#x27;file&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;],&#xA;                            &#x27;size&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;size&#x27;],&#xA;                            &#x27;name&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;name&#x27;],&#xA;                            &#x27;type&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;type&#x27;],&#xA;                            &#x27;file_type&#x27; => &#x27;image&#x27;,&#xA;                            &#x27;folder&#x27;    => &#x27;images&#x27;,&#xA;                            &#x27;slug&#x27;      => &#x27;original&#x27;,&#xA;                            &#x27;crop&#x27;      => array(&#x27;width&#x27; => 300, &#x27;height&#x27; => 300),&#xA;                            &#x27;allowed&#x27;   => &#x27;jpg,png,jpeg,gif&#x27;&#xA;                        );&#xA;&#xA;                        $file_upload = cl_upload($file_info);&#xA;&#xA;                        if (not_empty($file_upload[&#x27;filename&#x27;])) {&#xA;          &#xA;                            $img_id      = cl_db_insert(T_PUBMEDIA, array(&#xA;                                "pub_id" => $post_data["id"],&#xA;                                "type"   => "image",&#xA;                                "src"    => $file_upload[&#x27;filename&#x27;],&#xA;                                "time"   => time(),&#xA;                                "json_data" => json(array(&#xA;                                    "image_thumb" => $file_upload[&#x27;cropped&#x27;]&#xA;                                ),true)&#xA;                            ));&#xA;&#xA;                            if (is_posnum($img_id)) {&#xA;                                $data[&#x27;message&#x27;] = &#x27;Media file uploaded successfully&#x27;;&#xA;                                $data[&#x27;code&#x27;]    = 200;&#xA;                                $data[&#x27;data&#x27;]    = array(&#xA;                                    "media_id"   => $img_id, &#xA;                                    "url"        => cl_get_media($file_upload[&#x27;cropped&#x27;]),&#xA;                                    "type"       => "Image"&#xA;                                );&#xA;                            }&#xA;                        }&#xA;                        else {&#xA;                            $data[&#x27;code&#x27;]    = 400;&#xA;                            $data[&#x27;message&#x27;] = "Something went wrong while saving a uploaded media file. Please check your details and try again";&#xA;                            $data[&#x27;data&#x27;]    = array();&#xA;                        }&#xA;                    }&#xA;                    else {&#xA;                        $data[&#x27;code&#x27;]    = 400;&#xA;                        $data[&#x27;message&#x27;] = "You cannot attach more than 10 images to a post";&#xA;                        $data[&#x27;data&#x27;]    = array();&#xA;                    }&#xA;                }&#xA;                else {&#xA;                    cl_delete_orphan_posts($me[&#x27;id&#x27;]);&#xA;                    cl_update_user_data($me[&#x27;id&#x27;],array(&#xA;                        &#x27;last_post&#x27; => 0&#xA;                    ));&#xA;&#xA;                    $data[&#x27;code&#x27;]    = 500;&#xA;                    $data[&#x27;message&#x27;] = "An error occurred while processing your request. Please try again later.";&#xA;                    $data[&#x27;data&#x27;]    = array();&#xA;                }&#xA;            }&#xA;            else {&#xA;                $data[&#x27;code&#x27;]    = 500;&#xA;                $data[&#x27;message&#x27;] = "Media file is missing or invalid";&#xA;                $data[&#x27;data&#x27;]    = array();&#xA;            }&#xA;        }&#xA;&#xA;        else if($media_type == "video") {&#xA;            if (not_empty($_FILES[&#x27;file&#x27;]) &amp;&amp; not_empty($_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;])) {&#xA;                if (empty($post_data)) {&#xA;                    $post_id   = cl_create_orphan_post($me[&#x27;id&#x27;], "video");&#xA;                    $post_data = cl_get_orphan_post($post_id);&#xA;&#xA;                    cl_update_user_data($me[&#x27;id&#x27;],array(&#xA;                        &#x27;last_post&#x27; => $post_id&#xA;                    ));&#xA;                }&#xA;&#xA;                if (not_empty($post_data) &amp;&amp; $post_data["type"] == "video") {&#xA;                    if (empty($post_data[&#x27;media&#x27;])) {&#xA;                        $file_info      =  array(&#xA;                            &#x27;file&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;],&#xA;                            &#x27;size&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;size&#x27;],&#xA;                            &#x27;name&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;name&#x27;],&#xA;                            &#x27;type&#x27;      => $_FILES[&#x27;file&#x27;][&#x27;type&#x27;],&#xA;                            &#x27;file_type&#x27; => &#x27;video&#x27;,&#xA;                            &#x27;folder&#x27;    => &#x27;videos&#x27;,&#xA;                            &#x27;slug&#x27;      => &#x27;original&#x27;,&#xA;                            &#x27;allowed&#x27;   => &#x27;mp4,mov,3gp,webm&#x27;,&#xA;                        );&#xA;&#xA;                        $file_upload = cl_upload($file_info);&#xA;                        $upload_fail = false;&#xA;                        $post_id     = $post_data[&#x27;id&#x27;];&#xA;&#xA;                        if (not_empty($file_upload[&#x27;filename&#x27;])) {&#xA;                            try {&#xA;                                require_once(cl_full_path("core/libs/ffmpeg-php/vendor/autoload.php"));&#xA;&#xA;                                $ffmpeg         = new FFmpeg(cl_full_path($config[&#x27;ffmpeg_binary&#x27;]));&#xA;                                $thumb_path     = cl_gen_path(array(&#xA;                                    "folder"    => "images",&#xA;                                    "file_ext"  => "jpeg",&#xA;                                    "file_type" => "image",&#xA;                                    "slug"      => "poster",&#xA;                                ));&#xA;&#xA;                                $ffmpeg->input($file_upload[&#x27;filename&#x27;]);&#xA;                                $ffmpeg->set(&#x27;-ss&#x27;,&#x27;3&#x27;);&#xA;                                $ffmpeg->set(&#x27;-vframes&#x27;,&#x27;1&#x27;);&#xA;                                $ffmpeg->set(&#x27;-f&#x27;,&#x27;mjpeg&#x27;);&#xA;                                $ffmpeg->output($thumb_path)->ready();&#xA;                            } &#xA;&#xA;                            catch (Exception $e) {&#xA;                                $upload_fail = true;&#xA;                            }&#xA;&#xA;                            if (empty($upload_fail)) {&#xA;                                $vid_id      = cl_db_insert(T_PUBMEDIA, array(&#xA;                                    "pub_id" => $post_id,&#xA;                                    "type"   => "video",&#xA;                                    "src"    => $file_upload[&#x27;filename&#x27;],&#xA;                                    "time"   => time(),&#xA;                                    "json_data" => json(array(&#xA;                                        "poster_thumb" => $thumb_path&#xA;                                    ),true)&#xA;                                ));&#xA;&#xA;                                if (is_posnum($vid_id)) {&#xA;                                    $data[&#x27;message&#x27;] = &#x27;Media file uploaded successfully&#x27;;&#xA;                                    $data[&#x27;code&#x27;]    = 200;&#xA;                                    $data[&#x27;data&#x27;]    = array(&#xA;                                        "media_id"   => $vid_id, &#xA;                                        "type"       => "Video",&#xA;                                        "source"     => cl_get_media($file_upload[&#x27;filename&#x27;]),&#xA;                                        "poster"     => cl_get_media($thumb_path),&#xA;                                    );&#xA;                                }&#xA;                            }&#xA;&#xA;                            else {&#xA;                                $data[&#x27;code&#x27;]    = 400;&#xA;                                $data[&#x27;message&#x27;] = "Something went wrong while saving a uploaded media file. Please check your details and try again";&#xA;                                $data[&#x27;data&#x27;]    = array();&#xA;                            }&#xA;                        }&#xA;                    }&#xA;                    else {&#xA;                        $data[&#x27;code&#x27;]    = 400;&#xA;                        $data[&#x27;message&#x27;] = "You cannot attach more than 1 video to a post";&#xA;                        $data[&#x27;data&#x27;]    = array();&#xA;                    }&#xA;                }&#xA;                else {&#xA;                    cl_delete_orphan_posts($me[&#x27;id&#x27;]);&#xA;                    cl_update_user_data($me[&#x27;id&#x27;], array(&#xA;                        &#x27;last_post&#x27; => 0&#xA;                    ));&#xA;                }&#xA;            }&#xA;&#xA;            else {&#xA;                $data[&#x27;code&#x27;]    = 500;&#xA;                $data[&#x27;message&#x27;] = "Media file is missing or invalid";&#xA;                $data[&#x27;data&#x27;]    = array();&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;

    &#xA;

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

    &#xA;