
Recherche avancée
Médias (91)
-
999,999
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (73)
-
Le profil des utilisateurs
12 avril 2011, parChaque 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 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (10362)
-
How to compress a video using FFmpeg in Django Rest Framework ?
28 septembre 2022, par MdHassan413I want to resize the video and picture files. so I looked for it and found
FFmpeg
and now I'm getting errors while compressing.

FileNotFoundError: [WinError 2] The system cannot find the file specified



- 

- Code




import os
import subprocess
import ffmpeg

MEDIA_MAX_UPLOAD_SIZE = 5242880 

def check_media_size(media):
 media_size = media.size
 if media_size < MEDIA_MAX_UPLOAD_SIZE:
 return media_size

@api_view(["POST"])
def medias_upload(request):

 if request.method == 'POST':
 received_media=request.FILES.getlist('media') 
 allowed_mime_types = ['image/jpeg','image/png','image/gif','image/jpg','video/mp4','video/mkv','video/mov','video/avi']
 
 upload_data = []
 if received_media:
 for media in received_media:
 received_media_mime_type = mime_type_check(media)
 received_media_size = check_media_size(media)

 if received_media_mime_type in allowed_mime_types and received_media_size:
 new_uuid = uuid.uuid4()
 if str(received_media_mime_type).split('/',1)[0] == "image":
 file_type = str(received_media_mime_type).split('/',1)[1]
 converted_uuid = subprocess.run(f'ffmpeg -i {media} -acodec {file_type} temp_location/{new_uuid}')
 upload_data.append(converted_uuid)

 if str(received_media_mime_type).split('/',1)[0] == "video":
 file_type = str(received_media_mime_type).split('/',1)[1]
 converted_uuid = subprocess.run(f'ffmpeg -i {media} -acodec {file_type} temp_location/{new_uuid}')
 upload_data.append(converted_uuid)

 else:
 return Response({"response": False, "return_code":"Failed", "result": {}, "message": "Wrong MIME-TYPE or MAXIMUM file size allowed 5MB"}, status=status.HTTP_404_NOT_FOUND)
 return Response({"response": True, "return_code": "success", "result": {"media_uploaded_uuid":upload_data}, "message": success["success"]}, status=status.HTTP_200_OK)
 return Response({"response": False, "return_code":"Failed", "result": {}, "message": "No Data Found"}, status=status.HTTP_404_NOT_FOUND)



- 

- Q . Is there any better way to compress video and picture file size ?




-
Getting [WinError 2] error while compressing video using FFmpeg in Django Rest Framework
28 septembre 2022, par MdHassan413I want to resize the video and picture files. so I looked for it and found
FFmpeg
and now I'm getting errors while compressing.TemporaryUploadedFile
don't have a path when we upload. so how can I do that ?

- 

- Error




FileNotFoundError: [WinError 2] The system cannot find the file specified



- 

- Code




import os
import subprocess
import ffmpeg

MEDIA_MAX_UPLOAD_SIZE = 5242880 

def check_media_size(media):
 media_size = media.size
 if media_size < MEDIA_MAX_UPLOAD_SIZE:
 return media_size

@api_view(["POST"])
def medias_upload(request):

 if request.method == 'POST':
 received_media=request.FILES.getlist('media') 
 allowed_mime_types = ['image/jpeg','image/png','image/gif','image/jpg','video/mp4','video/mkv','video/mov','video/avi']
 
 upload_data = []
 if received_media:
 for media in received_media:
 received_media_mime_type = mime_type_check(media)
 received_media_size = check_media_size(media)

 if received_media_mime_type in allowed_mime_types and received_media_size:
 new_uuid = uuid.uuid4()
 if str(received_media_mime_type).split('/',1)[0] == "image":
 file_type = str(received_media_mime_type).split('/',1)[1]
 converted_uuid = subprocess.run(f'ffmpeg -i {media} -acodec {file_type} temp_location/{new_uuid}')
 upload_data.append(converted_uuid)

 if str(received_media_mime_type).split('/',1)[0] == "video":
 file_type = str(received_media_mime_type).split('/',1)[1]
 converted_uuid = subprocess.run(f'ffmpeg -i {media} -acodec {file_type} temp_location/{new_uuid}')
 upload_data.append(converted_uuid)

 else:
 return Response({"response": False, "return_code":"Failed", "result": {}, "message": "Wrong MIME-TYPE or MAXIMUM file size allowed 5MB"}, status=status.HTTP_404_NOT_FOUND)
 return Response({"response": True, "return_code": "success", "result": {"media_uploaded_uuid":upload_data}, "message": success["success"]}, status=status.HTTP_200_OK)
 return Response({"response": False, "return_code":"Failed", "result": {}, "message": "No Data Found"}, status=status.HTTP_404_NOT_FOUND)



- 

- Q . Is there any better way to compress video and picture file size ?




-
Checking Video Quality using WP Code, Forminator and FFmpeg is not working [closed]
3 septembre 2024, par guiliannkamga Guilian90I have a WordPress website where users should be able to upload videos. The quality of the videos should be checked upon upload, meaning the videos must have a 16:9 aspect ratio and be in HD. If a video does not meet these conditions, the upload should not be allowed, and the user should be informed of the reason.


I am using the WordPress plugin Forminator for the video upload form and WP Code with a code snippet that contains PHP code. FFmpeg version 4.4.2 is installed on my server.






My provider is DreamHost, and I can connect to the server via Terminal on my MacBook and run ffmpeg commands without any issues.


I added the form to a page and when I upload invalid videos, unfortunately, I do not receive any error messages, which should be happening according to my code, and I do not know why.




Success Message after uploading the Video


Can someone help me ?


add_filter('forminator_custom_form_submit_before_set_fields', 'forminator_video_validation', 10, 3);

function forminator_video_validation($entry, $form_id, $field_data) {
 foreach ($field_data as $field) {
 if ($field['name'] === 'upload-1') { // 'upload-1' is the ID of the Datei-Upload-Field in Forminator
 $file = $field['value']['file']['file_path'];

 // check if the file exists
 if (!file_exists($file)) {
 wp_die('File does not exist');
 }

 // ffmpeg command to check video size and resolution
 $command = "ffmpeg -i " . escapeshellarg($file) . " 2>&1";
 $output = shell_exec($command);

 // extract resoltion from the ffmpeg output
 if (preg_match('/Stream #0:0.*Video:.* (\d+)x(\d+)/', $output, $matches)) {
 $width = (int) $matches[1];
 $height = (int) $matches[2];
 $aspect_ratio = $width / $height;
 $allowed_aspect_ratio = 16 / 9;
 $min_width = 1280;
 $min_height = 720;

 // check if the video fullfills the criterias
 if ($width < $min_width || $height < $min_height || round($aspect_ratio, 2) != round($allowed_aspect_ratio, 2)) {
 wp_die('The video must be at least in HD (1280x720) and must have the format 16:9. (Found: ' . $width . 'x' . $height . ')');
 }
 } else {
 // If the video could not be analysed
 wp_die('The Video could not be analysed');
 }
 }
 }
}