
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (106)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (8038)
-
PHP readfile on a file which is increasing in size
13 février 2013, par Sathiya SundaramIs it possible to use PHP readfile function on a remote file whose size is unknown and is increasing in size ? Here is the scenario :
I'm developing a script which downloads a video from a third party website and simultaneously trans-codes the video into MP3 format. This MP3 is then transferred to the user via readfile.
The query used for the above process is like this :
wget -q -O- "VideoURLHere" | ffmpeg -i - "Output.mp3" > /dev/null 2>&1 &
So the file is fetched and encoded at the same time.
Now when the above process is in progress I begin sending the output mp3 to the user via readfile. The problem is that the encoding process takes some time and therefore depending on the users download speed readfile reaches an assumed EoF before the whole file is encoded, resulting in the user receiving partial content/incomplete files.My first attempt to fix this was to apply a speed limit on the users download, but this is not foolproof as the encoding time and speed vary with load and this still led to partial downloads.
So is there a way to implement this system in such a way that I can serve the downloads simultaneously along with the encoding and also guarantee sending the complete file to the end user ?
Any help is appreciated.
EDIT :
In response to Peter, I'm actually using fread(read readfile_chunked) :<?php
function readfile_chunked($filename,$retbytes=true) {
$chunksize = 1*(1024*1024); // how many bytes per chunk
$totChunk = 0;
$buffer = '';
$cnt =0;
$handle = fopen($filename, 'rb');
if ($handle === false) {
return false;
}
while (!feof($handle)) {
//usleep(120000); //Used to impose an artificial speed limit
$buffer = fread($handle, $chunksize);
echo $buffer;
ob_flush();
flush();
if ($retbytes) {
$cnt += strlen($buffer);
}
}
$status = fclose($handle);
if ($retbytes && $status) {
return $cnt; // return num. bytes delivered like readfile() does.
}
return $status;
}
readfile_chunked($linkToMp3);
?>This still does not guarantee complete downloads as depending on the users download speed and the encoding speed, the EOF() may be reached prematurely.
Also in response to theJeztah's comment, I'm trying to achieve this without having to make the user wait..so that's not an option.
-
How to record playable video files in gstreamer even if recording is interrupted unexpectedly (e.g. power disconnects) ?
16 septembre 2021, par Otter_warriorI have been recording video streams on my Jetson Xavier NX using a simple gstreamer pipeline such as this


gst-launch-1.0 -v \
nvarguscamerasrc sensor-id=0 ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! \
nvv4l2h265enc ! 'video/x-h265, stream-format=(string)byte-stream' ! \
h265parse ! qtmux ! filesink location=video.mp4 -e



All is working if the recording is interrupted by keyboard interrupt
Ctrl + C
, but if the recording is interrupted unexpectedly (e.g. power gets disconnected) the resulting file has no playable stream, even if the file size is correct.

I know that mp4 recording needs to be stopped properly otherwise it won't have the necessary information at the end of the file, but I was wondering if there was any other gstreamer pipelines or final file formats that would allow for an H265 encoded video file to be playable even if the recording is ended unexpectedly.


It would be good even if the recorded file needed to be converted before being playable (e.g. with ffmpeg), as long as the information can be recovered without having to go through non-free mp4 recovery tools.


-
ffmpeg : adding an audio file to a video at specified delays
15 juillet 2020, par JarsOfJam-SchedulerI have an array that may contain multiple occurrences of these terms : 'video, forest'. An audio file is added to the video file when the current element of this array I iterate is 'forest'. Otherwise, not. 'video and forest' elements will increment (of 5 seconds) the delay at which an audio file will be added. Example : the array contains "video, video, forest, video, forest". The first audio file will be added at delay=15000ms. The last one, at 25000ms. Computation details : 0 (initialization) + 5000 (video) + 5000 (video) + 5000 (forest) + 5000 (video) + 5000 (forest). 5000 + 5000 + 5000 = 15000. 5000*5 = 25000.


I use ffmpeg to implement this program. The problem is that only one audio file is added, at the beginning of my video file. So the delays are not actually taken into account I think.


Note that the video file also contains a music. The audio files that I try to add must be present in the video file in addition to this music. The first line of the following code adds the music to the video. The next lines try to add the audio files at good delays.


subprocess.call(
 ['C:/Users/XYZ/Downloads/ffmpeg/bin/ffmpeg.exe', '-i', 'XYZ/my_XYZ_video.webm', '-stream_loop', '-1', '-i', 'tmp_music/original_music.wav',
 '-c:v', 'copy', '-shortest', '-fflags', '+shortest', '-max_interleave_delta', '100M',
 'XYZ/my_XYZ_video_with_music.webm']
 , cwd='C:/Users/XYZ/Desktop/XYZ/')

chosen_songs = ['video', 'forest', 'forest', 'video']

time_for_ffmpeg = 0
for chosen_song in chosen_songs:
 if chosen_song == 'video':
 print('video')
 print(time_for_ffmpeg)
 time_for_ffmpeg += 2000 

 elif chosen_song == 'forest':
 print('forest')
 print(time_for_ffmpeg)
 subprocess.call(
 ['C:/Users/XYZ/Downloads/ffmpeg/bin/ffmpeg.exe', '-i', 'XYZ/my_XYZ_video_with_music.webm', '-i', 'tmp_music/forest.mp3',
 '-filter_complex',
 '[1]adelay=' + str(time_for_ffmpeg) + '|' + str(time_for_ffmpeg) + '[a1];[0][a1]amix', '-c:v', 'copy',
 'XYZ/my_XYZ_video_with_music_with_songs.webm']
 , cwd='C:/Users/XYZ/Desktop/XYZ/')
 time_for_ffmpeg += 5000
 



My question


Why can't I add the audio files corresponding to the forest the specified delays (implemented by
the variable
time_for_ffmpeg`) ? How could I fix my code ?