
Recherche avancée
Autres articles (38)
-
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 ;
-
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (5335)
-
errors of 'vaGetDisplay' and `vaGetDisplayDRM' [duplicate]
29 novembre 2018, par KindermannThis question already has an answer here :
After updating my ubuntu OS from 14.04 to 16.04, I installed the ffmpeg library using the following configurations :
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-nonfree
PATH="$HOME/bin:$PATH" make
make installIt seemed to me the installation process was ok. After that, I tried to compile my own C source code with the following Makefile :
EDITTED(adding -lva-drm -lva-x11 at line 10)
FFMPEG_LIBS= libavdevice \
libavformat \
libavfilter \
libavcodec \
libswresample \
libswscale \
libavutil \
TARGET = video_analysis
LIBS = -lva -lX11 -lvdpau -lm -lva-drm -lva-x11
CC = gcc
CFLAGS += -O2 -g -O0
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
.PHONY: default all clean
default: $(TARGET)
all: default
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
.PRECIOUS: $(TARGET) $(OBJECTS)
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) $(LDLIBS) $(LIBS) -o $@
clean:
-rm -f *.o
-rm -f $(TARGET)However, my compiler complained the following errors :
/root/ffmpeg_build/lib/libavutil.a(hwcontext_vaapi.o): In function `vaapi_device_create':
/home/widerstand/ffmpeg_sources/ffmpeg/libavutil/hwcontext_vaapi.c:896: undefined reference to `vaGetDisplay'
/home/widerstand/ffmpeg_sources/ffmpeg/libavutil/hwcontext_vaapi.c:917: undefined reference to `vaGetDisplayDRM'
collect2: error: ld returned 1 exit status
Makefile:30: recipe for target 'video_analysis' failed
make: *** [video_analysis] Error 1My question is : in which library do ’vaGetDisplay’ and `vaGetDisplayDRM’ exist ? It’s for sure that libva functions properly. I have no clue how to fix the bugs...Thank you in advance !
-
Pydub installation and ffmpeg
6 août 2021, par Lone LunaticI was trying to get raw sound data out of a
.mp3
file. Therefor I used the pydub module as stated here. I created avenv
for this project and installed all necessary modules. But for some reason, pydub decided to give me anFileNotFoundError
:


(venv) Python-IT:LightsDev pythonit$ which python
/Users/pythonit/Documents/Programmieren/Python/LightsDev/venv/bin/python
(venv) Python-IT:LightsDev pythonit$ which pip3
/Users/pythonit/Documents/Programmieren/Python/LightsDev/venv/bin/pip3
(venv) Python-IT:LightsDev pythonit$ pip3 list 
------------- -------
ffmpeg 1.4
pip 18.1
pydub 0.23.0
pyee 5.0.0
python-ffmpeg 1.0.5
setuptools 39.0.1




My exact code looks like that :



from pydub import AudioSegment
sound = AudioSegment.from_mp3('test.mp3')
raw_data = sound._data
print(raw_data)




and I get this error :



FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'




alongside this runtime warning :



RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)




I don't know if it is me, but some similar questions stating I should install ffmpeg or python-ffmpeg won't work. I can even import the ffmpeg module but nothing happens. I can work with ffmpeg and load files but using it with pydub won't work.



EDIT : Today I changed to my windows machine and looked at the error in-depth. However I didn't manage to get it working, even with the solution provided in the comments (thank you though). I installed the ffmpeg binary as stated and i was able to get
ffmpeg
running in the shell, however not withpydub
... I have no clue what is going on. I guess my mistake is very obvious and I am just not able to get it. Even not subprocess was able to solve this problem despite the fact, that I am able to use ffmpeg in shell. I even was able to convert the file using ffmpeg in shell...


ffmpeg -i test.mp3 test.wav 
 > Output #0, wav, to 'test.wav':




I think I am close to solve the problem myself anyways, but thank you anyways.


-
RTMP live stream directly from NVENC encoder
16 novembre 2018, par rndI am trying to create a live RTMP stream containing the animation generated with NVIDIA OptiX. The stream is to be received by nginx + rtmp module and broadcasted in MPEG-DASH format. Full chain up to dash.js player is working if the video is first saved to .flv file and then I send it with ffmpeg without any reformatting using command :



ffmpeg -re -i my_video.flv -c:v copy -f flv rtmp://x.x.x.x:1935/dash/test




But I want to stream directly from the code. And with this I am failng... Nginx logs an error "dash : invalid avcc received (2 : No such file or directory)". Then it seems to receive the stream correctly (segments are rolling, dash manifest is there), however the stream is not possible to play in the browser.



I can see only one difference in the manifest between direct stream and stream from file. Codecs attribute of the representation in the direct stream is missed : codecs="avcc1.000000" instead of "avc1.640028" which I get when streaming from file.



My code opens the stream :



av_register_all();
AVOutputFormat* fmt = av_guess_format("flv",
file_name, nullptr);
fmt->video_codec = AV_CODEC_ID_H264;

AVFormatContext* _oc;
avformat_alloc_output_context2(&_oc, fmt, nullptr, "rtmp://x.x.x.x:1935/dash/test");

AVStream* _vs = avformat_new_stream(_oc, nullptr);
_vs->id = 0;
_vs->time_base = AVRational { 1, 25 };
_vs->avg_frame_rate = AVRational{ 25, 1 };

AVCodecParameters *vpar = _vs->codecpar;
vpar->codec_id = fmt->video_codec;
vpar->codec_type = AVMEDIA_TYPE_VIDEO;
vpar->format = AV_PIX_FMT_YUV420P;
vpar->profile = FF_PROFILE_H264_HIGH;
vpar->level = _level;
vpar->width = _width;
vpar->height = _height;
vpar->bit_rate = _avg_bitrate;

avio_open(&_oc->pb, _oc->filename, AVIO_FLAG_WRITE);
avformat_write_header(_oc, nullptr);




Width, height, bitrate, level and profile I get from NVENC encoder settings. I also do the error checking, ommited here. Then I have a loop writing each encoded packets, with IDR frames etc all prepared on the fly with NVENC. The loop body is :



auto & pkt_data = _packets[i];
AVPacket pkt = { 0 };
av_init_packet(&pkt);
pkt.pts = av_rescale_q(_n_frames++, AVRational{ 1, 25 }, _vs->time_base);
pkt.duration = av_rescale_q(1, AVRational{ 1, 25 }, _vs->time_base);
pkt.dts = pkt.pts;
pkt.stream_index = _vs->index;
pkt.data = pkt_data.data();
pkt.size = (int)pkt_data.size();

if (!memcmp(pkt_data.data(), "\x00\x00\x00\x01\x67", 5))
{
 pkt.flags |= AV_PKT_FLAG_KEY;
}

av_write_frame(_oc, &pkt);




Obviously ffmpeg is writing avcc code somewhere... I have no clue where to add this code so the RTMP server can recognize it. Or I am missing something else ?



Any hint greatly appreciated, folks !