
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (18)
-
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (3634)
-
Code can not read property 1 of undefined [closed]
25 mai 2023, par Jesse CopasI'm a very new programmer and am working on a Tdarr plugin in JS.
Everything works fine until a 4k file tries to get transcoded and it fails with this log


2023-05-24T19:09:54.906Z ZoBKWMMKG:Node\[hidden-hog\]:Worker\[tall-tuna\]:{"pluginInputs":{"BitRate":"4000","ResolutionSelection":"1080p","Container":"mkv","AudioType":"AAC","FrameRate":"24"}}

2023-05-24T19:09:54.907Z ZoBKWMMKG:Node\[hidden-hog\]:Worker\[tall-tuna\]:Error TypeError: Cannot read property '1' of undefined



It's saying that it's unable to read property 1 of undefined and I'm looked and looked and looked and can't find what it is referring to. Hoping to get another set of eyes on it
The plugin Code is here


/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
/* eslint-disable no-restricted-globals */
const details = () => ({
 id: 'Tdarr_Plugin_Jeso_AV1_HandBrake_Transcode',
 Stage: 'Pre-processing',
 Name: 'AV1 HandBrake Transcoder',
 Type: 'Video',
 Operation: 'Transcode',
 Description: 'Transcodes to AV1 at the selected Bitrate. This is best used with Remux Files.',
 Version: '2.1.3',
 Tags: 'HandBrake,configurable',
 Inputs: [
 {
 name: 'BitRate',
 type: 'string',
 defaultValue: '4000',
 inputUI: {
 type: 'text',
 },
 tooltip: `
 ~ Requested Bitrate ~ \\n
 Put in the Bitrate you want to process to in Kbps. For example 4000Kbps is 4Mbps. `,
 },
 {
 name: 'ResolutionSelection',
 type: 'string',
 defaultValue: '1080p',
 inputUI: {
 type: 'dropdown',
 options: [
 '8KUHD',
 '4KUHD',
 '1080p',
 '720p',
 '480p',
 ],
 },
 // eslint-disable-next-line max-len
 tooltip: 'Any Resolution larger than this will become this Resolution same as the bitrate if the Res is lower than the selected it will use the res of the file as to not cause bloating of file size.',
 },
 {
 name: 'Container',
 type: 'string',
 defaultValue: 'mkv',
 inputUI: {
 type: 'dropdown',
 options: [
 'mp4',
 'mkv',
 ],
 },
 tooltip: ` Container Type \\n\\n
 mkv or mp4.\\n`,
 },
 {
 name: 'AudioType',
 type: 'string',
 defaultValue: 'AAC',
 inputUI: {
 type: 'dropdown',
 options: [
 'AAC',
 'EAC3',
 'MP3',
 'Vorbis',
 'Flac16',
 'Flac24',
 ],
 },
 // eslint-disable-next-line max-len
 tooltip: 'Set Audio container type that you want to use',
 },
 {
 name: 'FrameRate',
 type: 'string',
 defaultValue: '24',
 inputUI: {
 type: 'text',
 },
 // eslint-disable-next-line max-len
 tooltip: 'If the files framerate is higher than 24 and you want to maintain that framerate you can do so here',
 },
 ],
});
const MediaInfo = {
 videoHeight: '',
 videoWidth: '',
 videoFPS: '',
 videoBR: '',
 videoBitDepth: '',
 overallBR: '',
 videoResolution: '',
}; // var MediaInfo
// Easier for our functions if response has global scope.
const response = {
 processFile: false,
 preset: '',
 container: '.mkv',
 handBrakeMode: true,
 FFmpegMode: false,
 reQueueAfter: true,
 infoLog: '',
}; // var response
// Finds the first video stream and populates some useful variables
function getMediaInfo(file) {
 let videoIdx = -1;
 for (let i = 0; i < file.ffProbeData.streams.length; i += 1) {
 const strstreamType = file.ffProbeData.streams[i].codec_type.toLowerCase();
 // Looking For Video
 // Check if stream is a video.
 if (videoIdx === -1 && strstreamType === 'video') {
 videoIdx = i;
 // get video streams resolution
 MediaInfo.videoResolution = `${file.ffProbeData.streams[i].height}x${file.ffProbeData.streams[i].width}`;
 MediaInfo.videoHeight = Number(file.ffProbeData.streams[i].height);
 MediaInfo.videoWidth = Number(file.ffProbeData.streams[i].width);
 MediaInfo.videoFPS = Number(file.mediaInfo.track[i + 1].FrameRate) || 25;
 // calulate bitrate from dimensions and fps of file
 MediaInfo.videoBR = (MediaInfo.videoHeight * MediaInfo.videoWidth * MediaInfo.videoFPS * 0.08).toFixed(0);
 }
 }
} // end getMediaInfo()
// define resolution order from ResolutionSelection from biggest to smallest
const resolutionOrder = ['8KUHD', '4KUHD', '1080p', '720p', '480p'];
// define the width and height of each resolution from the resolution order
const resolutionsdimensions = {
 '8KUHD': '--width 7680 --height 4320',
 '4KUHD': '--width 3840 --height 2160',
 '1080p': '--width 1920 --height 1080',
 '720p': '--width 1280 --height 720',
 '480p': '--width 640 --height 480',
};
// eslint-disable-next-line no-unused-vars
const plugin = (file, librarySettings, inputs) => {
 // eslint-disable-next-line no-unused-vars
 const importFresh = require('import-fresh');
 // eslint-disable-next-line no-unused-vars
 const library = importFresh('../methods/library.js');
 // eslint-disable-next-line no-unused-vars
 const lib = require('../methods/lib')();
 // Get the selected resolution from the 'ResolutionSelection' variable
 const selectedResolution = inputs.ResolutionSelection;
 getMediaInfo(file);
 // use mediainfo to match height and width to a resolution on resolutiondimensions
 let dimensions = resolutionsdimensions[selectedResolution];
 // if the file is smaller than the selected resolution then use the file resolution
 if (MediaInfo.videoHeight < dimensions.split(' ')[3] || MediaInfo.videoWidth < dimensions.split(' ')[1]) {
 dimensions = `--width ${MediaInfo.videoWidth} --height ${MediaInfo.videoHeight}`;
 // eslint-disable-next-line brace-style
 }
 // read the bitrate of the video stream
 let videoBitRate = MediaInfo.videoBR;
 // if videoBitrate is over 1000000 devide by 100 to get the bitrate in Kbps
 if (videoBitRate > 1000000) {
 videoBitRate /= 100;
 } else { videoBitRate /= 1000; }
 // if VideoBitrate is smaller than selected bitrate then use the videoBitrate
 if (videoBitRate < inputs.BitRate) {
 // eslint-disable-next-line no-param-reassign
 inputs.BitRate = videoBitRate;
 // eslint-disable-next-line brace-style
 }
 // if VideoBitrate is larger than selected bitrate then use the selected bitrate
 else {
 // eslint-disable-next-line no-self-assign, no-param-reassign
 inputs.BitRate = inputs.BitRate;
 }

 //Skip Transcoding if File is already AV1
 if (file.ffProbeData.streams[0].codec_name === 'av1') {
 response.processFile = false;
 response.infoLog += 'File is already AV1 \n';
 return response;
 }
 // eslint-disable-next-line no-constant-condition
 if ((true) || file.forceProcessing === true) {
 // eslint-disable-next-line max-len
 response.preset = `--encoder svt_av1 -b ${inputs.BitRate} -r ${inputs.FrameRate} -E ${inputs.AudioType} -f ${inputs.Container} --no-optimize ${dimensions} --crop 0:0:0:0`;
 response.container = `.${inputs.Container}`;
 response.handbrakeMode = true;
 response.ffmpegMode = false;
 response.processFile = true;
 response.infoLog += `File is being transcoded at ${inputs.BitRate} Kbps to ${dimensions} as ${inputs.Container} \n`;
 return response;
 }
 response.infoLog += 'File is being transcoded using custom arguments \n';
 return response;
};
 };

module.exports.details = details;
module.exports.plugin = plugin;



Tried transcoding 4k files down to 1080p but it fails due to that undefined error. All Res 1080p and lower that I have tried work correctly


EDIT : I used Console.log and got this back


[2023-05-24T23:29:51.001] [ERROR] Tdarr_Server - Error running MediaInfo 1
[2023-05-24T23:29:51.004] [ERROR] Tdarr_Server - RangeError: Maximum call stack size exceeded
 at x (<anonymous>:wasm-function[381]:0x15c4d)
 at <anonymous>:wasm-function[46]:0x5dc0
 at <anonymous>:wasm-function[652]:0x21cb9
 at <anonymous>:wasm-function[1023]:0x47018
 at <anonymous>:wasm-function[853]:0x37827
 at <anonymous>:wasm-function[3684]:0xf4884
 at <anonymous>:wasm-function[3516]:0xeb5b7
 at <anonymous>:wasm-function[1061]:0x487c9
 at <anonymous>:wasm-function[795]:0x3006d
 at <anonymous>:wasm-function[3628]:0xf01cc
[2023-05-24T23:29:51.006] [ERROR] Tdarr_Server - Error running MediaInfo 2
[2023-05-24T23:29:51.006] [ERROR] Tdarr_Server - RangeError: Maximum call stack size exceeded
 at x (<anonymous>:wasm-function[381]:0x15c4d)
 at <anonymous>:wasm-function[46]:0x5dc0
 at <anonymous>:wasm-function[652]:0x21cb9
 at <anonymous>:wasm-function[1023]:0x47018
 at <anonymous>:wasm-function[853]:0x37827
 at <anonymous>:wasm-function[3684]:0xf4884
 at <anonymous>:wasm-function[3516]:0xeb5b7
 at <anonymous>:wasm-function[1061]:0x487c9
 at <anonymous>:wasm-function[795]:0x3006d
 at <anonymous>:wasm-function[3628]:0xf01cc
[2023-05-24T23:29:58.220] [ERROR] Tdarr_Server - Error running MediaInfo 1
[2023-05-24T23:29:58.223] [ERROR] Tdarr_Server - RangeError: Maximum call stack size exceeded
 at x (<anonymous>:wasm-function[381]:0x15c4d)
 at <anonymous>:wasm-function[46]:0x5dc0
 at <anonymous>:wasm-function[652]:0x21cb9
 at <anonymous>:wasm-function[1023]:0x47018
 at <anonymous>:wasm-function[853]:0x37827
 at <anonymous>:wasm-function[3684]:0xf4884
 at <anonymous>:wasm-function[3516]:0xeb5b7
 at <anonymous>:wasm-function[1061]:0x487c9
 at <anonymous>:wasm-function[795]:0x3006d
 at <anonymous>:wasm-function[3628]:0xf01cc
[2023-05-24T23:29:58.224] [ERROR] Tdarr_Server - Error running MediaInfo 2
[2023-05-24T23:29:58.224] [ERROR] Tdarr_Server - RangeError: Maximum call stack size exceeded
 at x (<anonymous>:wasm-function[381]:0x15c4d)
 at <anonymous>:wasm-function[46]:0x5dc0
 at <anonymous>:wasm-function[652]:0x21cb9
 at <anonymous>:wasm-function[1023]:0x47018
 at <anonymous>:wasm-function[853]:0x37827
 at <anonymous>:wasm-function[3684]:0xf4884
 at <anonymous>:wasm-function[3516]:0xeb5b7
 at <anonymous>:wasm-function[1061]:0x487c9
 at <anonymous>:wasm-function[795]:0x3006d
 at <anonymous>:wasm-function[3628]:0xf01cc
</anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous></anonymous>


-
How to create effect same video with FFmpeg
29 juin 2023, par Sang VoHow to make a video from an image with a drag effect like this one in FFmpeg :


https://www.youtube.com/watch?v=zC6qbpe3FyE&ab_channel=CloudMood



I tried to zoom in zoom out effects but not the same with video


ffmpeg -loop 1 -i photo.jpg -vf "zoompan=z='min(zoom+0.001,1.2)':x='if(gte(zoom,1.2),x+2,x-1)':y='if(gte(zoom,1.2),y+2,y-1)':d=10*25,framerate=25,scale=1920:1080" -c:v libx264 -t 10 -pix_fmt yuv420p -s 1920x1080 output.mp4



-
How do i simulate object-fit : fill with fluent-ffmpeg nodejs
9 juillet 2023, par marvelMilesffmpeg(input) .output(output) .outputOptions("-vf",
scale=w=$1920:h=$1080) .outputOptions("-c:a", "copy") .on("end", () => { console.log("Video conversion completed"); }) .on("error", error => { console.error("Video conversion failed:", error); }) .on("progress", function(f) { console.log("...frames ", f.frames); }) .run()

code behave more like object-fit : contain than fill