
Recherche avancée
Autres articles (93)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)
Sur d’autres sites (10900)
-
Best way to have 2 youtube-dl input with ffmpeg and php
8 janvier 2021, par Baraque ObahamasI'm trying to find the best way to combine a youtube-dl link in mp4 format with another youtube-dl link in m4a format to get an mp4 file through ffmpeg & php and to have an output in stdout in order to download the file directly.


With only one file to convert to another format, I managed to do it easily, for example from m4a to mp3 :


$cmd = "youtube-dl -f bestaudio[ext=m4a] --no-part --no-cache-dir --no-warnings --no-progress -o - https://www.youtube.com/watch?v=6Dh-RL__uN4 | ffmpeg -i - -f mp3 -ab 192k -";



But with 2 inputs, it doesn't work :


$cmd = "cat <(youtube-dl -f bestvideo[ext=mp4] --no-part --no-cache-dir --no-warnings --no-progress -o - https://www.youtube.com/watch?v=6Dh-RL__uN4) <(youtube-dl -f bestaudio[ext=m4a] --no-part --no-cache-dir --no-warnings --no-progress -o - https://www.youtube.com/watch?v=6Dh-RL__uN4) > ffmpeg -i - -movflags frag_keyframe+empty_moov+faststart -frag_duration 3600 -c:v copy -c:a copy -f mp4 -";



In this case I get a "said into stderr : "sh : 1 : Syntax error : "(" unexpected")" error.


I guess there must be a better way to do it.
I notice another problem is that on the ffmpeg command there is only one input "-i -". Now there are 2 inputs, there should be I guess "pipe:3" in addition, but so far my tests have not been conclusive.


Full code :


<?php
header('Content-Description: File Transfer');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header("Content-Disposition: attachment; filename=\"ok.mp4\"");
header("Content-Type: application/octet-stream");

$cmd = "cat <(youtube-dl -f bestvideo[ext=mp4] --no-part --no-cache-dir --no-warnings --no-progress -o - https://www.youtube.com/watch?v=6Dh-RL__uN4) <(youtube-dl -f bestaudio[ext=m4a] --no-part --no-cache-dir --no-warnings --no-progress -o - https://www.youtube.com/watch?v=6Dh-RL__uN4) > ffmpeg -i - -movflags frag_keyframe+empty_moov+faststart -frag_duration 3600 -c:v copy -c:a copy -f mp4 -";
$cmd = passthru($cmd, $status);



-
php. ffmpeg. read from input stream. How to ?
3 décembre 2020, par rzlvmpI trying to create mp4 file from looping jpg image. By transfer jpg image as a stdin stream.


$cwd = getcwd();
$env = [];
 
$descriptorspec = array(
 0 => ["pipe", "r"], // stdin
 1 => ["pipe", "w"], // stdout
 2 => ["pipe", "w"] // stderr
);

$transcode_command = 'ffmpeg -y -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -f jpeg_pipe -loop 1 -i pipe:0 -c:v libx264 -r 29.97 -t 30 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2,setsar=1" -c:a aac -shortest -movflags faststart -f mp4 /tmp/output.mp4';
$process = proc_open($transcode_command, $descriptorspec, $pipes, $cwd, $env);

$s3_client = new Aws\S3\S3Client([
 'calculate_md5' => true,
 'region' => $REGION,
 'version' => 'latest',
 'credentials' => [
 'key' => $AWS_KEY,
 'secret' => $AWS_SECRET
 ]
]);
$s3_client->registerStreamWrapper();

if (is_resource($process)) {

 $input_stream = fopen('s3://somebucket/image.jpg', 'r');

 if ($input_stream) {

 while (!feof($input_stream)) {
 fwrite($pipes[0], fread($input_stream, 1024));
 fclose($pipes[0]);
 }
 
 $output = stream_get_contents($pipes[1]);
 $error = stream_get_contents($pipes[2]);

 fclose($input_stream);
 fclose($pipes[1]);
 fclose($pipes[2]);

 print_r($output);
 print_r($error);
 }
}



And I've get response


...
Input #0, lavfi, from 'anullsrc=channel_layout=stereo:sample_rate=44100':
 Duration: N/A, start: 0.000000, bitrate: 705 kb/s
 Stream #0:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
[mjpeg @ 0xa705a0] EOI missing, emulating
Input #1, jpeg_pipe, from 'pipe:0':
 Duration: N/A, bitrate: N/A
 Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 200x200 [SAR 72:72 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #1:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
 Stream #0:0 -> #0:1 (pcm_u8 (native) -> aac (native))
[mjpeg @ 0xa70c40] overread 8
[mjpeg @ 0xa70c40] EOI missing, emulating
...



Looks like ffmpeg don't wait for stream end (
EOI missing, emulating
) and trying to create output video after firstwhile
iteration. Resulting file is mp4 with one broken frame.
If I set chunk size (1024
) bigger than image size, ffmpeg creates only one completed frame.

ffmpeg command working pretty good if I use
aws cli
(see my answer). But when I try to send input stream via PHP ffmpeg failing.

What problem may be ?..


-
FFmpeg - Save %{pts\:hms} in %variable% for saving as environment variable
29 novembre 2020, par cmd_kevinAfter closing a video in ffplay I want that the last timestamp will saved as a value of an environment variable.


To show the current timestamp in the playback window, I can use :


ffplay -vf "drawtext=text='%{pts\:hms}'" input.mp4



So there is a variable (
%{pts\:hms}
) for my purposes.

To change the value of a variable (in my case
%variable01%
), I used :

SET variable01=value



To change the environment variable with
%variable01%
, I used :SETX environment_variable_01 %variable01%
.

My problem is that I can't use
%{pts\:hms}
to define%variable01%
andecho %{pts\:hms}
orSETX environment_variable_01 %{pts\:hms}
didn't work.

So I'm trying to transfer the
%{pts\:hms}
value to%variable01%
but all of my attempts failed.

What can I do to solve my problem ?


I want this environment value to continue a video at the timestamp I closed ffplay and the command prompt.


Edit1 : I have used search facility but I didn't find an answer, especially to this specific syntax with only one percent sign
%{pts\:hms}
.

Here's my reproducible example :

ffplay -vf "drawtext=text='%{pts\:hms}'" input.mp4 & echo %{pts:hms}

Answer :%{pts\:hms}
.

I also tried :


ffplay -vf "drawtext=text='%{pts\:hms}'" input.mp4 & SET variable01=%{pts\:hms}



but the answer with


echo %variable01%



is


%{pts\:hms}.



Changing to
%{pts\:hms}%
didn't work too. The answer of echo is%{pts\:hms}%
.