
Recherche avancée
Autres articles (67)
-
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 (13218)
-
Creating a sequence of images from lyrics to use in ffmpeg
19 septembre 2018, par SKSI’m trying to make an MP3 + Lyric -> MP4 program in python.
I have a lyrics file like this :
[00:00.60]Revelation, chapter 4
[00:02.34]After these things I looked,
[00:04.10]and behold a door was opened in heaven,
[00:06.41]and the first voice which I heard, as it were,
[00:08.78]of a trumpet speaking with me, said:
[00:11.09]Come up hither,
[00:12.16]and I will shew thee the things which must be done hereafter.
[00:15.78]And immediately I was in the spirit:
[00:18.03]and behold there was a throne set in heaven,
[00:20.72]and upon the throne one sitting.
[00:22.85]And he that sat,
[00:23.91]was to the sight like the jasper and the sardine stone;
[00:26.97]and there was a rainbow round about the throne,
[00:29.16]in sight like unto an emerald.
[00:31.35]And round about the throne were four and twenty seats;
[00:34.85]and upon the seats, four and twenty ancients sitting,
[00:38.03]clothed in white garments, and on their heads were crowns of gold.
[00:41.97]And from the throne proceeded lightnings, and voices, and thunders;
[00:46.03]and there were seven lamps burning before the throne,
[00:48.60]which are the seven spirits of God.
[00:51.23]And in the sight of the throne was, as it were,
[00:53.79]a sea of glass like to crystal;
[00:56.16]and in the midst of the throne, and round about the throne,
[00:59.29]were four living creatures, full of eyes before and behind.
[01:03.79]And the first living creature was like a lion:I’m trying to create a sequence of images from the lyrics to use into ffmpeg.
os.system(ffmpeg_path + " -r 2 -i " + images_path + "image%1d.png -i " + audio_file + " -vcodec mpeg4 -y " + video_name)
I tried finding out the number of images to make for each line. I’ve tried subtracting the seconds of the next line from the current line. It works but produces very inconsistent results.
import os
import datetime
import time
import math
from PIL import Image, ImageDraw
ffmpeg_path = os.getcwd() + "\\ffmpeg\\bin\\ffmpeg.exe"
images_path = os.getcwd() + "\\test_output\\"
audio_file = os.getcwd() + "\\audio.mp3"
lyric_file = os.getcwd() + "\\lyric.lrc"
video_name = "movie.mp4"
def save():
lyric_to_images()
os.system(ffmpeg_path + " -r 2 -i " + images_path + "image%1d.png -i " + audio_file + " -vcodec mpeg4 -y " + video_name)
def lyric_to_images():
file = open(lyric_file, "r")
data = file.readlines()
startOfLyric = True
lstTimestamp = []
images_to_make = 0
from_second = 0.0
to_second = 0.0
for line in data:
vTime = line[1:9] # 00:00.60
temp = vTime.split(':')
minute = float(temp[0])
#a = float(temp[1].split('.'))
#second = float((minute * 60) + int(a[0]))
second = (minute * 60) + float(temp[1])
lstTimestamp.append(second)
counter = 1
for i, second in enumerate(lstTimestamp):
if startOfLyric is True:
startOfLyric = False
#first line is always 3 seconds (images to make = 3x2)
for x in range(1, 7):
writeImage(data[i][10:], 'image' + str(counter))
counter += 1
else:
from_second = lstTimestamp[i-1]
to_second = second
difference = to_second - from_second
images_to_make = int(difference * 2)
for x in range(1, int(images_to_make+1)):
writeImage(data[i-1][10:], 'image'+str(counter))
counter += 1
file.close()
def writeImage(v_text, filename):
img = Image.new('RGB', (480, 320), color = (73, 109, 137))
d = ImageDraw.Draw(img)
d.text((10,10), v_text, fill=(255,255,0))
img.save(os.getcwd() + "\\test_output\\" + filename + ".png")
save()Is there any efficient and accurate way to calculate how many images I need to create for each line ?
Note : Whatever many images I create will have to be multiplied by 2 because I’m using
-r 2
for FFmpeg (2 FPS). -
Building C library (FFmpeg) with Android NDK r17 : undefined reference to '__mulodi4'
14 mai 2018, par fpsulli3My problem happens to be with FFmpeg but I suspect that this would happen with almost any C library.
Problem Description
My app uses FFmpeg that is compiled with NDK r10e. I am trying to update everything to NDK r17, while also switching to clang, since Google prefers us to use that over gcc.
My first step is to just build FFmpeg.
To that end, I have used the
make_standalone_toolchain.py
script to create a stand-alone toolchain for the x86 architecture, like so :make_standalone_toolchain.py --arch x86 --api 21 --install-dir ~/Development/ndk-toolchains/x86
Then I configure the FFmpeg build as follows :
TOOLCHAIN_DIR=~/Development/ndk-toolchains/x86
./configure \
--prefix=$(pwd)/android/x86 \
--cross-prefix=$TOOLCHAIN_DIR/bin/i686-linux-android- \
--target-os=android \
--arch=x86 \
--enable-cross-compile \
--disable-asm \
--toolchain=clang-usan \
--disable-stripping \
--extra-cflags="-m32" \
--sysroot=$TOOLCHAIN_DIR/sysroot/And then I build it as follows :
make clean
make -j4
make installEverything seems to compile fine, but I get several linker errors that all say the same thing :
undefined reference to ’__mulodi4’
Solutions I’ve tried
1. Linking against libclang_rt.builtins*
I found a few places around the Web which suggested that this is caused by the fact that libgcc doesn’t provide
__mulodi4
. A github user named sitsofe was nice enough to post a work-around here. However, I am sure where to find thislibclang_rt.builtins-i686.a
library. Here is what I was able to find in my standalone toolchain directory :./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-x86_64.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-i386.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-mips64-android.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-x86_64-android.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-i686-android.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-arm-android.a
./lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-mips-android.aThe
libclang_rt.builtins-i686-android.a
library looks close but (I think) no cigar. When I try to link to it, I get the same error :undefined reference to ’__mulodi4’
Here is my new FFmpeg build config command :
./configure \
--prefix=$(pwd)/android/x86 \
--cross-prefix=$TOOLCHAIN_DIR/bin/i686-linux-android- \
--target-os=android \
--arch=x86 \
--enable-cross-compile \
--disable-asm \
--toolchain=clang-usan \
--disable-stripping \
--extra-cflags="-m32" \
--extra-ldflags="-L${TOOLCHAIN_DIR}/lib64/clang/6.0.2/lib/linux/libclang_rt.builtins-i686-android.a" \
--sysroot=$TOOLCHAIN_DIR/sysroot/I checked with
-v
to make sure that this line was added to the linker flags, and it was. However, I have no idea if this library should even be expected to work, let alone whether I’m adding it to the linker flags correctly. In any case, what I’m doing here doesn’t work.2. Switching to a different sanitizer
Instead of using the undefined sanitizer, I tried switching to the address sanitizer. This is (frankly) a total stab in the dark, based on a vague mention of asan being available in r17 at Google I/O this week.
In this case, FFmpeg builds just fine !
However, when I try to pull FFmpeg into my test project (a simple AAR w/ C++ support, that just has one jni method that calls
av_gettime()
, I get a ton of linker errors :Error:error : undefined reference to ’__asan_option_detect_stack_use_after_return’
Error:error : undefined reference to ’__asan_stack_malloc_0’
Error:error : undefined reference to ’__asan_report_load4’
Error:error : undefined reference to ’__asan_report_load4’
Error:error : undefined reference to ’__asan_shadow_memory_dynamic_address’
Error:error : undefined reference to ’__asan_option_detect_stack_use_after_return’
Error:error : undefined reference to ’__asan_stack_malloc_0’
Error:error : undefined reference to ’__asan_report_load4’
Error:error : undefined reference to ’__asan_report_load4’
Error:error : undefined reference to ’__asan_shadow_memory_dynamic_address’
Error:error : undefined reference to ’__asan_option_detect_stack_use_after_return’
Error:error : undefined reference to ’__asan_stack_malloc_0’
Error:error : undefined reference to ’__asan_report_store4’
Error:error : undefined reference to ’__asan_report_store4’
Error:error : undefined reference to ’__asan_init’
Error:error : undefined reference to ’__asan_version_mismatch_check_v9’So it seems to find the FFmpeg library just fine, indicating that that part of my CMake file is correct, but it can’t locate any of these asan references.
This seems to be a common problem that people are running into, but I can’t see to find a work-around that actually works for me.
-
Burning subtitles different resolutions
3 mai 2018, par FacundoI’m trying to create a live stream with three quality profiles with different resolutions (SD, HD and FullHD). The live stream has subtitles, and I have to burn them for compatibility reasons.
I know how to do it with one profile, but with many no idea.
ffmpeg -nostdin -loglevel error -hwaccel cuvid -deint 2 -drop_second_field 1 -surfaces 15 -c:v h264_cuvid -resize 1280x720 -y -i udp://xxx.xxx.xxx.xxx:xxxxx?pkt_size=1316\&buffer_size=409600\&fifo_size=1000000\&overrun_nonfatal=1 -filter_complex [i:0x2c6]hwdownload,format=nv12[base];[i:0x993]setpts=(2.5)/TB+PTS[subs];[subs]scale=1280:720[subtitle];[base][subtitle]overlay[v];[v]hwupload_cuda[v] -map [v] -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 23 -qp 23 -tier high -profile:v main10 -level 4.0 -b:v 2000k -maxrate 2400k -bufsize 1000k -map i:0x2bd -c:a libfdk_aac -ac 2 -b:a 64k -map i:0x2be -c:a libfdk_aac -ac 2 -b:a 64k -metadata:s:a:0 language=eng -metadata:s:a:1 language=spa -f mpegts -mpegts_flags resend_headers+pat_pmt_at_frames -mpegts_copyts 1 -pcr_period 40 udp://yyy.yyy.yyy.yyy:yyyy?ttl=31\?pkt_size=1316\&buffer_size=409600\&fifo_size=1000000\&overrun_nonfatal=1
Apparenlty, Iffmpeg doen’t allow to use -vf filter with filter_complex.
I’m using ffmpeg 3.4, cuda 8.