Recherche avancée

Médias (1)

Mot : - Tags -/biographie

Autres articles (72)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (7740)

  • Resuming ffmpeg hls trancoding from an existing segment

    2 juillet 2024, par Fdebijl

    I'm setting up a service to transcode input videos, generally MP4, for HLS with MPEG-TS as the container format. This currently works fine when starting from scratch, but I would like the transcode to be resumable in case the service crashes while working on a longer video.

    


    I'm running into two issues with resuming the transcoding process :

    


      

    • ffmpeg generates too many segments : if the processing is halted at, say, 10 segments for a video that should be 20 segments long and processing is resumed later, the manifest contains 10 + 20 segments, where the final 10 segments don't actually play back properly
    • 


    • Adjacent to this, running the command again when the video is fully transcoded results in the playlist being appended with the entire video once more, with the numbers above that would result in 20 additional segments being added to the playlist every time the conversion is ran. In other words, ffmpeg doesn't realize the transcoding is already complete
    • 


    


    The desired result here is that running the ffmpeg command again simply continues the transcode after the last completed segment and appends these segments to the m3u8 playlist. If all the segments are already present ffmpeg should not output or modify anything. I've tried to coax ffmpeg into this behaviour, but no combination of -start_number, -ss and append_list gets me there.

    


    Here's my current command that is executed when a transcode should be resumed (I've ommited some filters for brevity) :

    


    ffmpeg -i input -map 0:v -map 0:a -map 0:v -map 0:a -map 0:v -map 0:a \
-c:v libx264 -preset veryfast -c:a libfdk_aac \
-maxrate:v:0 1500K -b:a:0 128k \
-maxrate:v:1 3000K -b:a:1 192k \ 
-maxrate:v:2 6000K -b:a:2 256k \
-flags +cgop -g 60 -hls_time 5 -hls_list_size 0 \
-hls_flags independent_segments+temp_file+append_list \
-var_stream_map "v:0,a:0,name:480p v:1,a:1,name:720p v:2,a:2,name:1080p" \
-y -f hls -master_pl_name master.m3u8 ./%v.m3u8


    


    Here is the folder structure that ffmpeg would work in for a resumed transcode, assuming the service crashed after the first two chunks :

    


    .
├── 1080p.m3u8   
├── 1080p0.ts    
├── 1080p1.ts   
├── 480p.m3u8    
├── 480p0.ts     
├── 480p1.ts     
├── 720p.m3u8    
├── 720p0.ts     
├── 720p1.ts     
├── input        
└── master.m3u8  


    


    Here is the contents of 480p.m3u8 :

    


    #EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXT-X-ENDLIST


    


    However, as explained in the prelude, running the command against this folder results in too many chunks being appended to the playlist.

    


    This is the expected 480p playlist :

    


    #EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXTINF:5.000000,
480p2.ts
#EXTINF:5.000000,
480p3.ts
#EXTINF:5.000000,
480p4.ts
#EXTINF:5.733333,
480p5.ts
#EXTINF:5.000000,
480p6.ts
#EXTINF:5.000000,
480p7.ts
#EXTINF:5.000000,
480p8.ts
#EXTINF:5.000000,
480p9.ts
#EXTINF:5.000000,
480p10.ts
#EXTINF:5.000000,
480p11.ts
#EXTINF:5.000000,
480p12.ts
#EXTINF:3.950000,
480p13.ts
#EXT-X-ENDLIST


    


    And this is the actual playlist :

    


    #EXT-X-VERSION:6
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-INDEPENDENT-SEGMENTS
#EXTINF:5.000000,
480p0.ts
#EXTINF:5.000000,
480p1.ts
#EXT-X-DISCONTINUITY
#EXTINF:5.000000,
480p2.ts
#EXTINF:5.000000,
480p3.ts
#EXTINF:5.000000,
480p4.ts
#EXTINF:5.000000,
480p5.ts
#EXTINF:5.000000,
480p6.ts
#EXTINF:5.733333,
480p7.ts
#EXTINF:5.000000,
480p8.ts
#EXTINF:5.000000,
480p9.ts
#EXTINF:5.000000,
480p10.ts
#EXTINF:5.000000,
480p11.ts
#EXTINF:5.000000,
480p12.ts
#EXTINF:5.000000,
480p13.ts
#EXTINF:5.000000,
480p14.ts
#EXTINF:3.950000,
480p15.ts
#EXT-X-ENDLIST


    


    I've already surmised the #EXT-X-DISCONTINUITY tag can't be disabled, which is fine, as I can remove that with post-processing steps. The two extra segments are problematic however, as they break the video at the end of its actual runtime.

    


    To bring this to a point : is there a way to get ffmpeg to resume transcoding from the last segment, such that it does not append the entire video to the last transcoding attempt ?

    


  • my ffmpeg livestream keeps crashing : How do I troubleshoot ?

    12 février 2024, par n79qk272x57w46w9

    I can't find the reason on why it is crashing, all I have is a list of mp3 files which are encoded to AAC on the fly.

    


    stream.sh

    


    #!/bin/bash

ffmpeg \
-stream_loop -1 -re \
-i video.mp4 \
-safe 0 \
-f concat \
-i playlist.txt \
-c:v libx264 -preset slower -b:v 3500k -maxrate 3500k -bufsize 7000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 320k -ac 2 -ar 44100 -f flv \
rtmps://---------------/s/----key----:----key----


    


    This is what journalctl collected :

    


    Feb 12 18:07:57 main bash[3236855]: [47.9K blob data]
Feb 12 18:11:38 main bash[3236855]: [48.0K blob data]
Feb 12 18:15:19 main bash[3236855]: [48.0K blob data]
Feb 12 18:18:59 main bash[3236855]: [48.0K blob data]
Feb 12 18:22:41 main bash[3236855]: [48.0K blob data]
Feb 12 18:26:21 main bash[3236855]: [48.0K blob data]
Feb 12 18:30:02 main bash[3236855]: [48.0K blob data]
Feb 12 18:33:42 main bash[3236855]: [48.0K blob data]
Feb 12 18:37:23 main bash[3236855]: [48.0K blob data]
Feb 12 18:41:03 main bash[3236855]: [48.0K blob data]
Feb 12 18:44:44 main bash[3236855]: [48.0K blob data]
Feb 12 18:48:25 main bash[3236855]: [48.0K blob data]
Feb 12 18:50:07 main bash[3236855]: [22.3K blob data]
Feb 12 18:50:07 main bash[3236855]: av_interleaved_write_frame(): Input/output error
Feb 12 18:50:09 main bash[3236855]:     Last message repeated 1 times
Feb 12 18:50:09 main bash[3236855]: [flv @ 0x5642d6c08c00] Failed to update header with correct duration.
Feb 12 18:50:09 main bash[3236855]: [flv @ 0x5642d6c08c00] Failed to update header with correct filesize.
Feb 12 18:50:09 main bash[3236855]: Error writing trailer of rtmps://------------/s/key:key: Input/output error
Feb 12 18:50:09 main bash[3236855]: frame=1215777 fps= 30 q=14.0 Lsize=18376958kB time=11:16:04.14 bitrate=3711.3kbits/s dup=0 drop=1 speed=   1x
Feb 12 18:50:09 main bash[3236855]: video:16828839kB audio:1495386kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.287779%
Feb 12 18:50:09 main bash[3236855]: [tls @ 0x5642d6bbcf40] The specified session has been invalidated for some reason.
Feb 12 18:50:09 main bash[3236855]:     Last message repeated 1 times
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] frame I:24338 Avg QP: 3.06  size: 52975
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] frame P:393923 Avg QP: 6.45  size: 24751
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] frame B:797516 Avg QP: 9.68  size:  7767
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] consecutive B-frames:  6.8% 12.2% 15.4% 65.7%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] mb I  I16..4: 47.0%  5.2% 47.9%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] mb P  I16..4:  0.8%  0.5%  4.3%  P16..4: 18.2% 13.6% 11.8%  4.1%  2.3%    skip:44.2%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] mb B  I16..4:  0.2%  0.1%  0.7%  B16..8: 21.7% 14.2%  6.4%  direct: 7.9%  skip:48.8%  L0:35.3% L1:35.8% BI:28.9%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] 8x8 transform intra:6.6% inter:16.5%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] direct mvs  spatial:99.7% temporal:0.3%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] coded y,uvDC,uvAC intra: 68.9% 62.6% 52.6% inter: 36.3% 21.5% 11.4%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] i16 v,h,dc,p: 70% 14% 13%  3%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 21% 19%  5%  5%  5%  6%  8% 10%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 23% 18%  5%  6%  6%  6%  6%  8%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] i8c dc,h,v,p: 59% 24% 12%  5%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] Weighted P-Frames: Y:2.0% UV:0.5%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] ref P L0: 69.7% 13.7%  6.8%  3.4%  2.0%  1.8%  1.3%  1.2%  0.2%  0.0%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] ref B L0: 88.7%  7.1%  2.0%  0.9%  0.7%  0.4%  0.3%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] ref B L1: 97.2%  2.8%
Feb 12 18:50:09 main bash[3236855]: [libx264 @ 0x5642d6be6300] kb/s:3398.63
Feb 12 18:50:09 main bash[3236855]: [aac @ 0x5642d6bbdd40] Qavg: 14231.606
Feb 12 18:50:09 main bash[3236855]: Conversion failed!
Feb 12 18:50:09 main systemd[1]: stream.service: Main process exited, code=exited, status=1/FAILURE
Feb 12 18:50:09 main systemd[1]: stream.service: Failed with result 'exit-code'.


    


    From this log it is hard to tell at which point and which file it started to have problems converting.

    


  • PHP large video upload converting to mp3 by ffmpeg

    27 mai 2017, par SuperBerry

    I am working on a project on Linux VPS (Apache + PHP5, 4G RAM / 2 CPU Cores) which allows users to upload videos (200M max) and convert to MP3 audio files by FFMPEG. I have few questions about the concurrency and the processing because I am a newbie on PHP :

    1. If there are 10 visitors uploading (1 visitor uploads one 200M MP4 file), will it cost 2,000M memory of the server ? Will the chunk upload method could solve this memeory issue while more visitors uploading videos at the same time ?

    2. I am going to use Redis to manage the ffmpeg processing queue, and set the crontab. Should I use the shell_exec() to call the ffmpeg to process the conversion at background, then convert the uploaded videos one by one ?

    The uploading and conversion is the most cost for the server I think... Maybe my idea is extremely crazy...I am new to this type of service.. I didn’t make online projects before, just desktop apps...

    Thanks a lot for your help..