
Recherche avancée
Autres articles (3)
-
Encodage et transformation en formats lisibles sur Internet
10 avril 2011MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...) -
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (3589)
-
ffmpeg : md5 of m3u8 playlists generated from same input video with different segment durations (after applying video filter) don't match
15 juillet 2020, par Saurabh P BhandariHere are a few commands I am using to convert and transize a video in mp4 format to a m3u8 playlist.


For a given input video (mp4 format), generate multiple video only segments with segment duration 30s


ffmpeg -loglevel error -i input.mp4 -dn -sn -an -c:v copy -bsf:v h264_mp4toannexb -copyts -start_at_zero -f segment -segment_time 30 30%03d.mp4 -dn -sn -vn -c:a copy audio.aac



Apply video filter (in this case scaling) on each segment and convert it to a m3u8 format


ls 30*.mp4 | parallel 'ffmpeg -loglevel error -i {} -vf scale=-2:144 -hls_list_size 0 {}.m3u8'



Store the list of m3u8 files generated in
list.txt
in this formatfile 'segment-name.m3u8'


for f in 30*.m3u8; do echo "file '$f'" >> list.txt; done



Using concat demuxer, combine all segment files (which are in m3u8 format) and the audio to get one final m3u8 playlist pointing to segments with duration of 10s.


ffmpeg -loglevel error -f concat -i list.txt -i audio.aac -c copy -hls_list_size 0 -hls_time 10 output_30.m3u8




I can change the segment duration in the first step from 30s to 60s, and compare the md5 of the final m3u8 playlist generated in both the cases using this command


ffmpeg -loglevel error -i <input m3u8="m3u8" playlist="playlist" /> -f md5 - 



The md5 of the output files differ i.e video streams of
output_30.m3u8
andoutput_60.m3u8
are not the same.

Can anyone elaborate on this ?


(I expected the md5 to be the same)


-
subprocess called from multiprocess not finishing
24 juin 2020, par Pavel KomarovI've got a set of videos from which I'm trying to pull random frames. There are a lot of videos, so I want to work in parallel, and
ffmpeg
can splice out the frames for me, so here's the important part of the code :

import os
from tqdm import tqdm
from joblib import Parallel, delayed
from multiprocessing import current_process
from subprocess import Popen

vids_dir = 'just a string'
out_dir = 'another string'

def process_each(f):
 temp = 'temp' + str(current_process()._identity[0])
 os.mkdir(temp)

 proc = Popen(['ffmpeg -i ' + vids_dir + '/' + f + ' ' + temp + '/' + f[:-4] + '_%03d.jpg &> /dev/null'], shell=True) # convert to frames
 proc.wait()

 # do stuff

 os.system('rm -rf ' + temp) # clean up


Parallel(n_jobs=10)(delayed(process_each)(f) for f in tqdm(os.listdir(vids_dir)))



I can print out the command being passed to
Popen
and execute it in a shell, and it works. I can open apython3
session and call the command fromPopen
orsubprocess.call
or evenos.system
, and it works. I can even setn_jobs=1
in myParallel
, and it works.

But the moment I actually parallelize this, I find
ffmpeg
doesn't flush its full results to the temporary folders ; it only gets the first one or few frames.

What on earth could be going on ?
subprocess
andmultiprocessing
should be able to mix this way.

-
Transcode HLS segments individually with FFMPEG
9 juillet 2020, par Mathix420I'm trying to transcode a video in HLS, by first splitting the video in segments without encoding changes and then transcode all segments individually. I'm trying to achieve this so I can transcode a video in multiple EC2 instances in parallel to be more time efficient.


I am using this scipt right now


# Split input file in multiple segments

ffmpeg -hide_banner -y -i $input -c copy -map 0 -an -segment_time 4 -reset_timestamps 1 -f segment output%03d.webm

# Transcode each segments in multiple resolutions

find . -name 'output*.webm' -exec ffmpeg -hide_banner -y -i {} \
 -vf "scale=-2:360" -c:v libx264 -profile:v main -crf 20 -sc_threshold 0 -b:v 800k -maxrate 856k -bufsize 1200k {}.360p.ts \
 -vf "scale=-2:480" -c:v libx264 -profile:v main -crf 20 -sc_threshold 0 -b:v 1400k -maxrate 1498k -bufsize 2100k {}.480p.ts \
 -vf "scale=-2:720" -c:v libx264 -profile:v main -crf 20 -sc_threshold 0 -b:v 2800k -maxrate 2996k -bufsize 4200k {}.720p.ts \
 -vf "scale=-2:1080" -c:v libx264 -profile:v main -crf 20 -sc_threshold 0 -b:v 5000k -maxrate 5350k -bufsize 7500k {}.1080p.ts \;



But then when I tried to get all segments durations to make an m3u8 playlist (with the command below)


# List segments duration

find . -name 'output*.webm.360p.ts' \
 -exec echo -n {} \; \
 -exec ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 {} \;



I got this result


output000.webm.360p.ts 5.120000
output001.webm.360p.ts 5.120000
output002.webm.360p.ts 4.400000
output003.webm.360p.ts 5.480000
output004.webm.360p.ts 0.360000
output005.webm.360p.ts 5.120000
output006.webm.360p.ts 4.960000
output007.webm.360p.ts 0.001000



I can't figure out why my
output004
is only0.360000
seconds long.

When I tried to play it with VLC it just shows one or two frames then
main decoder error: buffer deadlock prevented
.

Thanks for trying to help me !