
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (90)
-
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 -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)
Sur d’autres sites (4518)
-
FFMPEG, want to encode 720x480 and automatically scale to 640x480 or 854x480 as necessary depending on the ratio
2 décembre 2023, par boxyloganEDIT : See appended notes at the bottom of the post.


Note : all MKVs are sourced from my original Farscape Starburst DVDs, MPEG2.
I've been slowly re-encoding my old TV shows into a crisper format and I have for some shows, mainly extras (but also full episodes) MKVs that are a mix of 4:3 and 16:9. Usually I open the files up in Mediainfo and find out which ones are 4:3, stick them in one folder to encode in 640x480, then the same with 16:9. It's worked fine for the umpteen amount of times I've had to encode my shows.
I would like to try to expedite the process with a single FFMPEG command that can automatically detect if the files are 4:3 or 16:9 and encode them properly to 640x480 or 854x480.


My main FFMPEG commands have been these two, depending on which aspect ratio I'm using :


854x480p


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=854:480,setdar=16/9 encoded/"${i%.mkv}.mkv"; done



640x480p


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=640:480,setdar=4/3 encoded/"${i%.mkv}.mkv"; done



These two have worked fine lately since I got away from the extraneous -x264-params nonsense I picked up years ago. Again, I'm trying to streamline. I found this command a day ago and it SEEMED to look PERFECT :


`for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -profile:v main -level:v 4.0 -crf 20 -c:a copy -map 0 -vf scale=w='if(gt(dar,854/480),min(854,iw*sar),2*trunc(iw*sar*oh/ih/2))':h='if(gt(dar,854/480),2*trunc(ih*ow/iw/sar/2),min(480,ih))' encoded/"${i%.mkv}.mkv"; done



Looks perfect and works great for 640x480. The only problem is that it returns 852x480, every time. I even tried a modification I found where you set the setsar=1 AFTER the scale filter, and it does nothing.


These are the first warnings I get when I try to run the command, with a 16:9 video, but it still completes :


`[Parsed_scale_0 @ 0x56299c22fcc0] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[Parsed_scale_0 @ 0x56299c20e5c0] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.



It encodes and I can see the resolution it outputs to :


`Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p(tv, top coded first (swapped)), 852x480 [SAR 1:1 DAR 71:40], q=2-31, 29.97 fps, 1k tbn



The next video is a 4:3 video and gives these warnings, however the video still completes, this time the video encodes properly to 640x480 :
your text


`[Parsed_scale_0 @ 0x5623084d4140] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.
Stream mapping:
 Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (copy)`your text`
Press [q] to stop, [?] for help
[Parsed_scale_0 @ 0x5623084d7080] Circular references detected for width 'if(gt(dar, 854/480), min(854,iw*sar), 2*trunc(iw*sar*oh/ih/2))' and height 'if(gt(dar, 854/480), 2*trunc(ih*ow/iw/sar/2), min(480,ih))' - possibly invalid.



The output details :


`Stream #0:0(eng): Video: h264 (H264 / 0x34363248), yuv420p(tv, top coded first (swapped)), 640x48 [SAR 1:1 `your text`DAR 4:3], q=2-31, 29.97 fps, 1k tbn



TL ;DR


EDIT : The actual problem is that the command is encoding the 16:9 aspect ratio files to 852x480 instead of 854x480. 854x480 is actually what I would like. 640x480 for the 4:3 is fine. Apologies, for the lack of clarification.


Videos encode (from original Farscape Starburst DVDs MPEG2) properly to libx264 640x480 for 4:3 but not to 854x480 for 16:9. 16:9 instead encodes to 852x480, despite what command is telling it to do.


Advice ? Thanks in advance ! Anything to make my re-encoding a little bit less tedious. I've been googling for hours and searching, but nothing seems to make it click. Thank you again !


-
ffmpeg+php Add Music to video
19 septembre 2013, par user2792392Dear Sir i create this code for simple video convert from one to another.
i want to add more feature like
ffmpeg+php Add Music to videohow to do it ??
convert request to begin encoding the video, andstatus
request that retrieves
* the current encoding status so the progress bar can be updated.
*
* The $outfile variable should be changed to an input value, but is set this way
* for now for testing purposes.
*
* @ver 0.1
*/
require 'config.php' ;
require 'functions.php' ;//<<-- CHECK FOR ERRORS -->>//
$type = _chkVal('type', '');
$fkey = _chkVal('fkey', '');
$infile = _chkVal('filename', '');
$outfile = 'testing.mp4';
$params = _chkVal('params', '');
// Check Request Type
$validTypes = array('convert', 'status');
if( !in_array($type, $validTypes) )
json_response(array('fkey' => $fkey, 'msg' => 'Invalid process type!'), true);
// $fkey will always be 8 characters.
// It's created with PHP's hash() function using 'crc32' algorithm in index.php
if( strlen($fkey) != 8 )
json_response(array_merge(array('fkey' => '', 'msg' => 'Invalid fkey given!')), true);
// Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4)
if( $type == 'convert' && ( strlen($infile) < 5) )
json_response(array('fkey' => $fkey, 'msg' => 'Invalid input filename given!'), true);
// Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4)
if( $type == 'convert' && ( strlen($outfile) < 5) )
json_response(array('fkey' => $fkey, 'msg' => 'Invalid output filename given!'), true);
if( $type == 'convert' && (strlen($params) < 1) )
json_response(array('fkey' => $fkey, 'msg' => 'Invalid parameters given!'), true);
//<<-- END OF ERROR CHECK -->>//
$ffmpegConvert = new ffmpegConvert($fkey);
//<<-- PROCESS REQUEST -->>//
// Start the video conversion
if( $type == 'convert' )
{
$ffmpegConvert->exec( $infile, $outfile, $params, $fkey );
// Add 2 second delay to give the server time to start writing the status log,
// otherwise $ffmpegConvert->jsonStatus() will trigger an error...
sleep(2);
$ffmpegConvert->jsonStatus();
}
// Check on video conversion progress
if( $_POST['type'] == 'status' )
{
$ffmpegConvert->jsonStatus();
}
//<<-- END OF PROCESS REQUEST -->>//
// Shouldn't get to this, but if so, let's send a message for debugging reasons....
json_response(array('msg' => 'Unhandled request type!'), true); -
Oddly-named file "not found" when trying to move/copy via MacOS Terminal [closed]
15 juin 2024, par Ben CThis is a head scratcher.


I need to move these three oddly-named files from an external 2.5" SSD to my desktop. The file names were intended to have variables replaced by date info, however, clearly it didn't work. So I'm left with these filenames that MacOS seems to want to interpret rather than treat as a string. I wish it was as easy as tossing in single quotes or escaping chars, but so far, that hasn't worked.


Files: Test01-$(internal:date_y)-$(internal:date_m)-$(internal:date_d)-.mp4 Test01-$(internal:date_y)-$(internal:date_m)-$(internal:date_d)-0001.mp4 Test01-$(internal:date_y)-$(internal:date_m)-$(internal:date_d)-0002.mp4


I'm on MacOS. In the Finder, the files are not visible. But they are not hidden files.


In Terminal, however, when I navigate to "/Volumes/TestDrive", then run a quick "ls", I can see all three files no problem. Including permissions, size, owners, full filename, etc.


However, when I attempt to move the files to my desktop, and rename in the process (even if I don't rename), Terminal tells me that "No such file or folder can be found" or something very close to that.


I've tried using mv and cp commands to put the filename in single quotes so the filename is read literally. Yet, I'm still given feedback that the file cannot be transferred because it cannot be found or doesn't exist.


mv 'Test01-$(internal:date_y)-$(internal:date_m)-$(internal:date_d)-.mp4' ~/Desktop/Test01-01.mp4' 'cp 'Test01-$(internal:date_y)-$(internal:date_m)-$(internal:date_d)-.mp4' ~/Desktop/Test01-01.mp4


When I try to escape special characters instead of quotes, I am also told the file doesn't exist. But clearly it does when I list out the contents of the drive. And there's only 3x .mp4 files, two hiddne files .fseventsd and some spotlight file.


mv Test01-\$\(internal\:date_y\)-\$\(internal\:date_m\)-\$\(internal\:date_d\)-.mp4 ~/Desktop/Test01-01.mp4


I've tried copying by inode. No luck. I've tried pulling the videos into ffmpeg (CLI based media mgmt tool) to see if I can get some info on the files, and same thing, ffmpeg (or ffprobe) both will tell me the file doesn't exist...even though I can list the files and see that it does.


I hope I'm missing something obvious, but but it seems all the obvious approaches are not yet working for me.


So my question is, what do I need to do to make these files "exist" so that I can rename them and back them up ? Happy to go down any rabbit hole.


Thanks in advance !