
Recherche avancée
Autres articles (44)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne 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 (...) -
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (6827)
-
PHP FFMPEG match Instagram aspect ratio requirements
19 mai 2021, par LinesofcodeAs stated here, the Instagram API requirements to upload a video are :


- Picture size
- - Maximum columns (horizontal pixels): 1920
- - Minimum aspect ratio [cols / rows]: 4 / 5
- - Maximum aspect ratio [cols / rows]: 16 / 9



I'm having some problems figuring it out if the aspect ratio matches. I grab the
width
andheight
of the video like this :

$ffprobe = \FFMpeg\FFProbe::create();
$video = $ffprobe->streams($file)->videos()->first();
$width = $video->get('width');
$height = $video->get('height');



And then I know the ratio by dividing the
width
byheight
.

The Instagram requirements about Portrait & Landscape videos are :


Portrait - min: 0.8 ; max: 0.99
Landscape - min: 1.01 ; max: 1.78



So why does a video of 848x480 (aspect ratio of 1.76) fails to upload to Instagram by returning "The video format is not supported" and how can I be completely sure that the aspect ratio matches the requirements before trying to upload ?


Edit


The full validation of Instagram requirements :


$video = $ffprobe->streams($file)->videos()->first();
$audio = $ffprobe->streams($file)->audios()->first();
$codec = $video->get('codec_name');
$frameRate = eval('return ' . $video->get('avg_frame_rate') . ';'); // 30/1 -> 30
$width = $video->get('width');
$height = $video->get('height');
$duration = $video->get('duration');

$ratio = round($width / $height, 3);

// Portrait
if ($width < $height)
 if ($ratio < 0.8 || $ratio > 0.99)
 return false;
 
// Landscape
if ($width > $height)
 if ($ratio < 1.01 || $ratio > 1.78)
 return false;


if (!in_array($codec, ['h264', 'hevc']))
 return false;

if ($frameRate < 23 || $frameRate > 60)
 return false;

if ($width > 1920)
 return false;

if ($duration < 3 || $duration > 60)
 return false;

if ($audio)
{
 $aCodec = $audio->get('codec_name');

 if ($aCodec != 'aac')
 return false;
}

return true;



Sample not uploading into Instagram :



-
Output always corrupt from FFMPEG using selenium python
28 avril 2021, par Didit Setiawani try to running testcase using selenium python and want to record video on every testacases, but when i try the output is always corrupted. FFMPEG process are running, no error appear on the output line. I attach my code, Please anyone help me is there anything i need to add or remove


here's the first file, for recorder :


import subprocess
from subprocess import Popen
from subprocess import call


class recorderMethod():
 videoRecording = None

 @staticmethod
 def recorder_start(res,name):
 rec_lib = 'ffmpeg -y -rtbufsize 2000M -f dshow -i video="screen-capture-recorder" -s '
 resolution = res
 buffer = ' -b:v 512k -r 20 -vcodec libx264 '
 filename = name
 extension = '.mp4'
 complete_command = rec_lib+resolution+buffer+filename+extension

 recorderMethod.videoRecording = Popen(str(complete_command))

 @staticmethod
 def recorder_stop():
 if recorderMethod.videoRecording.poll() is None:
 call('taskkill /F /T /PID ' + str(recorderMethod.videoRecording.pid))



here's the main test file for record the video


import unittest
import recorder_main
from selenium import webdriver
from time import sleep

class recordingTest(unittest.TestCase):
 #init test
 browser = webdriver.Chrome()
 baseurl = 'http://www.facebook.com/'
 record = recorder_main.recorderMethod
 
 #setup
 def setUp(self):
 #declare to use browser
 self.driver = recordingTest.browser
 #make variable for easy access
 driver = self.driver
 #maximize Firefox
 driver.maximize_window()
 #go to maukerja
 driver.get(recordingTest.baseurl)

 #test001
 def test_001_record(self):
 #start recording
 recordingTest.record.recorder_start('1920x1080','Test_Sleep')
 sleep(10)
 #stop_recording
 recordingTest.record.recorder_stop()


 #teardown
 def test_999_ShutDownTest(self):
 self.driver.close()
 
if __name__ == '__main__':
 unittest.main(exit=False)



-
How to setup a video chunker or FFMPEG to bypass Cloudflare ?
20 avril 2021, par RustyGatesIn full transparency, I am a noob so please forgive my lack of appropriate lingo as I am just barely starting to learn the languages of web development. Hope you don't have to try and decipher too much of what I'm trying to say.


So in an attempt to put this as simply as possible.


I have a PHP Script CMS that I have been doing some extensive custom work to. As mentioned, I am still learning for the most part and while my front end skills are getting very well polished, I'm still completely lose mostly when it comes to back end endeavors. And for reference, the CMS I am using is Wowonder from Codecanyon. It's essentially just a social media cms, like Facebook.


I have this installed on my own dedicated server, have WHM/Cpanel, all that good stuff. I also have my website/domain setup through Cloudflare properly. This is where the issue arises. Cloudflare limits uploads to 100 megabytes. Some of the users on my website will be uploading videos and media much bigger than 100 megabytes. (Up to 10 gigabytes in some cases). I have researched the issue long and hard and it would seem to me the obvious was to resolve the problem would be to use a video chunker (and/or something like FFMPEG ? But not sure if FFMPEG Is capable of it. Am just assuming).


I understand the basic, general idea of what chunkers do and have found some seemingly good options. Will post a couple below just as an example but not necessarily options I was considering.


[https://github.com/blueimp/jQuery-File-Upload][1]


[https://github.com/c0decracker/video-splitter][2]


[https://github.com/appijumbo/video-chunk][3]


So again, I understand the basic idea, it would chunk up the video while uploading (somewhere beneath the 100 megabyte maximum) to bypass Cloudflare's limit, and then stitch the video back together so it's in it's in it's complete form again. However, with a website that has many users uploading, I have not the slightest idea what the best solution is, or if this is the best solution at all, and if it is, how to implement it properly.


I have also installed FFMPEG on my server and did so successfully but not sure how to implement that properly either now how to tell it that it should automatically encode any videos uploaded to the website by any users and so on, nor sure if it's possible to do chunking with it although it seemingly is ?


Any advice is on the topic is much appreciated and I would be much obliged. Thanks in advance.