
Recherche avancée
Autres articles (26)
-
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (4812)
-
Nodejs ffmpeg "The input file path can not be empty" error, but files exist
29 octobre 2022, par 0sziI'm trying to merge an audio file with a video file from the same source (Youtube)


In the following code I first read in the console parameters wirh commander then i define the videoOutput dir and download the highset res. video from youtube with node-ytdl-core. After that I download the audio for the video. and in the callback of the video.on("end", ....)
i call the function merge()


const path = require('path');
const fs = require('fs');
const readline = require("readline");
const ytdl = require('ytdl-core');
const { program } = require('commander');
const ffmpeg = require('ffmpeg');

program
 .option("--url, --url <url>", "Youtube video url")
 .option("--name, --name <name>", "Name of the video in hard drive")

program.parse(process.argv);


const options = program.opts();
let url = options.url;
let name = options.name;

let videoOutput = path.resolve(`./video${name}.mp4`);

let video = ytdl(url, {
 quality: "highestvideo"
});

let starttime = 0;

video.pipe(fs.createWriteStream(videoOutput));

video.once('response', () => {
 starttime = Date.now();
});

video.on('progress', (chunkLength, downloaded, total) => {
 const percent = downloaded / total;
 const downloadedMinutes = (Date.now() - starttime) / 1000 / 60;
 const estimatedDownloadTime = (downloadedMinutes / percent) - downloadedMinutes;
 readline.cursorTo(process.stdout, 0);
 process.stdout.write(`${(percent * 100).toFixed(2)}% downloaded `);
 process.stdout.write(`(${(downloaded / 1024 / 1024).toFixed(2)}MB of ${(total / 1024 / 1024).toFixed(2)}MB)\n`);
 process.stdout.write(`running for: ${downloadedMinutes.toFixed(2)}minutes`);
 process.stdout.write(`, estimated time left: ${estimatedDownloadTime.toFixed(2)}minutes `);
 readline.moveCursor(process.stdout, 0, -1);
 });

 video.on('end', () => {
 process.stdout.write('\n\n');
 });


// repeat for audio
video = ytdl(url, {
 quality: "highestaudio"
});
 
starttime = 0;

let audioOutput = path.resolve(`./audio${name}.mp3`);

video.pipe(fs.createWriteStream(audioOutput));

video.once('response', () => {
 starttime = Date.now();
});

video.on('progress', (chunkLength, downloaded, total) => {
 const percent = downloaded / total;
 const downloadedMinutes = (Date.now() - starttime) / 1000 / 60;
 const estimatedDownloadTime = (downloadedMinutes / percent) - downloadedMinutes;
 readline.cursorTo(process.stdout, 0);
 process.stdout.write(`${(percent * 100).toFixed(2)}% downloaded `);
 process.stdout.write(`(${(downloaded / 1024 / 1024).toFixed(2)}MB of ${(total / 1024 / 1024).toFixed(2)}MB)\n`);
 process.stdout.write(`running for: ${downloadedMinutes.toFixed(2)}minutes`);
 process.stdout.write(`, estimated time left: ${estimatedDownloadTime.toFixed(2)}minutes `);
 readline.moveCursor(process.stdout, 0, -1);
 });


function merge(){
 ffmpeg()
 .input("./videotest.mp4") //your video file input path
 .input("./audiotest.mp3") //your audio file input path
 .output("./finished.mp4") //your output path
 .outputOptions(['-map 0:v', '-map 1:a', '-c:v copy', '-shortest'])
 .on('start', (command) => {
 console.log('TCL: command -> command', command)
 })
 .on('error', (error) => console.log("errrrr",error))
 .on('end',()=>console.log("Completed"))
 .run() 
}

video.on('end', () => {
 process.stdout.write('\n\n');
 merge();
});

</name></url>


But even though the files are there ffmpeg throws me this error :



I also tried this in the video-end callback, because maybe the audio is finished downloading before the video, still doesn't work. I've also tried to rename the outputDirs for the files and keep the old files and rerun the script so the files are 100% there. Still doesn't work.


I have also tried absolute paths ("C :/..." also with backslash "C :\...") but I still get the error message that the input file path can't be empty.


Appreciate any piece of advise or help !


-
Ffmpeg x265 error : "Color Primaries must be", "ransfer Characteristics must be", "Matrix Coefficients must be" [closed]
16 septembre 2022, par Mister SirI'm trying to do the following conversion :


ffmpeg -i video.mp4 -map 0 -c copy -c:v libx265 -crf 30 -vf "scale=-1:\'min(720,ih)\'" -c:a libopus -b:a 44k -map_metadata 0 -loglevel error -hide_banner video.mkv



This works fine except for a specific video. I'm getting the following output :


x265 [info]: HEVC encoder version 3.5+39-7c7ea0a4b
x265 [info]: build info [Windows][GCC 12.1.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [error]: Color Primaries must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, film, bt2020, smpte-st-428, smpte-rp-431 or smpte-eg-432
x265 [error]: Transfer Characteristics must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67
x265 [error]: Matrix Coefficients must be unknown, bt709, fcc, bt470bg, smpte170m, smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp
[libx265 @ 00000000005a2940] Cannot open libx265 encoder.



Can't find a single result when I google the first error text,
ffmpeg "Color Primaries must be unknown"


This is the verbose output :


ffmpeg version 2022-06-16-git-5242ede48d-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 11.3.0 (Rev1, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 57. 27.100 / 57. 27.100
 libavcodec 59. 33.100 / 59. 33.100
 libavformat 59. 25.100 / 59. 25.100
 libavdevice 59. 6.100 / 59. 6.100
 libavfilter 8. 41.100 / 8. 41.100
 libswscale 6. 6.100 / 6. 6.100
 libswresample 4. 6.100 / 4. 6.100
 libpostproc 56. 5.100 / 56. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_2022-07-22_10-01-25.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : 2022-07-04T13:14:36.000000Z
 Duration: 00:01:04.32, start: 0.000000, bitrate: 342 kb/s
 Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, reserved, progressive), 1280x720, 209 kb/s, 24.99 fps, 50 tbr, 90k tbn (default)
 Metadata:
 creation_time : 2022-07-04T13:14:29.000000Z
 handler_name : VideoHandle
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 creation_time : 2022-07-04T13:14:29.000000Z
 handler_name : SoundHandle
 vendor_id : [0][0][0][0]
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 0, only the last option '-c:v libx265' will be used.
Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 1, only the last option '-c:a libopus' will be used.
File 'C:\Users\Administrator\Downloads\delendum\New folder\testout.mkv' already exists. Overwrite? [y/N] Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
 Stream #0:1 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.5+37-07b011400
x265 [info]: build info [Windows][GCC 11.2.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [error]: Color Primaries must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, film, bt2020, smpte-st-428, smpte-rp-431 or smpte-eg-432
x265 [error]: Transfer Characteristics must be unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte-st-2084, smpte-st-428 or arib-std-b67
x265 [error]: Matrix Coefficients must be unknown, bt709, fcc, bt470bg, smpte170m, smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte-st-2085, chroma-nc, chroma-c or ictcp
[libx265 @ 0000000002e60340] Cannot open libx265 encoder.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[libopus @ 000000000056fe00] 1 frames left in the queue on closing
Conversion failed!



I'm not an expert at video encoding, so I don't really know what this all means. Probably something with the source file. How to get around this ? Thanks in advance ! If I need to upload the video, let me know how I can do that.


-
how to remux/fix video file saved with testdisk that reports error "Invalid NAL unit size"
18 août 2022, par LukaI have deleted a video file from an SD card and then 'undeleted' it with tool called testdisk for Linux. It saved complete file (6Gb), but video seems broken (can't be played by any video players) and ffprobe reports :


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c613baef00] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c613baef00] st: 0 edit list 1 Cannot find an index entry before timestamp: 1000.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c613baef00] Found duplicated MOOV Atom. Skipped it
[aac @ 0x55c613bb6dc0] channel element 3.6 is not allocated
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-2119335523 > 644375).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (1846222201 > 61596).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-864346179 > 57764).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (822755552 > 161099).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (188456672 > 131075).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-2009136561 > 113517).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-821906870 > 228207).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-516947408 > 120554).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (268246533 > 115897).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-1483463928 > 238451).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-1693450506 > 114421).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (1048922816 > 114846).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-600883429 > 357422).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-1612859848 > 93601).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-600474974 > 111975).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (321873764 > 211226).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-665491613 > 92183).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (258461639 > 95290).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (713914840 > 195792).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-556556768 > 93998).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-1864278243 > 94783).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-333442404 > 203732).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (1836887686 > 95706).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (125657193 > 96573).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-2049008956 > 342294).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (650110420 > 98067).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (694115932 > 100359).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (955742608 > 204098).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (1004021052 > 100944).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-885264782 > 100557).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[h264 @ 0x55c613bb0cc0] Invalid NAL unit size (-1074298568 > 209804).
[h264 @ 0x55c613bb0cc0] Error splitting the input into NAL units.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c613baef00] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55c613baef00] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(pc, bt709), 1920x1080, 29593 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MVI_1399.MP4':
 Metadata:
 creation_time : 2022-08-17T17:13:19.000000Z
 major_brand : mp42
 minor_version : 1
 make : 
 make-eng : 
 model : 
 model-eng : 
 compatible_brands: mp42avc1CAEP
 Duration: 00:29:59.08, start: 0.000000, bitrate: 29879 kb/s
 Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none(pc, bt709), 1920x1080, 29593 kb/s, 25 fps, 25 tbr, 25k tbn, 50k tbc (default)
 Metadata:
 creation_time : 2022-08-17T17:13:19.000000Z
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 253 kb/s (default)
 Metadata:
 creation_time : 2022-08-17T17:13:19.000000Z



I'm no programmer, but have used ffmpeg a lot. How can I remux (or even re-encode) such file to fix this and make the file usable for further work ?


I have created a 10seconds snippet with
ffmpeg -i MVI_1399.MP4 -t 00:00:10 -c copy MVI_1399_10sec.mp4
for anyone to check. I also created a ten second snippet from a functioning clip from the same camera (I presume same codec parameters etc) :

https://cb.emanat.si/s/WzTCxHDkzGw3gM3