Recherche avancée

Médias (1)

Mot : - Tags -/censure

Autres articles (107)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le 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, (...)

Sur d’autres sites (9723)

  • no video above 360P with sound ytdl-core

    26 juin 2021, par Ashish

    I am able to download youtube separate videos and audios. but merging not working. 0 KB file is downloading

    


    let info = await ytdl.getInfo(req.body.videoId);
let formatVideo = ytdl.chooseFormat(info.formats, { quality: req.body.format.itag, filter: 'videoonly' });
let formatAudio = ytdl.chooseFormat(info.formats, { quality: req.body.audioTag });
// res.json({video: formatVideo, audio: formatAudio});
const tracker = {
  start: Date.now(),
  audio: { downloaded: 0, total: Infinity },
  video: { downloaded: 0, total: Infinity },
  merged: { frame: 0, speed: '0x', fps: 0 },
};
res.header('Content-Disposition', `attachment; filename=${fileName}`);

cp.exec(`ffmpeg -i ${videoStream} -i ${audioStream} -c copy ${fileName}`, (error, success) => {
  if (!error) {
    console.log(success);
  } else {
    console.log(error);
  }
});
// Prepare the progress bar
let progressbarHandle = null;
const progressbarInterval = 1000;
const showProgress = () => {
  console.log('test');
  readline.cursorTo(process.stdout, 0);
  const toMB = i => (i / 1024 / 1024).toFixed(2);

  process.stdout.write(`Audio  | ${(tracker.audio.downloaded / tracker.audio.total * 100).toFixed(2)}% processed `);
  process.stdout.write(`(${toMB(tracker.audio.downloaded)}MB of ${toMB(tracker.audio.total)}MB).${' '.repeat(10)}\n`);

  process.stdout.write(`Video  | ${(tracker.video.downloaded / tracker.video.total * 100).toFixed(2)}% processed `);
  process.stdout.write(`(${toMB(tracker.video.downloaded)}MB of ${toMB(tracker.video.total)}MB).${' '.repeat(10)}\n`);

  process.stdout.write(`Merged | processing frame ${tracker.merged.frame} `);
  process.stdout.write(`(at ${tracker.merged.fps} fps => ${tracker.merged.speed}).${' '.repeat(10)}\n`);

  process.stdout.write(`running for: ${((Date.now() - tracker.start) / 1000 / 60).toFixed(2)} Minutes.`);
  readline.moveCursor(process.stdout, 0, -3);
};

// Start the ffmpeg child process
const ffmpegProcess = cp.spawn(ffmpeg, [
  // Remove ffmpeg's console spamming
  '-loglevel', '8', '-hide_banner',
  // Redirect/Enable progress messages
  '-progress', 'pipe:3',
  // Set inputs
  '-i', 'pipe:4',
  '-i', 'pipe:5',
  // Map audio & video from streams
  '-map', '0:a',
  '-map', '1:v',
  // Keep encoding
  '-c:v', 'copy',
  // Define output file
  `${fileName}`,
], {
  windowsHide: true,
  stdio: [
    /* Standard: stdin, stdout, stderr */
    'inherit', 'inherit', 'inherit',
    /* Custom: pipe:3, pipe:4, pipe:5 */
    'pipe', 'pipe', 'pipe', 'pipe'
  ],
});
ffmpegProcess.on('close', () => {
  console.log('done');
  // Cleanup
  process.stdout.write('\n\n\n\n');
  clearInterval(progressbarHandle);
  console.log(tracker, '146');
});

// Link streams
// FFmpeg creates the transformer streams and we just have to insert / read data
ffmpegProcess.stdio[3].on('data', chunk => {
  console.log(chunk, '152');
  // Start the progress bar
  if (!progressbarHandle) progressbarHandle = setInterval(showProgress, progressbarInterval);
  // Parse the param=value list returned by ffmpeg
  const lines = chunk.toString().trim().split('\n');
  const args = {};
  for (const l of lines) {
    const [key, value] = l.split('=');
    args[key.trim()] = value.trim();
  }
  tracker.merged = args;
  // console.log(tracker.merged, '162');
});
// audio.pipe(ffmpegProcess.stdio[4]);
// video.pipe(ffmpegProcess.stdio[5]);
const audioStream = await requestObj.get(formatAudio.url);
const videoStream = await requestObj.get(formatVideo.url);
audioStream.pipe(ffmpegProcess.stdio[4]);
videoStream.pipe(ffmpegProcess.stdio[5]);
ffmpegProcess.stdio[6].pipe(res);


    


    here requestObj is a node js 'request' module

    


  • Video editing in UWP apps

    23 septembre 2021, par MatS2510

    I'm creating an video downloading app in C# and Universal Windows Platform. App downloads movies in three different file sets depending on the source :

    


      

    • .ts audio & video file
    • 


    • .mp4 only video file and .webm only audio file
    • 


    • .mp4 audio & video file
The video lenghts, on which I tested the app, range from a few seconds to several hours. Video qualities are standard YouTube qualities.
    • 


    


    The next step is video editing. User can specify start and end trimming timestamp. Video can be saved in three different modes :

    


      

    • Audio & Video
    • 


    • Only audio
    • 


    • Only video
    • 


    


    This is where the problem begins.

    


    I can't use FFmpeg as executable, because UWP framework doesn't allow to run external app.

    


    So I tried to use Windows.Media.Editing library. It works fine with all .mp4 audio & video files and some .ts files (but only with short videos up to an hour). Other cases throws two types of exceptions :

    


      

    • System.Exception
HResult=0xC00DA7FC
Message=Stream is not in a state to handle the request. Stream is not in a state to handle the request.
Source=System.Private.CoreLib
    • 


    • System.Exception
HResult=0xC00D6D60
Message=A valid type has not been set for this stream or a stream that it depends on. (Exception from HRESULT : 0xC00D6D60)
Source=System.Private.CoreLib
    • 


    


    I wrote a separate question about it : Exception when rendering a video in UWP . Here is also a link to an example (In comments with sample videos, which causes an error. Link to github repository.) that downloads and tries to convert the .ts file to the .mp4 file.

    


    So I decided to try the most complicated solution. I created a C++ DLL project and set build output destination to the new folder in the main app project folder (and set this folder to copy to build output directory). I installed an ffmpeg libraries by vcpkg and imported them in C++ project.
Here is the .cpp file :

    


    #include "pch.h"
#include "mux.h"

extern "C" {
    #include "libavformat/avformat.h"
}

int test() {
    av_register_all();
    return 0;
}


    


    Here is the header :

    


    #pragma once

#ifdef FFMPEGLIB_EXPORTS
#define FFMPEGLIB_API __declspec(dllexport)
#else
#define FFMPEGLIB_API __declspec(dllimport)
#endif

extern "C" FFMPEGLIB_API int test();


    


    And here is the C# class where is imported C++ function :

    


    class FFmpeg
{
    [DllImport(@"FFmpeg\FFmpegLib.dll")] private static extern int test();

    public static void Test()
    {
        test();
    }
}


    


    But calling an Test() void throws an error :
System.DllNotFoundException : 'Unable to load DLL 'FFmpeg\FFmpegLib.dll' or one of its dependencies : The specified module could not be found. (Exception from HRESULT : 0x8007007E)'

    


    There are also ffmpeg libraries (avcodec-58.dll, avformat-58.dll, avutil-56.dll, swresample-3.dll) in FFmpeg folder.
I also tried to import avformat-58.dll directly in C# (main app project) and call av_register_all() function, but it throws the same exception. I also checked if I could include "libavformat/avformat.h" in C++ UWP app, but it shows error "cannot open source file "libavformat/avformat.h"". I guess that C libraries are incompatible with UWP, but I'm not sure.

    


    I have no more ideas. If it is not possible to use the methods I have mentioned, my question is Are there any other ways to process videos in UWP app ?

    


  • Concatenating audio files and superimposing over video

    25 avril 2022, par kah

    I'm trying to write a program that takes a bunch of videos from a folder, compiles them, and then takes another bunch of audio files from a folder and concatenates them to then overlay the combined audio on top of the final video (hope that makes sense). I'm able to process the videos into one final output video, but I keep running into trouble combining the audio. Below I've provided two small sections of code pertaining to audio comp, I'm using moviepy to process the videos and attempting to use it for audio as well.

    


    songDirectory = './songs/'
songList = []
songs = []
audioclip=''

def makeCompilation():
    for filename in os.listdir(songDirectory):
        f = os.path.join(songDirectory, filename)
        if os.path.isfile(f) and filename.endswith(".mp3"):
            audioclip = moviepy.editor.AudioFileClip(f)
            songList.append(filename)


    for song in os.listdir(songDirectory):
        c = os.path.join(songDirectory, song)
    audio_clips = moviepy.editor.AudioFileClip(c)
    audio_output = moviepy.editor.concatenate_audioclips(audio_clips)
    finalClip = concatenate_videoclips(videos, method="compose")
    final_duration = finalClip.duration    
    final_audio_output = audio_output.set_duration(final_duration)
    final_output= finalClip.set_audio(final_audio_output).fx(afx.audio_fadein, 3.0)


    audio_path = "./songs/tempaudiofile.m4a"

    #print(description)
    # Create compilation
    final_output.write_videofile(outputFile, threads=8, temp_audiofile=audio_path, remove_temp=True, codec="libx264", audio_codec="aac")

    return description


    


    The program appeared to be able to find the audio directory, but I needed to be able to use os.path.join(songDirectory, filename) to point directly to each mp3 file so I messed around with it until I got the above code. And when I attempted to iterate through songList, I, as expected, got an error saying that 'str' wasn't iterable, and other errors saying that 'str' has no attribute 'duration'. Essentially, all I need it to do is iterate though the input folder and combine the files by whatever means. Code currently returns the output :

    


    &#127794;Free Fredobagz x Aflacko x Flint type beat - &#x27;Default_Dance&#x27; [prod. kah]-jro0v6ogZ0Y.mp4&#xA;225.05&#xA;Total Length: 225.05&#xA;225.05&#xA;Traceback (most recent call last):&#xA;  File "/Users/daddyK/Desktop/comp_ bot/make_compilation3.py", line 127, in <module>&#xA;makeCompilation(path = "./videos/",&#xA;  File "/Users/daddyK/Desktop/comp_ bot/make_compilation3.py", line 110, in makeCompilation&#xA;audio_output = moviepy.editor.concatenate_audioclips(audio_clips)&#xA;  File "/Users/daddyK/Library/Python/3.10/lib/python/site-packages/moviepy/audio/AudioClip.py", line 315, in concatenate_audioclips&#xA;durations = [c.duration for c in clips]&#xA;TypeError: &#x27;AudioFileClip&#x27; object is not iterable&#xA;</module>

    &#xA;


    &#xA;

    At this point I'm a bit stumped, so if anybody could offer some insight as to what I should do to resolve the error and/or if I'm headed in the right direction code-wise I'd greatly appreciate it ! Sorry if the code doesn't make any sense I'll post the whole .py file if needed

    &#xA;