
Recherche avancée
Médias (1)
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (99)
-
Modifier la date de publication
21 juin 2013, parComment changer la date de publication d’un média ?
Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
Dans la rubrique "Champs à ajouter, cocher "Date de publication "
Cliquer en bas de la page sur Enregistrer -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (11447)
-
error with ffmpeg, when trying to upload a video
14 juillet 2021, par JamesI 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


-
ffmpeg/h265/opencv/c++ A method to resize frame after decoding on client side
18 janvier 2018, par 8793I’ve just joined a project to build a realtime video streaming application using ffmpeg/opencv/c++ via udp socket. On server side, they want to transmit a video size (640x480) to client, in order to reduce data transmission through network I resize the video to (320x240) and send frame. On client side (client), after receiving frame, we will upscale the frame back to (640x480). Using H265 for encode/decoding.
As I am just a beginner with video encoding, I would like to understand how to down-sampling & up-sampling the frame at server & client side in which we can incorporate with the video encoder/decoder.
A simple idea came into my mind that after decoding avframe -> Mat frame, I will upsampling this frame then display it.
I am not sure my idea is right or wrong. I would like to seek advice from any people who had experience in this area. Thank you very much !
static void updateFrameCallback(AVFrame *avframe, void* userdata) {
VideoStreamUDPClient* streamer = static_cast (userdata);
TinyClient* client = static_cast (streamer->userdata);
//Update Frame
pthread_mutex_lock(&client->mtx_updateFrame);
if (streamer->irect.width == client->frameSize.width
&& streamer->irect.height == client->frameSize.height) {
cvtAVFrameYUV4202Frame(&avframe, client->frame);
printf("TinyClient: Received Full Frame\n");
} else {
Mat block;
cvtAVFrameYUV4202Frame(&avframe, block);
block.copyTo(client->frame(streamer->irect));
}
//How to resize frame before display it!!!
imshow("Frame", client->frame);
waitKey(1);
pthread_mutex_unlock(&client->mtx_updateFrame);
} -
FFMPEG low bitrate at starting frames
21 janvier 2018, par Y. TSo I noticed that the first 1-4s of the videos that I’m converting start with a low bitrate and gradually increase untill its around the specified bitrate (
-crf 17 -minrate 2000k -maxrate 3000k -bufsize 2000k
)....
frame= 37 fps= 0.0 q=24.0 size = 113kB time=00:00:02.08 bitrate= 443.5kbits/s
frame= 66 fps= 64 q=30.0 size = 619kB time=00:00:03.20 bitrate= 1581.6kbits/s
frame= 99 fps= 64 q=28.0 size = 1106kB time=00:00:04.52 bitrate= 2002.2kbits/s
frame= 131 fps= 63 q=23.0 size = 1599kB time=00:00:05.82 bitrate= 2247.8kbits/s
...I already tried changing several settings like
-crf
,-b:v
,-minrate
,-maxrate
and-bufsize
. From my trial-and-error experience, the lower the-crf
/ higher-b:v
, the faster it reaches an appropriate bitrate, but it still has this "lagg" in the beginning of the conversion.Is it possible to immediately start with, for example 2000kbits/s, at the start of the conversion ?
EDIT
Around the first 1-30s (roughly), the clips are more pixelated than the rest of the clip. See this image for a comparison (zoomed in on area of an 1080p clip). The rest of the clip doesn’t have any visible loss like this (1850kbps encoded vs 2000kbps original), so I still assume it has something to do with the start of the encoding.