
Recherche avancée
Autres articles (69)
-
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 (...) -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (4720)
-
Ffmpeg HLS conversion error on AWS Lambda - ffmpeg was killed with signal SIGSEGV
20 octobre 2023, par RtiM0I'm trying to convert video files into HLS streams on a AWS Lambda. The ffmpeg configuration I have setup works for normal (Non HLS) transcoding, but in case of HLS it throws the following error :


stderr:
frame= 341 fps= 84 q=34.0 q=32.0 q=28.0 size=N/A time=00:00:12.52 bitrate=N/A speed= 3.1x 
frame= 385 fps= 85 q=34.0 q=31.0 q=27.0 size=N/A time=00:00:13.97 bitrate=N/A speed=3.08x 
frame= 433 fps= 86 q=33.0 q=30.0 q=27.0 size=N/A time=00:00:15.55 bitrate=N/A speed=3.08x 
[hls @ 0x702c480] Cannot use rename on non file protocol, this may lead to races and temporary partial files
[hls @ 0x702c480] Opening '/tmp/stream_0.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/stream_1.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/stream_2.m3u8' for writing
[hls @ 0x702c480] Opening '/tmp/master.m3u8' for writing
ffmpeg was killed with signal SIGSEGV



And I error thrown by fluent-ffmpeg is this :


2023-03-06T10:21:44.555Z 15a0a43b-5e24-42ac-ae72-fe04f0c72a3e ERROR Invoke Error 
{
 "errorType": "Error",
 "errorMessage": "ffmpeg was killed with signal SIGSEGV",
 "stack": [
 "Error: ffmpeg was killed with signal SIGSEGV",
 " at ChildProcess.<anonymous> (/var/task/node_modules/fluent-ffmpeg/lib/processor.js:180:22)",
 " at ChildProcess.emit (node:events:513:28)",
 " at ChildProcess._handle.onexit (node:internal/child_process:291:12)"
 ]
}
</anonymous>


This is the code I run on AWS Lambda to convert video files into HLS :


export const compressToHLS = (sourcePath, outputFolder) =>
 new Promise((resolve, reject) => {
 Ffmpeg(sourcePath)
 .complexFilter([
 {
 filter: "split",
 options: "3",
 inputs: "v:0",
 outputs: ["v1", "v2", "v3"],
 },
 {
 filter: "scale",
 options: {
 w: 1280,
 h: 720,
 },
 inputs: "v1",
 outputs: "v1out",
 },
 {
 filter: "scale",
 options: {
 w: 960,
 h: 540,
 },
 inputs: "v2",
 outputs: "v2out",
 },
 {
 filter: "scale",
 options: {
 w: 640,
 h: 360,
 },
 inputs: "v3",
 outputs: "v3out",
 },
 ])
 .outputOptions([
 "-map [v1out]",
 "-c:v:0",
 "libx264",
 "-b:v 3000000",
 "-map [v2out]",
 "-c:v:1",
 "libx264",
 "-b:v 2000000",
 "-map [v3out]",
 "-c:v:2",
 "libx264",
 "-b:v 1000000",
 ])
 .outputOptions([
 "-map a:0",
 "-c:a:0 aac",
 "-b:a:0 96000",
 "-ar 48000",
 "-ac 2",
 "-map a:0",
 "-c:a:1 aac",
 "-b:a:1 96000",
 "-ar 48000",
 "-ac 2",
 "-map a:0",
 "-c:a:2 aac",
 "-b:a:2 96000",
 "-ar 48000",
 "-ac 2",
 ])
 .outputOptions([
 "-f hls",
 "-hls_time 10",
 "-hls_playlist_type vod",
 "-hls_flags independent_segments",
 "-hls_segment_type mpegts",
 `-hls_segment_filename ${outputFolder}/%v_%d.ts`,
 "-master_pl_name master.m3u8",
 ])
 .outputOption("-var_stream_map", "v:0,a:0 v:1,a:1 v:2,a:2")
 .outputOption("-preset veryfast")
 .output(`${outputFolder}/stream_%v.m3u8`)
 .on("start", (cmdline) => console.log(cmdline))
 .on("progress", (progress) => {
 let prog = Math.floor(progress.percent * 10) / 10;
 if (Math.round(prog) % 10 == 0) {
 console.log(`${prog}% complete`);
 }
 })
 .on("error", (err, stdout, stderr) => {
 if (err) {
 console.log(err.message);
 console.log("stdout:\n" + stdout);
 console.log("stderr:\n" + stderr);
 reject(err);
 }
 })
 .on("end", () => resolve())
 .run();
 });



In this code the sourcePath is usually a presigned URL from S3 (But I have also tried to download a file on /tmp and setting sourcePath as the path to the downloaded file) and outputFolder is
tmpdir()
which is/tmp
.

I have the lambda settings configured to have 10GB of memory and 10GB of ephemeral storage (the maximum allowed).


-
ffMPEG write two outputs with one encoder and several filters (segmentation, timecode)
4 mai 2023, par Francoisneed some help after trying days on this. I'm able to process one input to two outputs with two encodings :


ffmpeg -f dshow -i video="Integrated Camera" -c:v mpeg2video -b:v 50000k -vf "scale=1920:1080" -an -flags +global_header -f segment -segment_time 60 -segment_format mxf -strftime 1 -reset_timestamps 1 -minrate 50000k -maxrate 50000k -bufsize 50000k "C:\ffmpeg\Master\Master_%Y-%m-%d_%H-%M-%S.mxf" -b:v 50000k -vf "scale=1920:1080" -an -flags +global_header -f segment -segment_time 60 -segment_wrap 3 -segment_format mxf -reset_timestamps 1 -minrate 50000k -maxrate 50000k -bufsize 50000k "C:\ffmpeg\Backup\backup_%02d.mxf"



But when i try to do something to get rid of the second encoding and working with "tee" filter, i run into the problem that the other filters will not work anymore. If i run this without the extra filters :


ffmpeg -f dshow -i video="Integrated Camera" -c:v mpeg2video -an -f tee -map 0:v -an "Main.mxf|[f=mxf]Backup.mxf"



This works but trying to add this filters after the -f tee filter will lead into an error. As well to define this before the tee filter will not work due to different filter settings in segmentation.


I think the way how it could work is to split the output and use afterwards the tee filter. But i wasn't able to do. Maybe someone could help me here.


Best


Francois


-
Unable to find a suitable output format for 'is' is : Invalid argument in fmmpeg
26 janvier 2023, par Test000I want to make a python script to make a video in FFmpeg. I try a lot of solutions for example but I do not know Why I do not have permission to write. I have not any idea because ffmpeg errors are a little bit tricky


my code :


import os
import cv2

def calculate_quote_position(quote, max_length, video_width, video_height):
 if len(quote) > max_length:
 print("Quote is too long for the video.")
 return
 
 # Determine font size and alignment
 font = cv2.FONT_HERSHEY_SIMPLEX
 font_scale = 1.0
 thickness = 2
 (text_width, text_height), _ = cv2.getTextSize(quote, font, font_scale, thickness)
 
 # Calculate position for the quote
 x = int((video_width - text_width) / 2)
 y = int((video_height + text_height) / 2)
 
 return (x, y, text_width, text_height)

def create_video_from_audio_quote_picture(music_file, quote, font, font_size, font_color, background_picture, output_file, video_duration, video_width, video_height, max_length):
 quote_position = calculate_quote_position(quote, max_length, video_width, video_height)
 if not quote_position:
 print("The quote is too long for the video.")
 return
 # Create the FFmpeg command
 command = f"ffmpeg -loop 1 -t {video_duration} -i {background_picture} -i {music_file} -vf drawtext='fontfile={font}':text={quote}:fontcolor={font_color}:fontsize={font_size}:x={quote_position[0]}:y={quote_position[1]}' -shortest -c:v libx264 -c:a aac {output_file}"

 # Execute the command
 os.system(command)

music_file = "music.mp3"
quote = "This is a quote"
font = "Raleway-Bold.ttf"
font_size = 20
font_color = "white"
background_picture = "nature.png"
output_file = r"C:\Users\Lukas\Dokumenty\python_scripts\Billionare livestyle\output.mp4"
video_duration = 30
video_width = 1920
video_height = 1080
max_length = 30

create_video_from_audio_quote_picture(music_file, quote, font, font_size, font_color, background_picture, output_file, video_duration, video_width, video_height, max_length)



my error :


Input #0, image2, from 'nature.png':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 569438 kb/s
 Stream #0:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mp3, from 'music.mp3':
 Metadata:
 date : 2020:12:15 01:00:00
 title : Otnicka - Peaky Blinder (lyrics) | i am not outsider i'm a peaky blinder
 artist : Jigzaw
 encoder : Lavf58.29.100
 Duration: 00:02:31.78, start: 0.023021, bitrate: 128 kb/s
 Stream #1:0: Audio: mp3, 48000 Hz, stereo, fltp, 128 kb/s
 Metadata:
 encoder : Lavf
 Stream #1:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 320x240 [SAR 1:1 DAR 4:3], 90k tbr, 90k tbn, 90k tbc (attached pic)
 Metadata:
 comment : Other
[NULL @ 000001575c0b0100] Unable to find a suitable output format for 'is'
is: Invalid argument