Recherche avancée

Médias (91)

Autres articles (101)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (7421)

  • FFMPEG get stuck when transcoding too many FLAC audios [closed]

    6 juin 2024, par user25436721

    I'm currently using Editly for create some videos from code, but there are some bugs with ffmpeg(latest).

    


    Nothing returns after hours processing(460 audios files during test), I already tried with flac, aac, libshine and libmp3lame encoders, already tried a different a ffmpeg version(static).

    


    From the editly code, I already changed the ffmpeg query, slicing in chunks(75), the results were :

    


      

    • 0, 75 ok
    • 


    • 0, 80 stuck
    • 


    • 75, 150 ok
    • 


    • 150, 225 ok
    • 


    • 225, 300 stuck
    • 


    • 300, 375 ok
    • 


    • 375, 450 ok
    • 


    


    Stuck screen(directly from terminal) :

    


    built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
  configuration: --pkg-config-flags=--static --prefix='~/ffmpeg/dyn' --extra-cflags='-I/~/ffmpeg/dyn/include' --extra-ldflags='-L/~/ffmpegffmpeg/dyn/lib' --bindir='~/ffmpeg/dyn/bin' --enable-debug=3 --enable-vaapi --enable-libvorbis --enable-libvpx --enable-gpl --cpu=native --enable-opengl --enable-libfdk-aac --enable-libx264 --enable-nonfree --enable-libmp3lame --enable-libshine
  libavutil      59. 21.100 / 59. 21.100
  libavcodec     61.  6.100 / 61.  6.100
  libavformat    61.  3.104 / 61.  3.104
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100

Input #n..., flac, from 'editly-tmp-.../clip...-audio.flac':
  Metadata:
    encoder         : Lavf61.3.104
  Duration: 00:01:53.62, start: 0.000000, bitrate: 1 kb/s
  Stream #458:0: Audio: flac, 48000 Hz, stereo, s32 (24 bit)
Stream mapping:
  Stream #n1:0 (flac) -> acrossfade
  Stream #n2:0 (flac) -> acrossfade
  Stream #n3:0 (flac) -> acrossfade
  Stream #n...:0 (flac) -> acrossfade
  acrossfade:default -> Stream #0:0 (libshine)
  Press [q] to stop, [?] for help


    


    if I quit then returns :

    


    [fc#0 @] [ao0->#0:0 @] No filtered frames for output stream, trying to initialize anyway.
Output #0, mp3, to 'editly-tmp-.../audio-concat.mp3':
  Metadata:
    TSSE            : Lavf61.3.104
  Stream #0:0: Audio: mp3, 48000 Hz, stereo, s16p, 128 kb/s
      Metadata:
        encoder         : Lavc61.6.100 libshine
[out#0/mp3 @ 0x60633b423480] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
[out#0/mp3 @ 0x60633b423480] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
size=       0KiB time=N/A bitrate=N/A speed=N/A    


    


    Editly code for generating FFMPEG query :

    


        let inStream = '[0:a]';
    const filterGraph = clipAudio.slice(0, -1).map(({ transition }, i) => {
      const outStream = `[concat${i}]`;

      const epsilon = 0.0001; // If duration is 0, ffmpeg seems to default to 1 sec instead, hence epsilon.
      let ret = `${inStream}[${i + 1}:a]acrossfade=d=${Math.max(epsilon, transition.duration)}:c1=${transition.audioOutCurve || 'tri'}:c2=${transition.audioInCurve || 'tri'}`;

      inStream = outStream;

      if (i < clipAudio.length - 2) ret += outStream;
      return ret;
    }).join(',');

    const args = [
      ...getFfmpegCommonArgs({ enableFfmpegLog }),
      ...(flatMap(clipAudio, ({ path }) => ['-i', path])),
      '-filter_complex',
      filterGraph,
      '-c', 'flac',
      '-y',
      outPath,
    ];
    await execa(ffmpegPath, args);


    


    FFMPEG query structure :

    


    ffmpeg -i /editly-tmp-.../clip000-audio.flac -i /editly-tmp-.../clip226-audio.flac -i ... -filter_complex [0:a][1:a]acrossfade=d=1:c1=tri:c2=tri[concat0],[concat0][2:a]acrossfade=d=0.425:c1=tri:c2=tri[concat1],[concat1][3:a]acrossfade=d=0.425:c1=tri:c2=tri[concat2],... -c flac -y /editly-tmp-.../audio-concat-3.mp3


    


    My hardware :

    


    Ubuntu 24.04 LTS
AMD Ryzen™ 5 5600G
Only 8gb(the other slot is broken)
AMD Radeon™ RX 580 2048SP


    


    Sorry my poor english :P

    


    Change Codecs, FFMPEG version, node version, slice the files in chunks, change SO(worked in Windows).

    


  • Accord.Video.FFMpeg : Problem of duration difference between recording time and video time

    5 mars 2020, par ckrby

    I want to save the footage I get from the webcam as a video in webM (Vp8) format. I use the Accord library. But when recording, there is almost 2-3 times the difference between the time spent and the video time. The code I use and some debug outputs are below.

    Accord.Video.FFMpeg 3.8.2-Alpha (double pts/dts bug fixed version)
    Video Save Format : VP8 (.WebM)

    Record Start Settings :

    videoCodec = VideoCodec.Vp8;    
    bitrate : 1250000  
    framerate :10  
    height :720
    width: 1280
    videoSource.VideoResolution: 1280x720, 30 fps (30 max fps), 24 bpp  
    FileWriter.BitRate = bitRate;  
    FileWriter.FrameRate = new Accord.Math.Rational((int)framerate );  
    FileWriter.Width = width;  
    FileWriter.Height = height;
    FileWriter.VideoCodec = videoCodec;
    FileWriter.Open(FileName);  
    _recording = true;  
    StartTimeStamp = DateTime.Now;  

    newFrame Event

    private void VideoSourcePlayer1_NewFrame(object sender, ref Bitmap image)
    {
       if (_recording)
       {
           try
           {
               Bitmap CurrentBitmap = image;
               DateTime CurrentTimeStamp = DateTime.Now;
               TimeSpan CurrentTimeSpan = StartTimeStamp - CurrentTimeStamp;
               Console.WriteLine("Video Write Timespan: " + CurrentTimeSpan.ToString());
               FileWriter.WriteVideoFrame(CurrentBitmap, CurrentTimeSpan);
               // FileWriter.WriteVideoFrame(image);  
           }
           catch (Exception ex)
           {
               Console.WriteLine("VideoSourcePlayer1_NewFrame catch: " + ex.Message);
           }
       }
    }

    Note : It is the same issue with timespan or without timespan writing.

    In the 122 second (02.02 min) period, 50 seconds of video recording is created. I couldn’t solve it.

    Little Part of the debug output :

    Video Write Timespan : -00:01:55.4107365
    pts:4,730000e+004 pts_time:47,3 dts:4,730000e+004 dts_time:47,3 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:55.6136263
    pts:4,740000e+004 pts_time:47,4 dts:4,740000e+004 dts_time:47,4 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:55.8354960
    pts:4,750000e+004 pts_time:47,5 dts:4,750000e+004 dts_time:47,5 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:56.5161088
    pts:4,760000e+004 pts_time:47,6 dts:4,760000e+004 dts_time:47,6 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:56.7309841
    pts:4,770000e+004 pts_time:47,7 dts:4,770000e+004 dts_time:47,7 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:56.9758413
    pts:4,780000e+004 pts_time:47,8 dts:4,780000e+004 dts_time:47,8 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:57.1947200
    pts:4,790000e+004 pts_time:47,9 dts:4,790000e+004 dts_time:47,9 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:57.4375834
    pts:4,800000e+004 pts_time:48 dts:4,800000e+004 dts_time:48 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:01:57.5804983

    The last two outputs :

    Video Write Timespan : -00:02:02.7505463
    pts:5,000000e+004 pts_time : 50 dts:5,000000e+004 dts_time : 50 duration:1,000000e+002 duration_time:0,1
    Video Write Timespan : -00:02:02.9884038
    pts:5,010000e+004 pts_time : 50,1 dts:5,010000e+004 dts_time : 50,1 duration:1,000000e+002 duration_time:0,1

    Why is there a difference between timespan and dts/pts time ? Could the problem be due to this ?

    Note : When I set the framerate to 30 ; Another process 95 seconds (1.35 min) recording time is 16 seconds in the video.

    As the frame rate increases, the length of the video gets shorter and
    shorter than the actual value it should be.

    Output :

    Video Write Timespan : -00:01:35.1086178
    pts:1,606700e+004 pts_time : 16,067 dts:1,606700e+004 dts_time : 16,067 duration:3,300000e+001 duration_time:0,033
    Video Write Timespan : -00:01:35.2565302
    pts:1,610000e+004 pts_time : 16,1 dts:1,610000e+004 dts_time : 16,1 duration:3,300000e+001 duration_time:0,033
    Video Write Timespan : -00:01:35.3984494
    pts:1,613300e+004 pts_time : 16,133 dts:1,613300e+004 dts_time : 16,133 duration:3,300000e+001 duration_time:0,033

    So the video duration is like dts_time. Why is the video duration not
    value of timespan time, I still can’t find it ??

    Soory for my bad english & expression,

  • HLS encoded video (ffmpeg) breaks in Safari when segmented via byte-range

    15 juin 2019, par eschie

    Some of my HLS encoded videos via ffmpeg drop the audio when seeking past the buffer. The only way to sync the audio and video up again is to restart the video. What would be causing this ?

    Example Profile :

    bitrate: 4800, profile: 'high', level: '4.1', resolution: 1080, framerate: '24000/1001'
    ffmpeg
       '-y'
       '-i' input_file.mov                                                
       '-v' error
       '-map' '0:0'                                                        
       '-c:v' libx264                                                  
       '-x264opts' f'
           keyint=23:                  
           min-keyint=23:          
           no-scenecut                                                    
       '
       '-vf' f'scale=-1:1080'
       '-preset' 'slow'
       '-profile:v' 'high'
       '-level' '4.1'
       '-b:v' '4800k'
       '-maxrate' '4800k'
       '-movflags' 'faststart'
       '-bufsize' '9600k'
       '-write_tmcd', '0'
       '-r' '24000/1001'                                  
       output_dir                                                      

    Segmentation CMD :

    FFMPEG
       '-i' output_dir
       '-v' 'error'
       '-acodec' 'copy'
       '-vcodec' 'copy'
       '-hls_time' '4' #seconds
       '-hls_list_size' '0'
       '-hls_flags' 'single_file'
       os.path.join(output_dir, f'{run_id}_{bitrate}.m3u8'

    Added : apple’s mediastreamvalidator outputs a few different errors :

    Error: Playlist vs segment duration mismatch
    --> Detail:  Segment duration 98.0146, Playlist duration: 4.7968
    --> Source:  1559962503399_2200k.m3u8 - 1559962503399_2200k.ts:1746520@0
    Error: Measured peak bitrate compared to master playlist declared value exceeds error tolerance
    --> Detail:  Measured: 3182.61 kb/s, Master playlist: 2173.82 kb/s, Error: 46.41%, Combined rendition name: English
    --> Source:  ...playlist.m3u8
    --> Compare: 1559962503399_2200k.m3u8
    Error: Different target durations detected
    --> Detail:  Target duration: 5 vs Target duration: 4
    --> Source:  1559962503399_64k.m3u8
    --> Compare: 1559962503399_128k.m3u8

    UPDATE 1 :
    I modified the encoding command to utilize tee pseudo-muxer, but it seems the same issue still exists when segmenting HLS as byte-ranges rather than in separate .ts files :

    $ ffmpeg
    -hide_banner
    -report
    -benchmark
    -vstats
    -i "../Jane_shallowing_Top_v08.mp4"
    -dn
    -sn
    -filter_complex "[0:v]fps=fps=24.000,setpts=(PTS-STARTPTS),split=[vsplit1][vsplit2];[vsplit1]scale=-1:144[video_144];[vsplit2]scale=-1:1080[video_1080]"
    -map "[video_144]"
    -r:v:0 "24.000"
    -c:v:0 "libx264"
    -x264-params "keyint=144:min-keyint=144:scenecut=0:open_gop=0"
    -preset:v:0 "slow"
    -profile:v:0 "baseline"
    -refs:v:0 "2"
    -b-pyramid:v:0 "strict"
    -tune:v:0 "film"
    -b:v:0 "96000"
    -maxrate:v:0 "56000"
    -bufsize:v:0 "6*56000/8"
    -vsync:v:0 "cfr"
    -bsf:v:0 "h264_metadata=fixed_frame_rate_flag=1"
    -map "[video_1080]"
    -r:v:1 "24.000"
    -c:v:1 "libx264"
    -x264-params "keyint=144:min-keyint=144:scenecut=0:open_gop=0"
    -preset:v:1 "slow"
    -profile:v:1 "high"
    -refs:v:1 "2"
    -b-pyramid:v:1 "strict"
    -tune:v:1 "film"
    -b:v:1 "4800000"
    -maxrate:v:1 "4800000"
    -bufsize:v:1 "6*4800000/8"
    -vsync:v:1 "cfr"
    -bsf:v:1 "h264_metadata=fixed_frame_rate_flag=1"
    -map a:0 -map a:0
    -c:a "libfdk_aac"
    -ar "48000"
    -ab "128k"
    -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0"
    -f "hls"
    -var_stream_map "v:1,a:0 v:0,a:1"
    -hls_time "6.000"
    -hls_segment_type "mpegts"
    -hls_flags "discont_start+temp_file+single_file"
    -hls_list_size "0"
    -master_pl_name "playlist.m3u8"
    -hls_segment_filename "out_%v.ts" "out_%v.m3u8"
    Segment duration 98.0267, Playlist duration: 6.0000