
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 (99)
-
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 -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
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 (5282)
-
RaspberryPi HQ camera not working with FFMPEG [closed]
12 mars 2024, par GeeTeeI just want to prefix this by saying I'm still quite fresh to linux so please bare with me as I don't always know exactly what I'm looking at.


Hardware : Raspberry Pi 5 4GB / Pi HQ camera (connected with adapter cable)
OS : Debain V12 (bookworm)
FFMPEG : ffmpeg version 5.1.4-0+rpt3+deb12u1
I2C = Enabled
X / Wayland : Wayland (had to use this for VNC)


I know the camera works as : when I use
rpicam-vid -t 0
I have a working preview without issue (albeit slightly stuttery)

When I try to enter
ffmpeg -f v4l2 -i /dev/video0
I get the following :
(with the goal of having some video in a preview window)

[video4linux2,v4l2 @ 0x5555a0811a20] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0x5555a0811a20] Time per frame unknown
[video4linux2,v4l2 @ 0x5555a0811a20] ioctl(VIDIOC_STREAMON): Invalid argument
/dev/video0: Invalid argument



I have also tried
ffplay -f v4l2 -i /dev/video0
and get the same error as above.

Following other forums I've tried (I'm not sure this is all necessary but to cover all bases, and save time) :


Prompt :
ffmpeg -sources device /dev/video0

Out : none (as inlibpostproc 56. 6.100 / 56. 6.100
is the last line)

Promt :
v4l2-ctl --list-devices

Out :

pispbe (platform:1000880000.pisp_be):
 /dev/video20
 /dev/video21
 /dev/video22
 /dev/video23
 /dev/video24
 /dev/video25
 /dev/video26
 /dev/video27
 /dev/video28
 /dev/video29
 /dev/video30
 /dev/video31
 /dev/video32
 /dev/video33
 /dev/video34
 /dev/video35
 /dev/video36
 /dev/video37
 /dev/media1
 /dev/media2

rp1-cfe (platform:1f00110000.csi):
 /dev/video0
 /dev/video1
 /dev/video2
 /dev/video3
 /dev/video4
 /dev/video5
 /dev/video6
 /dev/video7
 /dev/media0

rpivid (platform:rpivid):
 /dev/video19
 /dev/media3



(seems to me rp1-cfe is what I want / need ? which is good that it shows up ?)


Prompt :
strace cat /dev/video0

Out :

execve("/usr/bin/cat", ["cat", "/dev/video0"], 0x7fffc4c80c38 /* 41 vars */) = 0
brk(NULL) = 0x55567d41c000
faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=80471, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 80471, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fff59df4000
close(3) = 0
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\267\0\1\0\0\0py\2\0\0\0\0\0"..., 832) = 832
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1651472, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 1826976, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff59c34000
mmap(0x7fff59c40000, 1761440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7fff59c40000
munmap(0x7fff59c34000, 49152) = 0
munmap(0x7fff59df0000, 8352) = 0
mprotect(0x7fff59dc8000, 81920, PROT_NONE) = 0
mmap(0x7fff59ddc000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18c000) = 0x7fff59ddc000
mmap(0x7fff59de4000, 41120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fff59de4000
close(3) = 0
set_tid_address(0x7fff59e4b010) = 1526021
set_robust_list(0x7fff59e4b020, 24) = 0
rseq(0x7fff59e4b660, 0x20, 0, 0xd428bc00) = 0
mprotect(0x7fff59ddc000, 16384, PROT_READ) = 0
mprotect(0x5556410fc000, 16384, PROT_READ) = 0
mprotect(0x7fff59e44000, 16384, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7fff59df4000, 80471) = 0
getrandom("\x5c\x96\x77\x22\xd2\x25\xd3\x23", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55567d41c000
brk(0x55567d440000) = 0x55567d440000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=3048976, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 3048976, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fff59954000
close(3) = 0
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/dev/video0", O_RDONLY) = 3
newfstatat(3, "", {st_mode=S_IFCHR|0660, st_rdev=makedev(0x51, 0x13), ...}, AT_EMPTY_PATH) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 163840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fff5992c000
read(3, 0x7fff59930000, 131072) = -1 EINVAL (Invalid argument)
write(2, "cat: ", 5cat: ) = 5
write(2, "/dev/video0", 11/dev/video0) = 11
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=2996, ...}, AT_EMPTY_PATH) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2996
read(4, "", 4096) = 0
close(4) = 0
openat(AT_FDCWD, "/usr/share/locale/en_GB.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_GB/LC_MESSAGES/libc.mo", O_RDONLY) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=1433, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 1433, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7fff59e34000
close(4) = 0
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": Invalid argument", 18: Invalid argument) = 18
write(2, "\n", 1
) = 1
munmap(0x7fff5992c000, 163840) = 0
close(3) = 0
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++



(no idea what I'm reading here and if it's good or bad so I included it all)


Prompt :
ffmpeg -f v4l2 -list_formats all -i /dev/video0

Out :

[video4linux2,v4l2 @ 0x55561cd9da20] Raw : yuyv422 : YUYV 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : uyvy422 : UYVY 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : YVYU 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : VYUY 4:2:2 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : rgb565le : 16-bit RGB 5-6-5 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : rgb565be : 16-bit RGB 5-6-5 BE : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : rgb555le : 16-bit A/XRGB 1-5-5-5 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : rgb555be : 16-bit A/XRGB 1-5-5-5 BE : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : rgb24 : 24-bit RGB 8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : bgr24 : 24-bit BGR 8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : 0rgb : 32-bit A/XRGB 8-8-8-8 : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : bayer_bggr8 : 8-bit Bayer BGBG/GRGR : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : bayer_gbrg8 : 8-bit Bayer GBGB/RGRG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : bayer_grbg8 : 8-bit Bayer GRGR/BGBG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : bayer_rggb8 : 8-bit Bayer RGRG/GBGB : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 10-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 10-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 10-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 10-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 12-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 12-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 12-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 12-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 14-bit Bayer BGBG/GRGR Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 14-bit Bayer GBGB/RGRG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 14-bit Bayer GRGR/BGBG Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 14-bit Bayer RGRG/GBGB Packed : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 16-bit Bayer BGBG/GRGR : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 16-bit Bayer GBGB/RGRG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 16-bit Bayer GRGR/BGBG : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 16-bit Bayer RGRG/GBGB : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : gray : 8-bit Greyscale : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 10-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 12-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : Unsupported : 14-bit Greyscale (MIPI Packed) : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Raw : gray16le : 16-bit Greyscale : {16-16384, 2}x{16-16384, 1}
[video4linux2,v4l2 @ 0x55561cd9da20] Compressed: Unsupported : PiSP Bayer Compressed Format : {16-16384, 2}x{16-16384, 1}
/dev/video0: Immediate exit requested



Not sure why so many of these are unsupported, I saw a video on YouTube with the same camera and older Pi and he did not have so many unsupported.


Also, I ran the config file in the ffmpeg directory and I think it generated some additional files (wasn't working before either) are these normal ? (ffmpeg $ ls)


Changelog COPYING.LGPLv2.1 INSTALL.md libpostproc presets
compat COPYING.LGPLv3 libavcodec libswresample README.md
configure CREDITS libavdevice libswscale RELEASE
CONTRIBUTING.md doc libavfilter LICENSE.md tests
COPYING.GPLv2 ffbuild libavformat MAINTAINERS tools
COPYING.GPLv3 fftools libavutil Makefile



A side question : How do I enable and disable libraries ? I tried entering —enable-pulse for example (with and without spaces and prefixed by ffmpeg) but get an error along the lines of unrecognised option or command not found. (I've tried google but as mentioned prior, I'm a bit lost)


Thanks in advance.


-
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>


-
Long Overdue MediaWiki Upgrade
5 février 2014, par Multimedia Mike — GeneralWhat do I do ? What I do ? This library book is 42 years overdue !
I admit that it’s mine, yet I can’t pay the fine,
Should I turn it in or should I hide it again ?
What do I do ? What do I do ?I internalized the forgoing paean to the perils of procrastination by Shel Silverstein in my formative years. It’s probably why I’ve never paid a single cent in late fees in my entire life.
However, I have been woefully negligent as the steward of the MediaWiki software that drives the world famous MultimediaWiki, the internet’s central repository of obscure technical knowledge related to multimedia. It is currently running of version 1.6 software. The latest version is 1.22.
The Story So Far
According to my records, I first set up the wiki late in 2005. I don’t know which MediaWiki release I was using at the time. I probably conducted a few upgrades in the early days, but that went by the wayside perhaps in 2007. My web host stopped allowing shell access and the MediaWiki upgrade process pretty much requires running a PHP script from a command line. Upgrade time came around and I put off the project. Weeks turned into months turned into years until, according to some notes, the wiki abruptly stopped working in July, 2011. Suddenly, there were PHP errors about “Namespace” being a reserved word.While I finally laid out a plan to upgrade the wiki after all these years, I eventually found that the problem had been caused when my webhost upgraded from PHP 5.2 -> 5.3. I also learned of a small number of code changes that caused the problem to go away, thus kicking the can down the road once more.
Then a new problem showed up last week. I think it might be related to a new version of PHP again. This time, a few other things on my site broke, and I learned that my webhost now allows me to select a PHP version to use (with the version then set to “auto”, which didn’t yield much information). Rolling back to an earlier version of PHP might have solved the problem easily.
But NO ! I made the determination that this goes no further. I want this wiki upgraded.
The Arduous Upgrade Path
There are 2 general upgrade paths I can think of :
- Upgrade in place on the server
- Upgrade offline and put the site back on the server
Approach #1 is problematic since I don’t have direct shell access, though I considered using something like PHP Shell. Approach #2 involves getting the entire set of wiki files and a backup of the MySQL tables. This is workable since I keep automated backups of these items anyway.
In fairly short order, I was able to set up a working copy of the MultimediaWiki hosted on a local Linux machine. Now what’s the move ? The MediaWiki software I’m running is 1.6.10. The very latest, as of this upgrade project is 1.22.2. I suppose it’s way too much to hope that the software will upgrade cleanly from 1.6.x straight to 1.22.x, but I guess it’s worth a shot…
HA ! No chance. Okay, next idea is to march through the various versions and upgrade each in turn. MediaWiki has all their historic releases online, all the way back to the 1.3 lineage. I decided that the latest of each lineage should upgrade cleanly from anything in the previous version of lineage. E.g., 1.6.10 should upgrade cleanly to 1.7.3 (last in the 1.7 series). This seemed to be a workable strategy. So I downloaded the latest of each series, unpacked, and copied all the wiki files over the working installation and ran ‘php update.php’ in the maintenance/ directory.
The process is tedious and not without its obstacles. I consider this penance for my years of wiki neglect. First, I run into the “PHP Parse error : syntax error, unexpected T_NAMESPACE, expecting T_STRING” issue, the same that I saw years ago after the webhost transitioned from PHP 5.2 -> 5.3. I could solve this by editing assorted files and changing “Namespace” -> “MWNamespace” (which is what MediaWiki did by version 1.13). But I would prefer not to.
Instead, I downloaded the source for PHP 5.2 and compiled it in a separate directory, then called ‘/path/to/php/5.2/bin/php update.php’. Problem solved.
The next problem is that a bunch of the database update scripts are specifying “Type=InnoDB”. This isn’t supported by modern MySQL databases. Now, it’s “Engine=InnoDB”. A quick search & replace at the command line fixes this for 1.6.x… and 1.7.x… and 1.8 through 1.12. Finally, at 1.13, it was no longer necessary. As a bonus, at 1.13, I was able to test the installation since Namespace had been renamed to MWNamespace. I would later learn that the table type modifications probably could have been simplified in by changing “$wgDBmysql4 = true ;” to “$wgDBmysql5 = true ;” somewhere in LocalSettings.php.
Command line upgrading worked smoothly up through 1.18 series when I got a new syntax error :
<br />
PHP Fatal error: Call to a member function addMessages() on a non-object in /mnt/sdb1/archive/wiki/extensions/Cite.php on line 68<br />Best I could do was comment out that line. I hope that doesn’t break anything important.
In the home stretch, the very last transition (1.21 -> 1.22) failed :
PHP Fatal error : Cannot redeclare wfProfileIn() (previously declared in /mnt/sdb1/archive/wiki/includes/profiler/Profiler.php:33) in /mnt/sdb1/archive/wiki/includes/ProfilerStub.php on line 25
Apparently, this problem arises occasionally since 1.18. I found a way around it thanks to this page : Deleted the file StartProfiler.php. Who am I to argue ?
Upon completing the transition to 1.22, the wiki doesn’t look correct– the pictures aren’t showing up. The solution was to fix the temporary directory via LocalSettings.php.
Back To Production
Okay, it all works again ! Locally, that is. How to get it back to the server ? My first idea was that, knowing that this upgrade process can succeed, try stepping through the upgrade process again, but tell the update.php scripts to access the database tables on multimedia.cx. This seemed to be working for awhile, even though the database update phase often took 4-5 minutes. However, the transition from 1.8.5 -> 1.9.6 took 75 minutes and then timed out. According to my notes, “This isn’t going to work.”The new process :
- Dump the database tables from the local database.
- Create a new database remotely (melanson_wiki_ng).
- Dump the database table into melanson_wiki_ng.
- Move the index.php file out of the wiki files directory temporarily (or rename).
- Modify the LocalSettings.php to talk to the new database.
- Perform a lftp mirror operation in order to send all the files up to the server.
- Send the index.php file and hope beyond hope that everything magically works.
And that’s the story of how the updated MultimediaWiki came back online. Despite the database dump file being over 110 MB, it only tool MySQL 1m45s to transmit it all to the remote server (let’s hear it for the ‘–compress’ option). For comparison, inserting the tables back into a fresh local database took 1m07s.
When the MultimediaWiki was first live again, it loaded, but ever so slowly. This is when I finally looked into optimization and found that I was lacking any caching. So as a bonus, the MultimediaWiki should be much faster now.
Going Forward
For all I know, I did everything described here in the hardest way possible. But at least I got it done. Unless I learn of a better process, future upgrades will probably look similar to this.Additionally, I should probably take some time to figure out what new features are part of the standard MediaWiki distribution nowadays.