Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (41)

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

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • 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

Sur d’autres sites (5916)

  • Are HEVC and H265 same ? in ffmpeg they give different results why ? [migrated]

    20 mars 2021, par Harishkumar P

    recently i re encoded a H264 video to HEVC using ffmpeg and intel hevc_qsv hardware acceleration and libx265. hevc_qsv results in higher sized video and libx265 results in 50% lower sized video.
i googled h265 vs hevc it says they are same.. if they are same why so much difference in the results.

    


    ffmpeg -i "%%a" -c:v libx265 -vtag hvc1 "newfiles\%%~na.mp4

    


    ffmpeg -i "%%a" -c:v hevc_qsv -vtag hvc1 "newfiles\%%~na.mp4

    


    these are the command lines i used.

    


  • dnn/dnn_backend_native : Fix typo in log message

    10 mars 2021, par Andreas Rheinhardt
    dnn/dnn_backend_native : Fix typo in log message
    

    Reviewed-by : Guo, Yejun <yejun.guo@intel.com>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavfilter/dnn/dnn_backend_native.c
  • Safari on Mac and IOS 14 Won't Play HTML 5 MP4 Video

    10 mars 2021, par Glen Elkins

    So i have developed a chat application that uses node for the back-end. When a user selects a video on their iphone it usually is .mov format so when it's sent to the node server it's then converted to mp4 with ffmpeg. All that works fine, then if i load up my chat again in Chrome on my mac the video plays just fine as the mp4.

    &#xA;

    enter image description here

    &#xA;

    This screenshot shows the video embed is there, set to mp4 yet it won't play in Safari on my mac or my phone, in fact it just shows the video as 0 seconds long yet i can play it in chrome and also download the mp4 file by accessing the embed url directly.

    &#xA;

    Any ideas ? I had it convert to mp4 to prevent things like this, but safari doesn't seem to even like mp4 files.

    &#xA;

    The back-end part that serves the private file is in Symfony 4 (PHP) :

    &#xA;

    /**&#xA;     * @Route("/private/files/download/{base64Path}", name="downloadFile")&#xA;     * @param string $base64Path&#xA;     * @param Request $request&#xA;     * @return Response&#xA;     */&#xA;    public function downloadFile(string $base64Path, Request $request) : Response&#xA;    {&#xA;&#xA;&#xA;        // get token&#xA;        if(!$token = $request->query->get(&#x27;token&#x27;)){&#xA;            return new Response(&#x27;Access Denied&#x27;,403);&#xA;        }&#xA;&#xA;&#xA;&#xA;        /** @var UserRepository $userRepo */&#xA;        $userRepo = $this->getDoctrine()->getRepository(User::class);&#xA;&#xA;        /** @var User $user */&#xA;        if(!$user = $userRepo->findOneBy([&#x27;deleted&#x27;=>false,&#x27;active&#x27;=>true,&#x27;systemUser&#x27;=>false,&#x27;apiKey&#x27;=>$token])){&#xA;            return new Response(&#x27;Access Denied&#x27;,403);&#xA;        }&#xA;&#xA;&#xA;&#xA;        // get path&#xA;        if($path = base64_decode($base64Path)){&#xA;&#xA;            // make sure the folder we need exists&#xA;            $fullPath = $this->getParameter(&#x27;private_upload_folder&#x27;) . &#x27;/&#x27; . $path;&#xA;&#xA;&#xA;&#xA;            if(!file_exists($fullPath)){&#xA;                return new Response(&#x27;File Not Found&#x27;,404);&#xA;            }&#xA;&#xA;        &#xA;&#xA;            $response = new Response();&#xA;            $response->headers->set(&#x27;Content-Type&#x27;, mime_content_type($fullPath));&#xA;            $response->headers->set(&#x27;Content-Disposition&#x27;, &#x27;inline; filename="&#x27; . basename($fullPath) . &#x27;"&#x27;);&#xA;            $response->headers->set(&#x27;Content-Length&#x27;, filesize($fullPath));&#xA;            $response->headers->set(&#x27;Pragma&#x27;, "no-cache");&#xA;            $response->headers->set(&#x27;Expires&#x27;, "0");&#xA;            $response->headers->set(&#x27;Content-Transfer-Encoding&#x27;, "binary");&#xA;&#xA;            $response->sendHeaders();&#xA;&#xA;            $response->setContent(readfile($fullPath));&#xA;&#xA;            return $response;&#xA;        }&#xA;&#xA;        return new Response(&#x27;Invalid Path&#x27;,404);&#xA;    }&#xA;

    &#xA;

    This works fine everywhere except safari when trying to embed the video. It's done like this because the videos are not public and need an access token.

    &#xA;

    UPDATE : Here is a test link of an mp4, you'll have to allow the insecure certificate as it's on a quick test sub domain. If you open it in chrome, you'll see a 3 second video of my 3d printer curing station, if you load the same link in safari, you'll see it doesn't work

    &#xA;

    https://tester.nibbrstaging.com/private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032

    &#xA;

    The server runs on cPanel with Apache and i think it might be something to do with the video needs streaming ?

    &#xA;

    UPDATED CODE THAT WORKS IN SAFARI BUT NOW BROKEN IN CHROME :

    &#xA;

    Chrome is now giving Content-Length : 0 but it's working fine in safari.

    &#xA;

    public function downloadFile(string $base64Path, Request $request) : ?Response&#xA;    {&#xA;&#xA;        ob_clean();&#xA;&#xA;        // get token&#xA;        if(!$token = $request->query->get(&#x27;token&#x27;)){&#xA;            return new Response(&#x27;Access Denied&#x27;,403);&#xA;        }&#xA;&#xA;&#xA;        &#xA;&#xA;        /** @var UserRepository $userRepo */&#xA;        $userRepo = $this->getDoctrine()->getRepository(User::class);&#xA;&#xA;        /** @var User $user */&#xA;        if(!$user = $userRepo->findOneBy([&#x27;deleted&#x27;=>false,&#x27;active&#x27;=>true,&#x27;systemUser&#x27;=>false,&#x27;apiKey&#x27;=>$token])){&#xA;            return new Response(&#x27;Access Denied&#x27;,403);&#xA;        }&#xA;&#xA;&#xA;&#xA;        // get path&#xA;        if($path = base64_decode($base64Path)){&#xA;&#xA;            // make sure the folder we need exists&#xA;            $fullPath = $this->getParameter(&#x27;private_upload_folder&#x27;) . &#x27;/&#x27; . $path;&#xA;&#xA;&#xA;&#xA;            if(!file_exists($fullPath)){&#xA;                return new Response(&#x27;File Not Found&#x27;,404);&#xA;            }&#xA;&#xA;&#xA;            $filesize = filesize($fullPath);&#xA;            $mime = mime_content_type($fullPath);&#xA;&#xA;            header(&#x27;Content-Type: &#x27; . $mime);&#xA;&#xA;            if(isset($_SERVER[&#x27;HTTP_RANGE&#x27;])){&#xA;&#xA;                // Parse the range header to get the byte offset&#xA;                $ranges = array_map(&#xA;                    &#x27;intval&#x27;, // Parse the parts into integer&#xA;                    explode(&#xA;                        &#x27;-&#x27;, // The range separator&#xA;                        substr($_SERVER[&#x27;HTTP_RANGE&#x27;], 6) // Skip the `bytes=` part of the header&#xA;                    )&#xA;                );&#xA;&#xA;&#xA;&#xA;                // If the last range param is empty, it means the EOF (End of File)&#xA;                if(!$ranges[1]){&#xA;                    $ranges[1] = $filesize - 1;&#xA;                }&#xA;&#xA;                header(&#x27;HTTP/1.1 206 Partial Content&#x27;);&#xA;                header(&#x27;Accept-Ranges: bytes&#x27;);&#xA;                header(&#x27;Content-Length: &#x27; . ($ranges[1] - $ranges[0])); // The size of the range&#xA;&#xA;                // Send the ranges we offered&#xA;                header(&#xA;                    sprintf(&#xA;                        &#x27;Content-Range: bytes %d-%d/%d&#x27;, // The header format&#xA;                        $ranges[0], // The start range&#xA;                        $ranges[1], // The end range&#xA;                        $filesize // Total size of the file&#xA;                    )&#xA;                );&#xA;&#xA;                // It&#x27;s time to output the file&#xA;                $f = fopen($fullPath, &#x27;rb&#x27;); // Open the file in binary mode&#xA;                $chunkSize = 8192; // The size of each chunk to output&#xA;&#xA;                // Seek to the requested start range&#xA;                fseek($f, $ranges[0]);&#xA;&#xA;                // Start outputting the data&#xA;                while(true){&#xA;                    // Check if we have outputted all the data requested&#xA;                    if(ftell($f) >= $ranges[1]){&#xA;                        break;&#xA;                    }&#xA;&#xA;                    // Output the data&#xA;                    echo fread($f, $chunkSize);&#xA;&#xA;                    // Flush the buffer immediately&#xA;                    @ob_flush();&#xA;                    flush();&#xA;                }&#xA;            }else{&#xA;&#xA;                // It&#x27;s not a range request, output the file anyway&#xA;                header(&#x27;Content-Length: &#x27; . $filesize);&#xA;&#xA;                // Read the file&#xA;                @readfile($filesize);&#xA;&#xA;                // and flush the buffer&#xA;                @ob_flush();&#xA;                flush();&#xA;&#xA;&#xA;&#xA;            }&#xA;&#xA;        }else {&#xA;&#xA;            return new Response(&#x27;Invalid Path&#x27;, 404);&#xA;        }&#xA;    }&#xA;

    &#xA;

    I have notice in chrome that it's sending the range header like this :

    &#xA;

    Range : bytes=611609-

    &#xA;

    Where safari sends

    &#xA;

    Range : bytes=611609-61160

    &#xA;

    So for some reason chrome is missing the second range amount, that obviously means my code can't find a range number for the second one.

    &#xA;

    Doesn’t matter what I do I can’t get it working in both chrome and safari. Safari wants the byte range part , chrome seems to request it then sends a new request for the full file but even the full file part of the code gives a 500 error. If I take out the byte range bit then it works fine in chrome but not safari.

    &#xA;

    UPDATE :

    &#xA;

    Here is some strange things going on in chrome :

    &#xA;

    For the video i am testing with it makes 3 range requests :

    &#xA;

    REQUEST 1 HEADERS - asking for bytes 0- (to the end of the file)

    &#xA;

    GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1&#xA;&#xA;Connection: keep-alive&#xA;User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36&#xA;Accept-Encoding: identity;q=1, *;q=0&#xA;Accept: */*&#xA;Sec-Fetch-Site: same-site&#xA;Sec-Fetch-Mode: no-cors&#xA;Sec-Fetch-Dest: video&#xA;Referer: https://gofollow.vip/&#xA;Accept-Language: en-US,en;q=0.9&#xA;Range: bytes=0-&#xA;

    &#xA;

    RESPONSE GIVES IT BACK ALL THE BYTES IN THE FILE AS THAT'S WHAT WAS ASKED FOR BY CHROME :

    &#xA;

    HTTP/1.1 206 Partial Content&#xA;Date: Wed, 10 Mar 2021 12:35:54 GMT&#xA;Server: Apache&#xA;Accept-Ranges: bytes&#xA;Content-Length: 611609&#xA;Content-Range: bytes 0-611609/611610&#xA;Vary: User-Agent&#xA;Keep-Alive: timeout=5, max=100&#xA;Connection: Keep-Alive&#xA;Content-Type: video/mp4&#xA;

    &#xA;

    SECOND REQUEST HEADERS : NOW IT'S ASKING FOR 589824 to the end of the file :

    &#xA;

    Connection: keep-alive&#xA;User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36&#xA;Accept-Encoding: identity;q=1, *;q=0&#xA;Accept: */*&#xA;Sec-Fetch-Site: same-site&#xA;Sec-Fetch-Mode: no-cors&#xA;Sec-Fetch-Dest: video&#xA;Referer: https://gofollow.vip/&#xA;Accept-Language: en-US,en;q=0.9&#xA;Range: bytes=589824-&#xA;

    &#xA;

    RESPONSE OBLIGES :

    &#xA;

    HTTP/1.1 206 Partial Content&#xA;Date: Wed, 10 Mar 2021 12:35:55 GMT&#xA;Server: Apache&#xA;Accept-Ranges: bytes&#xA;Content-Length: 21785&#xA;Content-Range: bytes 589824-611609/611610&#xA;Vary: User-Agent&#xA;Keep-Alive: timeout=5, max=99&#xA;Connection: Keep-Alive&#xA;Content-Type: video/mp4&#xA;

    &#xA;

    THEN IT'S MAKING THIS 3rd REQUEST THAT GIVES AN INTERNAL SERVER ERORR, THIS TIME IT'S LITERALLY ASKING FOR THE LAST BYTE :

    &#xA;

    GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1&#xA;&#xA;Connection: keep-alive&#xA;User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36&#xA;Accept-Encoding: identity;q=1, *;q=0&#xA;Accept: */*&#xA;Sec-Fetch-Site: same-site&#xA;Sec-Fetch-Mode: no-cors&#xA;Sec-Fetch-Dest: video&#xA;Referer: https://gofollow.vip/&#xA;Accept-Language: en-US,en;q=0.9&#xA;Range: bytes=611609-&#xA;

    &#xA;

    RESPONSE - THE CONTENT LENGTH IS 0 BECAUSE THERE IS NO DIFFERENCE BETWEEN THE REQUESTED BYTES AND THE BYTES RETURNED :

    &#xA;

    HTTP/1.1 500 Internal Server Error&#xA;Date: Wed, 10 Mar 2021 12:35:56 GMT&#xA;Server: Apache&#xA;Accept-Ranges: bytes&#xA;Cache-Control: max-age=0, must-revalidate, private&#xA;X-Frame-Options: DENY&#xA;X-XSS-Protection: 1&#xA;X-Content-Type-Options: nosniff&#xA;Referrer-Policy: origin&#xA;Strict-Transport-Security: max-age=31536000; includeSubDomains&#xA;Expires: Wed, 10 Mar 2021 12:35:56 GMT&#xA;Content-Length: 0&#xA;Content-Range: bytes 611609-611609/611610&#xA;Vary: User-Agent&#xA;Connection: close&#xA;Content-Type: text/html; charset=UTF-8&#xA;

    &#xA;