
Recherche avancée
Autres articles (53)
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (8141)
-
Best intra-frame codec for editing ? Having color issues with DNxHR and serious sync issues with Prores
23 janvier 2020, par Raulo1985I have a couple of questions regarding intra-frame codecs for editing purposes (in Premiere Pro).
A LITTLE CONTEXT :
I ripped a HDR movie to a MP4 container some months ago, using H.264 as codec (high 10, level 5, UHD, YUV, subsampling 4:2:0). The video looks great, as it should. Now I want to edit a trailer for that movie (I edit in Adobe Premiere Pro, current version), and for fast playback I need to work with proxies or transcode the source file to an intra-frame non long GOP file and use it as the source file (hopefully as lossless as that transcoding step can be). I tried for several days to transcode the source file to DNxHR 444 10 bits (using FFmpeg and then Adobe Media Encoder), but the result was always a video with the colors messed up (sometimes very washed out, sometimes over saturated).
FFprobe of the resulting DNxHR file said that the color space was BT709 (source file is obviously BT2020), and I don’t know why. The transcoding involved upsampling since the source file is 4:2:0 and DNxHR doesn’t support it, but I tried upsampling to 4:4:4 and also to 4:2:2, and both of those files looked exactly the same to me, and very different from the original footage (so, I don’t think upsampling is the cause of the color issue, but maybe the apparent color space change or something wrong with the metadata). The results were the same when transcoding with Adobe Media Encoder. Anyway, I seem to have given up transcoding to DNxHR and use it as the source file, unless someone has an idea of what’s causing this problem. I could have worked with the source file for exporting and DNxHR LB for proxies, but there were sync issues (between source file and proxy) that defeated all purposes while editing. Prores is out of the picture, sync issues were worse (several seconds of delay).
For the record, the command used that didn’t work as expected (color wise) is :
ffmpeg -channel_layout 63 -i input.mkv -map 0:0 -c:v dnxhd -vf "scale=in_range=limited:out_range=full" -color_range 2 -profile:v dnxhr_444 -pix_fmt yuv444p10le -acodec pcm_s24le -ar 48000 -ac 6 -channel_layout 63 -map 0:2 -hide_banner output.mxf
I also tried without the commands "scale=in_range=limited:out_range=full" and "-color_range 2", with same results. Always used FFmpeg latest version, and I’m working in Windows 10 Pro, latest drivers and latest Klite codec pack. Video files were compared with Mediainfo, FFprobe, and visually with VLC.
Well, like I said, I’m giving up using DNxHR as the source file for my project (it would have been ideal since it doesn’t have sync issues with the DNxHR proxies, and file size is not a problem for me). A user here at the forums suggested transcoding and use H.264 intra-frame as source file, which I didn’t know was an option (I didn’t know H.264 was capable of intra-frame, my bad). I’m aware that one should avoid unnecesary transcoding steps, but I can’t work with a H.264 UHD HDR source file (ultra slow playback), and the sync issues with proxies, no matter the codec, make it impossible to make accurate cuts.
So, bottom line, I need to find a way to fix the color issue when transcoding to DNxHR, or try with an inter-frame codec that’s not DNxHR and that’s capable of preserving all the HDR info (and then see if it doesn’t have sync issues. I’m assuming that those may dissapear when using intra-frame for both source file and proxies).NOTE : When importing the DNxHR 444 file to Premiere Pro and looking at the Lumetri scopes tab, you can tell that the colors are clipped at 100 nits, like a regular SDR video. So apparently the color space was really reduced to BT709, and I don’t know why. The H.264 source file behaves as expected, with colors going past 100 nits.
MY QUESTIONS :
1) Is H.264 intra-frame a good format for editing with a good playback performance ?
2) If H.264 intra-frame is a good option, what would be the advantages of the DNxHR codec (or Prores) over it for editing purposes ? Everybody suggests DNxHD/DNxHR or Prores as intermediate codecs, but if intra-frame H.264 has the same advantages for editing and supports HDR, what would be the reason to choose another codec like DNxHR ?
3) Any ideas on what could be the cause of the colors not transcoding correctly from the H.264 source file to the DNxHR 444 10 bits one ? The command looks ok to me, but FFprobe output says the DNxHR video is BT709, while with the source file it says BT2020. Like I said, apparently there’s something wrong with the transcoding process regarding metadata or color space.
4) I haven’t tried to transcode the source file to a DNxHR 444 10 bits video file, but in a MOV container. I don’t know how this works internally, but maybe the color issue has something to do with the container metadata or something. I may try this if there’s not another suggestion (transcoding this kind of files, as you know, takes time, so I’ll wait for some ideas first).
NOTE : I tried to transcode the source file in the same way (DNxHR 444, 10 bits, etc) with Adobe Media Encoder 2020 and the result was the same, with colors messed up and FFprobe saying the video is BT709. Also tried transcoding to DNxHR HQX profile (10 bits), same result.
Any help would be greatly appreciated.
Thanks in advance.
-
youtube-dl doesn't see ffmpeg in the executable
30 novembre 2019, par Михаил МуратовI am writing a program to download music and videos via youtube-dl in python. Next, I pack the script into an executable file via pyinstaller.
The problem is that youtube-dl (in the executable) doesn’t see ffmpeg and ffprobe, even though I add them to the spec file.
As far as I know youtube-dl has the
ffmpeg_location
parameter, but that’s only in the console version. Maybe it is also for python ? But I didn’t find any information about it.How do I solve the problem ?
command to create executable :
pyinstaller --upx-dir=c:\users\exe-builder c:\users\exe-builder\youtubedownloader\main.spec
.spec file :
# -*- mode: python -*
block_cipher = None
a = Analysis(['C:\\Users\\Exe-Builder\\YoutubeDownloader\\main.py'],
pathex=['C:\\Users\\Exe-Builder\\YoutubeDownloader'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
a.binaries += [('ffmpeg.exe','C:\\Users\\Exe-Builder\\YoutubeDownloader\\ffmpeg.exe', "Binary"),
('ffprobe.exe','C:\\Users\\Exe-Builder\\YoutubeDownloader\\ffprobe.exe', "Binary")]
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='MediaDownloader',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=['vcruntime140.dll'],
runtime_tmpdir=None,
console=True)very small example :
import youtube_dl
url = 'https://www.youtube.com/watch?v=MIk55C1s0ns'
outtmpl = '\\%(title)s.%(ext)s'
ydl_opts = {'format': 'bestaudio/best',
'outtmpl': outtmpl,
'postprocessors': [{'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '128'}]}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
info_dict = ydl.extract_info(url, download=True)error message :
youtube_dl.utils.DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.
-
Python : How to decode a mp3 chunk into PCM samples ?
30 mars 2021, par BendzkoI'm trying to catch chunks of an mp3 webstream and decoding them into PCM samples for signal processing. I tried to catch the audio via requests and io.BytesIO to save the data as .wav file.



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 ?