
Recherche avancée
Autres articles (51)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (9790)
-
HLS encoded video (ffmpeg) breaks in Safari when segmented via byte-range
15 juin 2019, par eschieSome 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_dirSegmentation 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@0Error: 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.m3u8Error: Different target durations detected
--> Detail: Target duration: 5 vs Target duration: 4
--> Source: 1559962503399_64k.m3u8
--> Compare: 1559962503399_128k.m3u8UPDATE 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
-
How to detect added scenes in Director's Cut Edition of movie ?
17 juillet 2019, par B LoloI’ve got huge collection of .mkv files. In every movie folder there are two files : one original movie and one extended edition of that movie.
Two files can be different for example one is 480p and the second 1080p.
One can be 1 hour long, second one 40 minutes.
In those extended edition files scenes are added randomly, so it could be 2 minutes in beginning, 5 minutes after first 10 minutes of the film and so on.
Is there a way to use Python and ffmpeg to detect scenes from extended edition files that are absent in original movie file ?
I can also work with only audio if that is easier to do.
For now I got idea to use ffmpeg and scene detection, I can manually search for differences between files, but I would like some hints where to look changes.
This is python code with ffmpy library :
from ffmpy import FFmpeg
plik = "C:/special.mkv"
png = re.sub("\.mkv","_changes.png",plik)
ff = FFmpeg(executable='C:/ffmpeg.exe', global_options ='-v error', inputs={plik : ''}, outputs={png : "-vf select='gt(scene\,0.4)',scale=320:-1,tile=10x80 -frames:v 1 -y"})
result = ff.run(stdout=PIPE, stderr=PIPE) -
Python : How to convert a mp3 chunk from webstream to .wav samples ?
13 novembre 2019, par BendzkoI’m trying to catch chunks of an mp3 webstream and coverting them into wav samples for signal processing. I tried to catch the audio via requests and io.BytesIO to save the data as .wav file.
But I think, that I have to convert the mp3 data to wav data, but I don’t know how. (My goal is not to record a .wav file, i am just doing this to test the algorithm.)I found the pymedia lib, but it is very old (last commit in 2006), using python 2.7 and for me not installable.
Maybe it is possible with ffmpeg-python, but I have just seen examples using files as input and output.
Here’s my code :
import requests
import io
import soundfile as sf
import struct
import wave
import numpy as np
def main():
stream_url = r'http://dg-wdr-http-dus-dtag-cdn.cast.addradio.de/wdr/1live/diggi/mp3/128/stream.mp3'
r = requests.get(stream_url, stream=True)
sample_array = []
try:
for block in r.iter_content(1024):
data, samplerate = sf.read(io.BytesIO(block), format="RAW", channels=2, samplerate=44100, subtype='FLOAT',
dtype='float32')
sample_array = np.append(sample_array, data)
except KeyboardInterrupt:
print("...saving")
obj = wave.open('sounds/stream1.wav', 'w')
obj.setnchannels(1) # mono
obj.setsampwidth(2) # bytes
obj.setframerate(44100)
data_max = np.nanmax(abs(sample_array))
# fill WAV with samples from sample_array
for sample in sample_array:
if (np.isnan(sample) or np.isnan(32760 * sample / data_max)) is True:
continue
try:
value = int(32760 * sample / data_max) # normalization INT16
except ValueError:
value = 1
finally:
data = struct.pack('code>Do you have an idea how to handle this problem ?