
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (51)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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 (...)
Sur d’autres sites (5352)
-
avformat/matroskaenc : Avoid seeking when writing level 1 elements
20 avril 2019, par Andreas Rheinhardtavformat/matroskaenc : Avoid seeking when writing level 1 elements
Up until now, the writing process for level 1 elements (those elements
for which CRC-32 elements are written by default) was this in case the
output was seekable : Write the EBML ID, write an "unkown length" EBML
number of the desired length, then write the element into a dynamic
buffer, then write the dynamic buffer (after possible calculation and
writing of the CRC-element), then seek back to the size element and
overwrite the unknown-size element with the real size. The seeking and
overwriting part has been eliminated by not writing the size initially.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by : James Almer <jamrial@gmail.com> -
Why does this ffmpeg filter result in an "Invalid Size" error ?
10 avril 2019, par pdoherty926Why do I see this error message :
[Parsed_scale_0 @ 0x559a264c28a0] Invalid size ’if(gt(iw’
[AVFilterGraph @ 0x559a268a19e0] Error initializing filter ’scale’
with args ’if(gt(iw’ Error initializing complex filters.
Invalid argument
when trying to crop a video using ffmpeg and the following complex filter :
ffmpeg -f mp4 -ss 01:24 \
-i https://storage.googleapis.com/bucket/video.mp4 \
-y \
-filter_complex scale='if(gt(iw,ih),-1,616):if(gt(iw,ih),1440,-1)', crop=1440:616 \
-an \
-vcodec libx264 \
-r 60 -pix_fmt yuv420p \
-movflags faststart \
-f mp4 \
-t 1 \
/tmp/asset.1554913197962.mp4In case it’s relevant, here’s the output of ffprobe :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://storage.googleapis.com/bucket/video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.101
Duration: 00:02:53.76, start: 0.000000, bitrate: 2910 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 2777 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_time_base": "1001/60000",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 1920,
"height": 1080,
"coded_width": 1920,
"coded_height": 1080,
"has_b_frames": 1,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "16:9",
"pix_fmt": "yuv420p",
"level": 40,
"color_range": "tv",
"color_space": "bt709",
"color_transfer": "bt709",
"color_primaries": "bt709",
"chroma_location": "left",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"r_frame_rate": "30000/1001",
"avg_frame_rate": "30000/1001",
"time_base": "1/90000",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 15633630,
"duration": "173.707000",
"bit_rate": "2777254",
"bits_per_raw_sample": "8",
"nb_frames": "5206",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/44100",
"codec_tag_string": "mp4a",
"codec_tag": "0x6134706d",
"sample_fmt": "fltp",
"sample_rate": "44100",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/44100",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 7662596,
"duration": "173.755011",
"bit_rate": "125588",
"max_bit_rate": "125588",
"nb_frames": "7483",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"language": "eng",
"handler_name": "SoundHandler"
}
}
],
"format": {
"filename": "https://storage.googleapis.com/bucket/video.mp4",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "173.755000",
"size": "63209767",
"bit_rate": "2910294",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf57.56.101"
}
}
} -
How to configure proc_open "pipes" for ffmpeg stdin/stderr on Windows ?
10 septembre 2018, par GDPFirstly, I’ve spent the week googling and trying variations of dozens and dozens of answers for Unix, but it’s been a complete bust, I need an answer for Windows, so this is not a duplicate question of the Unix equivalents.
We’re trying to create a scheduled task that will process a queue of tasks in PHP, and maintain an array of up to 10 ffmpeg instances at a time. I’ve tried
exec
,shell_exec
andproc_open
, coupled with/withoutstart /B
without any "complete" luck.
I’m also quite certain that it has to do with setting up the descriptorspec and pipes (which I’m completely unfamiliar with), and here’s why :Per https://trac.ffmpeg.org/wiki/PHP,
The part that says ">/dev/null" will redirect the standard OUTPUT
(stdout) of the ffmpeg instance to /dev/null (effectively ignoring the
output) and "2>/dev/null" will redirect the standard ERROR (stderr) to
/dev/null (effectively ignoring any error log messages). These two can
be combined into a shorter representation : ">/dev/null 2>&1". If you
like, you can ?read more about I/O Redirection.An important note should be mentioned here. The ffmpeg command-line
tool uses stderr for output of error log messages and stdout is
reserved for possible use of pipes (to redirect the output media
stream generated from ffmpeg to some other command line tool). That
being said, if you run your ffmpeg in the background, you’ll most
probably want to redirect the stderr to a log file, to be able to
check it later.One more thing to take care about is the standard INPUT (stdin).
Command-line ffmpeg tool is designed as an interactive utility that
accepts user’s input (usually from keyboard) and reports the error log
on the user’s current screen/terminal. When we run ffmpeg in the
background, we want to tell ffmpeg that no input should be accepted
(nor waited for) from the stdin. We can tell this to ffmpeg, using I/O
redirection again "echo "Starting ffmpeg...\n\n";
echo shell_exec("ffmpeg -y -i input.avi output.avi null >/dev/null 2>/var/log/ffmpeg.log &");
echo "Done.\n";This example actually uses
shell_exec
, though we want to use proc_open so that we can use a loop to check if the process has completed or not.Here’s a basic sample loop of what I’ve tried. The problem in executing this is that the actual ffmpeg processing completes, but the process is hung "waiting for something". When I use debugging, and step out of the loop and terminate the process after a few minutes, the ffmpeg output is written and the script carries on. (From the command line, ffmpeg takes less than a minute to complete)
$descriptorspec = array(
array('pipe', 'r'),
array('pipe', 'w'),
array('pipe', 'w'),
);
$pipes = null;
$cwd = null;
$env = null;
$process = proc_open('start /B ffmpeg.exe -i input.mov output.mp4 -nostdin', $descriptorspec, $pipes, $cwd, $env);
$status = proc_get_status($process);
while($status['running']) {
sleep (60);
$status = proc_get_status($process);
}
proc_terminate($process);Also, as documented at ffmpeg Main-options :
Enable interaction on standard input. On by default unless standard
input is used as an input. To explicitly disable interaction you need
to specify-nostdin
.The
-nostdin
option seems to indicate that it addresses my problem, but it has no apparent affect. In all solutions for Unix that I’ve found, it appears to still require some form of this this unix added :null
or2>&1
.So, with that somewhat exhaustive prologue, can someone explain how to properly configure the
proc_open
function to satisfy howffmpeg.exe
interacts with I/O ? If there is a better or more appropriate approach, I’m happy to do that, but the important thing is to be able to loop thru an array of processes to check if they’re complete, so that other faster processes can complete in the meantime.UPDATE
After exhaustive R&D, it seems that the I/O is not the issue in making this happen (the -nostdin
option seems to work as advertised). The premise of my design was to useproc_get_status()
to determine whenffmpeg
was finished. The flaw in that approach is that apparently that does NOT return the actual PID of the ffmpeg process...it returns the parent PID. So, whenproc_get_status()
returned that the video conversion was complete, it was in fact still running, not hung. This was further complicated by testing on larger video files. The larger the video, the longer the "residual" time was that it took to actually finish — the I/O wasn’t the issue - watching the Parent PID instead of the child PID was the problem. So, without getting into much lower level system internals with Windows, this doesn’t appear to be possible with PHP directly. I’ve decided to abandon this approach, but hopefully this discovery will save someone else some time and trouble.