
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (76)
-
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 (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
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 (7725)
-
Problem using ffmpeg in python to decode video stream to yuv stream and send to a pipe
30 août 2019, par 瓦达所多阿萨德阿萨德This command works nice and fast in shell :
ffmpeg -c:v h264_cuvid -i ./myvideo.mp4 -f null -pix-fmt yuv420p -
It was about 13x speed or 300 frames/sec.
Then I tried to send the yuv stream to pipe and catch it the main process using the following code in python :cmd = ['ffmpeg', '-c:v', 'h264_cuvid', '-i', './myvideo.mp4', '-f', 'image2pipe', '-pix_fmt', 'yuv420p', '-']
p = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr=subprocess.PIPE)
size_Y = int(height * width)
size_UV = int(size_Y / 4)
s = time.time()
Y = p.stdout.read(size_Y)
U = p.stdout.read(size_UV)
V = p.stdout.read(size_UV)
print('read time: ', time.time() - s)However, this took seconds to read just one yuv frame. What wronged here ? Im not sure what ffmpeg was sending into the pipe, the yuv planar frames or just the pointers to data planes ?
the console output :
[('Number of Frames', 61137), ('FPS', 25.0), ('Frame Shape', (1920, 1080))]
--Number of Frames: 61137
--FPS: 25.0
--Frame Shape: (1920, 1080)
cmd: ['ffmpeg', '-c:v', 'h264_cuvid', '-i', './myvideo.mp4', '-f', 'image2pipe', '-pix_fmt', 'yuv420p', '-']
read time: 5.251002073287964
1/61137 (0.00%)read time: 2.290238618850708
2/61137 (0.00%)read time: 1.2984871864318848
3/61137 (0.00%)read time: 2.2100613117218018
4/61137 (0.01%)read time: 2.3444178104400635 -
Prevent FFmpeg from closing when a named pipe has been read completely
21 octobre 2019, par Werther BerselliI’m doing a C++ application for a university project that takes a video file (e.g. matroska) and using FFmpeg (embedding commands inside
std::system()
instructions) apply these steps :-
Extract chunks of frames (e.g. 10 seconds per chunk) and chunks of .aac audio
-
Apply some filters to frames
-
Encode video chunk and audio chunk with x264 and send it to a listening client using RTSP. This step is achieved using two named pipes, one for video and one for audio.
-
Receive the stream into another process and play it using ffplay (on localhost or lan).
I need to divide my stream in chunks because I need eventually to satisfy real-time constraints, so I can’t apply filters before to my entire input video file and only then start streaming to client.
My primary problem here is that once FFmpeg has emptied the two pipes, it close ; but other chunks of video and audio have still to be piped and streamed. I need FFmpeg to listen to the pipes waiting for new data.In bash I achieved this with the following commands.
Start to listen in a prompt for a RTSP stream :
ffplay -rtsp_flags listen rtsp://127.0.0.1@127.0.0.1:8090
Create a video named pipe and an audio named pipe :
mkfifo video_pipe
mkfifo audio_pipeUse this command to prevent FFmpeg to close when video pipe is emptied :
exec 7<>video_pipe
(it is sufficient to apply it to the pipe video and neither will the audio pipe give problems)
Activate FFmpeg command
ffmpeg -probesize 2147483647 -re -s 1280x720 -pix_fmt rgb24 -i pipe:0 -vsync 0 -i audio_pipe -r 25 -vcodec libx264 -crf 23 -preset ultrafast -f rtsp -rtsp_transport tcp rtsp://127.0.0.1@127.0.0.1:8090 < video_pipe
And then feed the pipes in another prompt :
cat audiochunk.aac > audio_pipe & cat frame*.bmp > video_pipe
These commands work well using 3 prompts, then I tried them in C++ embedding commands in
std::system()
instructions (using different threads) ; everything works, but once ffmpeg command empty the video pipe (finishing first chunk), it closes.
exec
command seems to be uneffective here.
How could I prevent FFmpeg from closing ?Two days struggling on that problem, viewing all possible internet solution. I hope I was clear despite a great headache, thanks for your suggestions in advance.
UPDATE :
My C++ code is something like this ; I putted it in a single function on a single thread, but it doesn’t change it’s behaviour.
I’m on Ubuntu 18.04.2void CameraThread::ffmpegJob()
{
std::string strvideo_length, command, timing;
long video_length, begin_chunk, end_chunk;
int begin_h, begin_m, begin_s, end_h, end_m, end_s;
command = "ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 " + Configurations::file_name;
strvideo_length = execCmd(command.c_str());
strvideo_length.pop_back(); // remove \n character
video_length = strToPositiveDigit(strvideo_length);
if(video_length == -1)
{
std::cout << "Invalid input file";
return;
}
std::system("bash -c \"rm mst-temp/mst_video_pipe\"");
std::system("bash -c \"rm mst-temp/mst_audio_pipe\"");
std::system("bash -c \"mkfifo mst-temp/mst_video_pipe\"");
std::system("bash -c \"mkfifo mst-temp/mst_audio_pipe\"");
// Keep video pipe opened
std::system("bash -c \"exec 7<>mst-temp/mst_video_pipe\"");
std::string rtsp_url = "rtsp://" + Configurations::my_own_used_ip + "@" + Configurations::client_ip +
":" + std::to_string(Configurations::port + 1);
command = "ffmpeg -probesize 2147483647 -re -s 1280x720 -pix_fmt rgb24 -i pipe:0 "
"-i mst-temp/mst_audio_pipe -r 25 -vcodec libx264 -crf 23 -preset ultrafast -f rtsp "
"-rtsp_transport tcp " + rtsp_url + " < mst-temp/mst_video_pipe &"; // Using & to continue without block on command
std::system(command.c_str());
begin_chunk = -1 * VIDEO_CHUNK;
end_chunk = 0;
// Extract the complete audio track
command = "bash -c \"ffmpeg -i " + Configurations::file_name + " -vn mst-temp/audio/complete.aac -y\"";
std::system(command.c_str());
while(true)
{
// Define the actual video chunk (in seconds) to use, if EOF is reached, exit
begin_chunk += (end_chunk - begin_chunk);
if(begin_chunk == video_length)
break;
if(end_chunk + VIDEO_CHUNK <= video_length)
end_chunk += VIDEO_CHUNK;
else
end_chunk += (video_length - end_chunk);
// Set begin and end H, M, S variables
begin_h = static_cast<int>(begin_chunk / 3600);
begin_chunk -= (begin_h * 3600);
begin_m = static_cast<int>(begin_chunk / 60);
begin_chunk -= (begin_m * 60);
begin_s = static_cast<int>(begin_chunk);
end_h = static_cast<int>(end_chunk / 3600);
end_chunk -= (end_h * 3600);
end_m = static_cast<int>(end_chunk / 60);
end_chunk -= (end_m * 60);
end_s = static_cast<int>(end_chunk);
// Extract bmp frames and audio from video chunk
// Extract frames
timing = " -ss " + std::to_string(begin_h) + ":" + std::to_string(begin_m) +
":" + std::to_string(begin_s) + " -to " + std::to_string(end_h) +
":" + std::to_string(end_m) + ":" + std::to_string(end_s);
command = "bash -c \"ffmpeg -i " + Configurations::file_name + timing +
" -compression_algo raw -pix_fmt rgb24 mst-temp/frames/output%03d.bmp\"";
std::system(command.c_str());
// Extract audio
command = "bash -c \"ffmpeg -i mst-temp/audio/complete.aac" + timing +
" -vn mst-temp/audio/audiochunk.aac -y\"";
std::system(command.c_str());
// Apply elaborations on audio and frames.........................
// Write modified audio and frames to streaming pipes
command = "bash -c \"cat mst-temp/audio/audiochunk.aac > mst-temp/mst_audio_pipe & "
"cat mst-temp/frames/output*.bmp > mst-temp/mst_video_pipe\"";
std::system(command.c_str());
}
}
</int></int></int></int></int></int> -
-
FFMPEG - Pipe Different HLS Resolutions to S3
17 juillet 2019, par MikeI’m trying to save all my HLS output files directly to S3. As you can see in the code, I’m saving output files for many different sizes and bitrates. My issue is I can’t figure out how to save the files onto S3. I have managed to get this working on an EC2 instance where I save all the files on the same server, but once I try to use
aws cli
it fails. I can also get this working if it’s just one resolution.I’m guessing it has something to do with piping multiple
aws cli
commands since I can see it tells meUnknown options:
, but I don’t see any other way of doing this.Also, I’m using the
-progress
flag so I can show the transcode progress to the user, can I pipe that directly to S3 as-well ?Note, the code below has been formatted to make it readable, it obviously doesn’t look like this when ran on the server.
FFMPEG Command
ffmpeg
-hide_banner -y
-i https://my-bucket.s3.us-west-1.amazonaws.com/in.mp4
-progress https://mybucket.s3.us-west-1.amazonaws.com/progress.log
-c:a aac
-c:v libx264
-f mp4
-profile:v high
-level:v 4.0
-crf 20
-sc_threshold 0
-flags +cgop
-movflags frag_keyframe+faststart
-pix_fmt yuv420p
-preset ultrafast
-g 100
-keyint_min 100
-hls_time 5000
-hls_playlist_type vod
-vf scale='trunc(oh*a/2)*2:288'
-b:v 600k
-maxrate 642k
-bufsize 900k
-b:a 64k
-hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/288p_600k_%03d.ts
pipe:1 | aws s3 cp - s3://my-bucket/288p_600k.m3u8
-vf scale='trunc(oh*a/2)*2:360'
-b:v 900k
-maxrate 963k
-bufsize 1350k
-b:a 96k
-hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/360p_900k_%03d.ts
pipe:1 | aws s3 cp - s3://my-bucket/360p_900k.m3u8
-vf scale='trunc(oh*a/2)*2:432'
-b:v 1600k
-maxrate 1712k
-bufsize 2400k
-b:a 128k
-hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/432p_1600k_%03d.ts
pipe:1 | aws s3 cp - s3://my-bucket/432p_1600k.m3u8
-vf scale='trunc(oh*a/2)*2:720'
-b:v 3200k
-maxrate 3424k
-bufsize 4800k
-b:a 128k
-hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/720p_3200k_%03d.ts
pipe:1 | aws s3 cp - s3://my-bucket/720p_3200k.m3u8
-vf scale='trunc(oh*a/2)*2:1080'
-b:v 5300k
-maxrate 5671k
-bufsize 7950k
-b:a 192k
-hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/1080p_5300k_%03d.ts
pipe:1 | aws s3 cp - s3://my-bucket/1080p_5300k.m3u8Error Message
Exit Code: 1(General error)
Working directory: /home/backend/public
Output:
================
Error Output:
================
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://my-bucket.s3.us-west-1.amazonaws.com/in.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:00:05.31, start: 0.000000, bitrate: 1589 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1205 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x55ba09a95300] using SAR=1/1
[libx264 @ 0x55ba09a95300] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX
[libx264 @ 0x55ba09a95300] profile Constrained Baseline, level 4.0
[libx264 @ 0x55ba09a95300] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=100 keyint_min=51 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=642 vbv_bufsize=900 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, mp4, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 512x288 [SAR 1:1 DAR 16:9], q=-1--1, 600 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 642000/0/600000 buffer size: 900000 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 64 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
encoder : Lavc57.107.100 aac
frame= 27 fps=0.0 q=28.0 size= 0kB time=00:00:01.13 bitrate=
0.3kbits/s speed=2.21x
Unknown options: -vf,scale=trunc(oh*a/2)*2:360,-b:v,900k,-maxrate,963k,-bufsize,1350k,-b:a,96k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/360p_900k_%03d.ts,-
Unknown options: -vf,scale=trunc(oh*a/2)*2:432,-b:v,1600k,-maxrate,1712k,-bufsize,2400k,-b:a,128k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/432p_1600k_%03d.ts,-
Unknown options: -vf,scale=trunc(oh*a/2)*2:720,-b:v,3200k,-maxrate,3424k,-bufsize,4800k,-b:a,128k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/720p_3200k_%03d.ts,-
Unknown options: -vf,scale=trunc(oh*a/2)*2:1080,-b:v,5300k,-maxrate,5671k,-bufsize,7950k,-b:a,192k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/1080p_5300k_%03d.ts,-
upload failed: - to s3://my-bucket/1080p_5300k.m3u8 seek() takes 2 positional arguments but 3 were given
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe
frame= 105 fps=104 q=27.0 Lsize= 0kB time=00:00:04.26 bitrate=
0.1kbits/s speed=4.24x
video:405kB audio:36kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x55ba09a95300] frame I:2 Avg QP:27.31 size: 31711
[libx264 @ 0x55ba09a95300] frame P:103 Avg QP:29.12 size: 3522
[libx264 @ 0x55ba09a95300] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x55ba09a95300] mb P I16..4: 0.8% 0.0% 0.0% P16..4: 58.1%
0.0% 0.0% 0.0% 0.0% skip:41.2%
[libx264 @ 0x55ba09a95300] coded y,uvDC,uvAC intra: 71.6% 66.1% 45.5%
inter: 29.8% 10.3% 1.5%
[libx264 @ 0x55ba09a95300] i16 v,h,dc,p: 16% 26% 35% 23%
[libx264 @ 0x55ba09a95300] i8c dc,h,v,p: 47% 22% 20% 11%
[libx264 @ 0x55ba09a95300] kb/s:811.77
[aac @ 0x55ba09e26c60] Qavg: 88.610
Conversion failed!