
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (50)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)
Sur d’autres sites (7954)
-
Transcoding Videos Using FastAPI and ffmpeg
15 janvier 2024, par Sanji VinsmokeI created an API using Fast API where I upload one or more videos, may specify the resolution of transcoding, and the output is transcoded video from 240p upto the resolution I specified. Available resolutions are - 240p, 360p, 480p, 720p, 1080p. I used ffmpeg for the transcoding job.


The problem that is bugging me since yesterday is that, after deploying to the s3 bucket and adding the url for the index.m3u8 file in any hls player, the video is blank. Only the audio and streaming are working. I have tried tweaking with the parameters in the ffmpeg parameters, the error is still there. I tried manually transcoding a video file locally, even that video's index.m3u8 file is blank in live version. I added the relevant codes for this project. I implemented each feature one by one, but I simply cannot find the reason why the video is totally blank on live.


def transcode_video(input_path, output_folder, res, video_id, video_resolution, progress_bar=None):
 # Transcode the video into .m3u8 format with segment format
 output_path = os.path.join(output_folder, f"{res}_{video_id}.m3u8")

 # Use subprocess for command execution
 chunk_size = 1 # Specify the desired chunk size in seconds

 transcode_command = [
 "ffmpeg", "-i", input_path, "-vf", f"scale={res}:'trunc(ow/a/2)*2'", "-c:a", "aac", "-strict", "-2",
 "-f", "segment", "-segment_time", str(chunk_size), "-segment_list", output_path, "-segment_format", "ts",
 f"{output_path.replace('.m3u8', '_%03d.ts')}"
 ]

 try:
 subprocess.run(transcode_command, check=True, capture_output=True)
 except subprocess.CalledProcessError as e:
 print(f"Error during transcoding: {e}")
 print(f"FFmpeg error output: {e.stderr}")
 # Continue with the next video even if an error occurs
 return False

 # Update the progress bar
 if progress_bar:
 progress_bar.update(1)
 return True


def get_bandwidth(resolution):
 # Define a simple function to calculate bandwidth based on resolution
 resolutions_and_bandwidths = {
 240: 400000,
 360: 850000,
 480: 1400000,
 720: 2500000,
 1080: 4500000,
 }
 
 return resolutions_and_bandwidths.get(resolution, 0)
def create_index_m3u8(video_id, resolutions_to_transcode):
 # Write the index.m3u8 file
 index_m3u8_path = os.path.join(OUTPUT_FOLDER, f"index_{video_id}.m3u8")
 with open(index_m3u8_path, "w") as index_file:
 index_file.write("#EXTM3U\n")
 index_file.write("#EXT-X-VERSION:3\n")

 for res in resolutions_to_transcode:
 aspect_ratio = 16 / 9
 folder_name = f"{res}p_{video_id}"
 resolution_file_name = f"{res}_{video_id}.m3u8"
 index_file.write(
 f"#EXT-X-STREAM-INF:BANDWIDTH={get_bandwidth(res)},RESOLUTION={int(res * aspect_ratio)}x{res}\n{folder_name}/{resolution_file_name}\n"
 )



I tried reducing or increasing chunk size, adding codecs, setting up dimensions. Where am I doing wrong ?


My python version is 3.8.18, ffmpeg version-4.4.4, ffmpeg-python version-0.2.0


-
Why ffmpeg launched on a google cloud function can throw "Error : Output stream error : Maximum call stack size exceeded" ?
15 décembre 2020, par Stepan ShilinI'm trying to process video files with ffmpeg running on google cloud functions. Video files are downloaded from a google file storage, processed in stream by fluent-ffmpeg and streamed to a new google storage file. It works on smaller files but throws an "Output stream error : Maximum call stack size exceeded" on larger files.



I tried running the code on a normal pc, and I haven't encountered this error, even with larger files.



These are the parameters I deploy the function with



gcloud functions deploy $FUNCTION_NAME --runtime nodejs8 --trigger-http --timeout=180 --memory 256




This is the code that processes video



function cutVideo({videoUrl, startTime, duration, dist}) {
 return ffmpeg(videoUrl)
 .outputOptions('-movflags frag_keyframe+empty_moov')
 .videoCodec('copy')
 .audioCodec('copy')
 .format('mp4')
 .setStartTime(startTime)
 .setDuration(duration);
}

const sectionStream = cutVideo({
 videoUrl,
 startTime,
 duration,
 dist: tempFilePath,
});

const outputStream = bucket.file(sectionPath)
.createWriteStream({
 metadata: {
 contentType: config.contentType,
 },
 public: true,
});




Actual error stack looks like this



Error: Output stream error: Maximum call stack size exceeded
 at Pumpify.<anonymous> (/srv/node_modules/fluent-ffmpeg/lib/processor.js:498:34)
 at emitOne (events.js:121:20)
 at Pumpify.emit (events.js:211:7)
 at Pumpify.Duplexify._destroy (/srv/node_modules/duplexify/index.js:191:15)
 at /srv/node_modules/duplexify/index.js:182:10
 at _combinedTickCallback (internal/process/next_tick.js:132:7)
 at process._tickDomainCallback (internal/process/next_tick.js:219:9)
 RangeError: Maximum call stack size exceeded
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:28:31)
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:37:30)
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:37:30)
 at value.map.v (/srv/node_modules/@google-cloud/projectify/build/src/index.js:30:32)
 at Array.map (<anonymous>)
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:30:23)
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:37:30)
 at replaceProjectIdToken (/srv/node_modules/@google-cloud/projectify/build/src/index.js:37:30)
 at value.map.v (/srv/node_modules/@google-cloud/projectify/build/src/index.js:30:32)
 at Array.map (<anonymous>)
</anonymous></anonymous></anonymous>



What could cause this error on a google cloud function ?


-
FFMPEG Encoding a video from a Readable stream
4 novembre 2022, par Michael AubryI'm facing an issue with the
seeked
event in Chrome. The issue seems to be due to how the video being seeked is encoded.

The problem seems to occur most frequently when using
ytdl-core
and piping a Readable stream into an FFMPEG child process.

let videoStream: Readable = ytdl.downloadFromInfo(info, {
 ...options,
 quality: "highestvideo"
});



With
ytdl-core
in order to get the highest quality you must combine the audio and video. So here is how I am doing it.

const ytmux = (link, options: any = {}) => {
 const result = new stream.PassThrough({
 highWaterMark: options.highWaterMark || 1024 * 512
 });

 ytdl.getInfo(link, options).then((info: videoInfo) => {
 let audioStream: Readable = ytdl.downloadFromInfo(info, {
 ...options,
 quality: "highestaudio"
 });
 let videoStream: Readable = ytdl.downloadFromInfo(info, {
 ...options,
 quality: "highestvideo"
 });
 // create the ffmpeg process for muxing
 let ffmpegProcess: any = cp.spawn(
 ffmpegPath.path,
 [
 // supress non-crucial messages
 "-loglevel",
 "8",
 "-hide_banner",
 // input audio and video by pipe
 "-i",
 "pipe:3",

 "-i",
 "pipe:4",
 // map audio and video correspondingly

 // no need to change the codec
 // output mp4 and pipe
 "-c:v",
 "libx264",
 "-x264opts",
 "fast_pskip=0:psy=0:deblock=-3,-3",
 "-preset",
 "veryslow",
 "-crf",
 "18",
 "-c",
 "copy",
 "-pix_fmt",
 "yuv420p",
 "-movflags",
 "frag_keyframe+empty_moov",
 "-g",
 "300",
 "-f",
 "mp4",

 "-map",
 "0:v",

 "-map",
 "1:a",

 "pipe:5"
 ],
 {
 // no popup window for Windows users
 windowsHide: true,
 stdio: [
 // silence stdin/out, forward stderr,
 "inherit",
 "inherit",
 "inherit",
 // and pipe audio, video, output
 "pipe",
 "pipe",
 "pipe"
 ]
 }
 );

 audioStream.pipe(ffmpegProcess.stdio[4]);
 videoStream.pipe(ffmpegProcess.stdio[3]);
 ffmpegProcess.stdio[5].pipe(result);
 });
 return result;
};



I am playing around with tons of different arguments. The result of this video gets uploaded to a Google Bucket. Then when seeking in Chrome I am getting some issues with certain frames, they are not being
seeked
.

When I pass it through FFMPEG locally and re-encode it, then upload it, I notice there are no issues.


Here is an image comparing the two results when running
ffmpeg -i FILE
(the one on the left works fine and the differences are minor)



I tried adjusting the arguments in the muxer code and am continuing to try and compare with the re-encoded video. I have no idea why this is happening, something to do with the frames.