Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (42)

Sur d’autres sites (7783)

  • Big question of Target size, or video bitrate must be specified when using two-pass

    14 juillet 2022, par Rojojun

    I tried to solve the error which is Target size, or video bitrate must be specified when using two-pass.

    


    But I couldn't find how to solve it and how to find path of video exactly I attached my code below this post

    


    Please give me some tips of solving the problem !

    


    @Service
public class ThumbnailService {

    public HashMap exportThumbnail(File file) throws Exception {
        // file is from controller and form-data
        //String inputPath = "Users/hojunna/Download/my/";
        //String outputPath = "/usr/local/video/thumbnail/";

        String ffmpegBasePath = "/opt/homebrew/bin/";
        FFmpeg ffmpeg = new FFmpeg(ffmpegBasePath+"ffmpeg");        
        FFprobe ffprobe = new FFprobe(ffmpegBasePath+"ffprobe");    
        
        FFmpegBuilder builder = new FFmpegBuilder()
                .setInput("/Users/hojunna/Desktop/" + file)                         
                //.overrideOutputFiles(true)                    
                //.addExtraArgs("-ss", "00:00:01")          
                .addOutput("/Users/hojunna/Desktop/test.jpg")       
                .setFrames(1)
                .setVideoFilter("select='gte(n\\,10)',scale=200:-1")
                .done();

        FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);      
        executor.createJob(builder).run();                                  
        executor.createTwoPassJob(builder).run();                           

        HashMap resultMap = new HashMap();
        return resultMap;
    }
}


    


  • Running pulseaudio inside docker container to record system audio

    20 mars 2023, par XXLuigiMario

    I'm trying to set up a Docker container with Selenium that takes a recording of the browser with system audio using ffmpeg. I've got video working using Xvfb. Unfortunately, on the audio side, it seems to be more tricky.

    


    I thought I would set up a virtual pulseaudio sink inside the container, which would allow me to record its monitor :

    


    pacmd load-module module-null-sink sink_name=loopback
pacmd set-default-sink loopback
ffmpeg -f pulse -i loopback.monitor test.wav


    


    This works on my host operating system, but when trying to start the pulseaudio daemon in a container, it fails with the following message :

    


    E: [pulseaudio] module-console-kit.c: Unable to contact D-Bus system bus: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory


    


    This would seem to be related to a freedesktop service called dbus. I've tried installing it and starting its daemon, but I couldn't seem to get it to work properly.
I couldn't find much information on how to proceed from here. What am I missing for pulseaudio ? Perhaps there's an easier way to record the system audio inside a container ?

    


    My goal is not to record it from the host operating system, but to play the audio inside the browser and record it all inside the same container.

    


  • Optimizing Adaptive Streaming with FFMPEG

    25 octobre 2018, par Ramesh Navi

    I am working on a video on demand website, I am using laravel 5.7, FFMPEG and DASH player from (dashif.org). Got some questions.

    Extracting audio like :

    ffmpeg -i original.mp4 -vn -acodec libvorbis -ab 128k -dash 1 my_audio.webm

    Converting video like :

    ffmpeg -i original.mp4 -c:v libvpx-vp9 -keyint_min 150 \
    -g 150 -tile-columns 4 -frame-parallel 1  -f webm -dash 1 \
    -an -vf scale=160:190 -b:v 250k -dash 1 video_160x90_250k.webm \
    -an -vf scale=320:180 -b:v 500k -dash 1 video_320x180_500k.webm \
    -an -vf scale=640:360 -b:v 750k -dash 1 video_640x360_750k.webm \
    -an -vf scale=1280:720 -b:v 1500k -dash 1 video_1280x720_1500k.webm

    Creating manifest like :

    ffmpeg \
    -f webm_dash_manifest -i video_160x90_250k.webm \
    -f webm_dash_manifest -i video_320x180_500k.webm \
    -f webm_dash_manifest -i video_640x360_750k.webm \
    -f webm_dash_manifest -i video_1280x720_1500k.webm \
    -f webm_dash_manifest -i my_audio.webm \
    -c copy \
    -map 0 -map 1 -map 2 -map 3 -map 4 \
    -f webm_dash_manifest \
    -adaptation_sets "id=0,streams=0,1,2,3 id=1,streams=4" \
    my_video_manifest.mpd

    Now the problems :

    1. Video conversion takes a lot of time on the latest i5 8gb
      think-pad running Ubuntu 18. 4minute mp4 took more than 30minute. 10minute, 720p MP4 took forever, had to kill the process. Is
      that normal ? Any idea to optimize ?
    2. Need to find out original
      video’s dimension so that I can avoid dimension conversion more than
      the original. ffprob looks fine in command but produces too much of
      information than required, is there any simple function ?
    3. Converted webm file is bigger in size than original mp4, original
      mp4 of 720p was 33MB, but 640p webm is 76MB. Is that normal or
      something wrong ?

    Any suggestions to optimize the process are welcome.