
Recherche avancée
Médias (9)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (108)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Les sons
15 mai 2013, par
Sur d’autres sites (7525)
-
slicing and seeking extremeley small sections of video in ffmpeg
20 février 2021, par Zarc RowdenI am writing a program that maps midi data to timestamps in a video. The end result is a kind of automatic generation of audio visuals for beat making or techno heads. The program takes in midi, slices a video into chunks based on the midi events and mappings and finally joins the slices into a video with 1:1 timing of monophonic midi notes to sections of a video.


When it is successful, the result is very cool and watching the video jump around and lock in to midi notes is very interesting


However, I am affraid that the ffmpeg commands I use are not giving exact results.


The code I feed to ffmpeg looks like this


EVENTS : left is midinote number, right is time from start of recording in which note occurs.


[{"note"=>"start", "timestamp"=>0.0},
 {"note"=>48, "timestamp"=>0.5700000037904829},
 {"note"=>51, "timestamp"=>383.7100000018836},
 {"note"=>45, "timestamp"=>884.3500000002678},
 {"note"=>48, "timestamp"=>999.0449999968405},
 {"note"=>51, "timestamp"=>1383.544999996957},
 {"note"=>45, "timestamp"=>1884.2599999989034},
 {"note"=>48, "timestamp"=>1998.890000002575},
 {"note"=>51, "timestamp"=>2383.4199999982957},
 {"note"=>45, "timestamp"=>2884.1000000029453},
 {"note"=>48, "timestamp"=>2998.7200000032317},
 {"note"=>51, "timestamp"=>3383.2800000018324},
 {"note"=>45, "timestamp"=>3883.894999999029},
 {"note"=>48, "timestamp"=>3998.6250000001746},
 {"note"=>51, "timestamp"=>4384.550000002491},
 {"note"=>45, "timestamp"=>4883.780000003753},
 {"note"=>48, "timestamp"=>4998.404999998456},
 {"note"=>51, "timestamp"=>5384.39500000095},
 {"note"=>45, "timestamp"=>5883.565000003728},
 {"note"=>48, "timestamp"=>5998.464999996941},
 {"note"=>51, "timestamp"=>6384.254999997211},
 {"note"=>45, "timestamp"=>6883.4550000028685},
 {"note"=>48, "timestamp"=>6998.585000001185},
 {"note"=>51, "timestamp"=>7384.055000002263},
 {"note"=>45, "timestamp"=>7883.249999998952},],



MAPPINGS : left side is midi note, right is timestamp in seconds


{
 48=>234.3489,
 45=>124.334489,
 51=>2789.34,
}



That Events are a sequential array of midi notes and time taken from recordings or standard midi file. The number is in milliseconds but I convert for ffmpeg before feeding the arguments.


The mappings are just in seconds and tell the program what to show when certain midi notes are encountered as we loop through the events and begin slicing the video.


The command I send to ffmpeg is constructed like this :


"ffmpeg -an -y -ss #{begin_at} -i #{project_tempfile_url} -t #{slice_duration} -c:v libx264 #{temp_url}"



When I concatenate these slices, they only look exact when my notes are very consistent like a kickdrum doing 4/4 rythms. Anything too fast or varied creates unpleasant results.


Is there a specific set of commands that will tell ffmpeg to cut down to the frame ? I think keyframe are not an ideal answer but not sure. I also think I can adjust by making sure that I only ever map the notes to keyframes, I can settle for it but it would be great if I could just cut almost anywhere between start and end like ANYWHERE like


rand(0...video.length)
 # and then have
 332.3253613134



But I may just be dreaming :P


Do you think that I would be better off writing a custom c program to cut frames like this ? I understand that frame rates could be an issue and that there may actually not be any data at 7.34667898999 seconds and that it might be here instead : 7.356788722342 and that ffmpeg probably searches for the nearest frame from whatever timestamp you input, but I feel like there must be a way to get good results still despite these limitations.


Thank you so much in advance for those who take the time to read this and understand this issue.


-
Slicing an AVI file
7 novembre 2014, par Peter LurI am trying to upload only a certain part of an AVI file on the server without having to upload the whole file first.
If I set the slice to the beginning (byte : 0), I can read the resulting file no problem even if I slice it in any size. However if the slice start anywhere but not at byte 0, the file become unreadable. I guess this has something to do with the avi header/index being messed up. I was wondering maybe I could use ffmpeg to move the header or something ?
HTML Source
<code class="echappe-js"><script type="text/javascript"><br />
<br />
window.BlobBuilder = window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder;<br />
<br />
function sendRequest() {<br />
var blob = document.getElementById('fileToUpload').files[0];<br />
<br />
<br />
//Slicing parameters<br />
<br />
<br />
//#1: Starting at byte:0 = WORKING WELL<br />
var start = 0;<br />
var end = 1048576; // 1MB chunk sizes.<br />
<br />
<br />
//#2: Slicing the video file somewhere else (FAIL)<br />
<br />
/*<br />
var start = 1048576*3;<br />
var end = 1048576*4;<br />
*/<br />
<br />
<br />
var chunk = blob.slice(start, end, 'video/avi');<br />
uploadFile(chunk);<br />
<br />
}<br />
<br />
function fileSelected() {<br />
var file = document.getElementById('fileToUpload').files[0];<br />
if (file) {<br />
var fileSize = 0;<br />
if (file.size > 1024 * 1024)<br />
fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';<br />
else<br />
fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';<br />
<br />
document.getElementById('fileName').innerHTML = 'Name: ' + file.name;<br />
document.getElementById('fileSize').innerHTML = 'Size: ' + fileSize;<br />
document.getElementById('fileType').innerHTML = 'Type: ' + file.type;<br />
}<br />
}<br />
<br />
function uploadFile(blobFile) {<br />
//var file = document.getElementById('fileToUpload').files[0]; <br />
var fd = new FormData();<br />
fd.append("fileToUpload", blobFile);<br />
<br />
var xhr = new XMLHttpRequest();<br />
xhr.upload.addEventListener("progress", uploadProgress, false);<br />
xhr.addEventListener("load", uploadComplete, false);<br />
xhr.addEventListener("error", uploadFailed, false);<br />
xhr.addEventListener("abort", uploadCanceled, false);<br />
xhr.open("POST", "upload.php");<br />
xhr.onload = function(e) {<br />
//alert("loaded!");<br />
};<br />
<br />
xhr.send(fd);<br />
//alert("oen over");<br />
}<br />
<br />
function uploadProgress(evt) {<br />
if (evt.lengthComputable) {<br />
var percentComplete = Math.round(evt.loaded * 100 / evt.total);<br />
document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';<br />
}<br />
else {<br />
document.getElementById('progressNumber').innerHTML = 'unable to compute';<br />
}<br />
}<br />
<br />
function uploadComplete(evt) {<br />
/* This event is raised when the server send back a response */<br />
//alert(evt.target.responseText);<br />
}<br />
<br />
function uploadFailed(evt) {<br />
alert("There was an error attempting to upload the file.");<br />
}<br />
<br />
function uploadCanceled(evt) {<br />
xhr.abort();<br />
xhr = null;<br />
//alert("The upload has been canceled by the user or the browser dropped the connection.");<br />
}<br />
</script>PHP Source (upload.php)
<?php
$tmp_name = $_FILES['fileToUpload']['tmp_name'];
$size = $_FILES['fileToUpload']['size'];
$name = $_FILES['fileToUpload']['name'];
$target_file = basename($name);
$complete = "complete.avi";
$com = fopen($complete, "ab");
// Open temp file
$out = fopen($target_file, "wb");
if ( $out ) {
// Read binary input stream and append it to temp file
$in = fopen($tmp_name, "rb");
if ( $in ) {
while ( $buff = fread( $in, 1048576 ) ) {
fwrite($out, $buff);
fwrite($com, $buff);
}
}
fclose($in);
fclose($out);
}
fclose($com);
?> -
Evolution #4695 : Pouvoir filtrer selon divers critère. Principalement : mise-à-jour disponible
15 mars 2021Alors si tu te lance là-dedans, tu as des éléments dans
https://git.spip.net/spip/svp/commit/a58c4d19f6f67a6973f291f8e458320a940ee62a
et https://git.spip.net/spip/svp/commit/edad1fbc8bdb7c30829ad57df0b3a8703cdbb83cMais en fait, il faudrait revoir toute la logique de filtrage :
- Que le clic sur la case à cocher, ou le keyup du texte de filtrage appellent tous les 2 la même fonction.
- Et que cette fonction calcule un tableau de ce qui est filtré par l’un, et un autre tableau par l’autre, et fournisse l’intersection des 2 (ou des N si plus de critères)
- et rafraichisse l’affichage ou non (si 0) de la case à cocher et du nombre de plugins mettables à jour dans la vue
De plus, comme ça ne fait que cacher les lignes hors du filtre, il faut qu’à l’envoi du formulaire, ça n’envoie que les lignes visibles.
Ou pas d’ailleurs, parce que l’on peut utiliser le champ de recherche pour cocher plusieurs plugins et vouloir faire l’action sur tous, pas seulement le dernier que l’on est en train de voir.
Ça, ça pourrait d’ailleurs se résoudre en changeant le filtrage pour toujours garder visibles les plugins déjà cochés…Des tas de questions qui se posent moins avec mon implémentation.