
Recherche avancée
Médias (91)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (11)
-
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 (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)
Sur d’autres sites (3926)
-
nginx rtmp-module can't execute ffmpeg
6 juin 2023, par NasirI am having an issue with nginx-rtmp-module exec ffmpeg command. i have followed the example on 
www.github.com/arut/nginx-rtmp-module



/home/junaid/bin/ffmpeg -f video4linux2 -i /dev/video1 -c:v libx264 -an -f flv rtmp://127.0.0.1:1935/myapp/mystream




the command is working fine in terminal



Config file :



rtmp {
server {
 listen 1935;
 ping 30s;
 notify_method get;

 application myapp {
 live on;
 allow play all;
 exec_static /home/junaid/bin/ffmpeg -f video4linux2 -i /dev/video1 -c:v libx264 -an -f flv rtmp://127.0.0.1:1935/myapp/mystream; 
 }
}




Error log :
http://www.codepad.org/enD4wlZ9



I have tried :



- 

- nginx running as root (have permission to execute ffmpeg)
- using ip instead of localhost
- using complete path to ffmpeg
- executing bash file (having ffmpeg and echo commands : echo commands execute just fine) from nginx











please help me resolve this issue


-
No module named 'skvideo.io.ffmpeg' in the project
12 juillet 2024, par kyoboEven though I have installed the scikit-video and installed ffmpeg, I still meet this problem :

No module named 'skvideo.io.ffmpeg


Output :


(sd) huishi@huishi:~/workspace/projectsideo_python$ **pip install scikit-video**
Requirement already satisfied: scikit-video in /home/huishi/anaconda3/envs/sdb/python3.8/site-packages (1.1.11)
Requirement already satisfied: scipy in /home/huishi/anaconda3/envs/sdb/python3.8/site-packages (from scikit-video) (1.8.1)
Requirement already satisfied: pillow in /home/huishi/anaconda3/envs/sdb/python3.8/site-packages (from scikit-video) (9.2.0)
Requirement already satisfied: numpy in /home/huishi/anaconda3/envs/sdb/python3.8/site-packages (from scikit-video) (1.23.0)
(sd) huishi@huishi:~/workspace/projectsideo_python$ **sudo apt-get install ffmpeg**
正在读取软件包列表... 完成
正在分析软件包的依赖关系树 
正在读取状态信息... 完成 
ffmpeg 已经是最新版 (7:3.4.11-0ubuntu0.1)。
下列软件包是自动安装的并且现在不需要了:
 docker-scan-plugin gir1.2-goa-1.0 gir1.2-snapd-1
使用'sudo apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 20 个软件包未被升级。
(sd) huishi@huishi:~/workspace/projectsideo_python$ python RabbitMqUtils.py 
The license has expired.
/home/huishi/workspace/projectsideo_python/train_resource/train_split.py:12: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
 tr_configs = yaml.load(f)
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
/home/huishi/anaconda3/envs/sdb/python3.8/site-packages/skvideo/__init__.py:306: UserWarning: ffmpeg/ffprobe not found in path: /usr/local/bin
 warnings.warn("ffmpeg/ffprobe not found in path: " + str(path), UserWarning)
Traceback (most recent call last):
 File "RabbitMqUtils.py", line 17, in <module>
 from video_postprocess import post_Process
 File "/home/huishi/workspace/projectsideo_pythonideo_postprocess/post_Process.py", line 12, in <module>
 import skvideo.io
 File "/home/huishi/anaconda3/envs/sdb/python3.8/site-packages/skvideo/io/__init__.py", line 8, in <module>
 from .ffmpeg import *
ModuleNotFoundError: **No module named 'skvideo.io.ffmpeg'**
(sd) huishi@huishi:~/workspace/projectsideo_python$
</module></module></module>


I have tried to upgrade pip and skvideo but it doesn't work.


How can I solve this problem ?


-
When using ffmpeg api, the encoded gif is output to the dynamically applied buffer
5 septembre 2023, par yangjinhui2936Purpose:I want to use ffmpeg to encode data from rbg8 to gif format.Currently can be encoded into file output.


But I don't know how to store the gif directly in the buffer instead of saving it in the file.


Below is the text of the code:
input_w560_h1280.rgb8


#include 
#include 
#include 
#include 
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include <libavdevice></libavdevice>avdevice.h>

#define CONFIG_FBDEV_OUTDEV 1
#define GET_DATA_TO_BUFF 0

int readFileToBuffer(uint8_t *dst, const char* filename, long* fileSize) {
 FILE* file = fopen(filename, "rb");
 if (!file || dst == NULL) {
 fprintf(stderr, "cannot open file: %s %p\n", filename, dst);
 return -1;
 }

 fseek(file, 0, SEEK_END);
 *fileSize = ftell(file);
 fseek(file, 0, SEEK_SET);

 uint8_t *buffer = NULL;
 buffer = dst;
 if (!buffer) {
 fprintf(stderr, "buffer error\n");
 fclose(file);
 return -1;
 }

 // fread file to buffer
 if (fread(buffer, 1, *fileSize, file) != *fileSize) {
 fprintf(stderr, "read file failed size %ld\n", *fileSize);
 fclose(file);
 free(buffer);
 return -1;
 }

 fclose(file);
 return 0;
}

int writeBufferToFile(const char* filename, uint8_t* buffer, long bufferSize) {
 FILE* file = fopen(filename, "wb");
 if (!file) {
 fprintf(stderr, "cannot open: %s\n", filename);
 return -1;
 }

 if (fwrite(buffer, 1, bufferSize, file) != bufferSize) {
 fprintf(stderr, "cannot fwrite\n");
 fclose(file);
 return -1;
 }

 fclose(file);
 return 0;
}

int main() {
 const char *output_filename = "output.gif";
 const char *input_filename = "input_w560_h1280.rgb8";
 int width = 560;
 int height = 1280;

 avcodec_register_all();
 avdevice_register_all();
 av_register_all();

 av_log_set_level(AV_LOG_MAX_OFFSET);

 AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_GIF);
 if (!codec) {
 printf("GIF encoder not found.\n");
 return 1;
 }
 
 AVCodecContext *codecContext = avcodec_alloc_context3(codec);
 if (!codecContext) {
 printf("Could not allocate codec codecContext.\n");
 return 1;
 }

 codecContext->width = width;
 codecContext->height = height;
 codecContext->pix_fmt = AV_PIX_FMT_RGB8;
 codecContext->time_base = (AVRational){1, 25};
 
 if (avcodec_open2(codecContext, codec, NULL) < 0) {
 printf("Could not open codec.\n");
 return 1;
 }

 AVFormatContext *outputFormatContext = NULL;
 if (avformat_alloc_output_context2(&outputFormatContext, NULL, NULL, output_filename) < 0) {
 printf("Could not allocate output format codecContext.\n");
 return 1;
 }

 AVStream *stream = avformat_new_stream(outputFormatContext, NULL);
 if (!stream) {
 printf("Could not create stream.\n");
 return 1;
 }

 AVCodecParameters *codec_params = stream->codecpar;
 avcodec_parameters_from_context(codec_params, codecContext);

 if (avio_open(&outputFormatContext->pb, output_filename, AVIO_FLAG_WRITE) < 0) {
 printf("Could not open output file.\n");
 return 1;
 }

 /* write header for output */
 if(avformat_write_header(outputFormatContext, NULL) < 0)
 {
 printf("avformat_write_header failed\n");
 }

 // creat and init frame
 AVFrame *frame = av_frame_alloc();
 frame->format = AV_PIX_FMT_RGB8;
 frame->width = width;
 frame->height = height;
 /* check frame buff */
 if (av_frame_get_buffer(frame, 0) < 0) {
 printf("Failed to allocate frame buffer.\n");
 return -1;
 }

 /* read rgb data to frame->data[0] */
 uint8_t *rgb8data = (uint8_t *)av_malloc(width * height * 3);
 long read_size = 0;
 int ret = readFileToBuffer(rgb8data, input_filename, &read_size);
 if (ret != 0 || read_size == 0)
 {
 printf("error argbData %p read_size %ld\n", rgb8data, read_size);
 }
 /* cp input data to frame */
 av_image_copy_plane(frame->data[0], frame->linesize[0], rgb8data, width, width, height);

 // Init IOcontext (try to get the gif stream)
 #if GET_DATA_TO_BUFF
 AVIOContext *outputIoContext = NULL;

 if (avio_open_dyn_buf(&outputIoContext) < 0) {
 printf("Failed to open output buffer.\n");
 return -1;
 }
 #endif
 // Encoding loop (simulated frames)
 AVPacket pkt;
 av_init_packet(&pkt);
 pkt.data = NULL;
 pkt.size = 0;
 avcodec_send_frame(codecContext, frame);

 while (avcodec_receive_packet(codecContext, &pkt) == 0) {
 pkt.stream_index = stream->index;
 #if GET_DATA_TO_BUFF // try to get the gif stream
 avio_write(outputIoContext, pkt.data, pkt.size);
 #endif
 av_write_frame(outputFormatContext, &pkt);
 av_packet_unref(&pkt);
 }
 /* write end */
 av_write_trailer(outputFormatContext);
 // try to get the gif stream
 #if GET_DATA_TO_BUFF
 uint8_t *outputBuffer;
 int outputBufferSize = avio_close_dyn_buf(outputIoContext, &outputBuffer);
 writeBufferToFile("bf_1.gif", outputBuffer, outputBufferSize);
 #endif
 /* free */
 avformat_close_input(&outputFormatContext);
 av_frame_free(&frame);
 avcodec_free_context(&codecContext);
 av_free(rgb8data);

 return 0;
}



MAKEFILE


CC = gcc
CFLAGS = -Wall -g
CFLAGS += -I ../output/include
CFLAGS += -L ../output/lib
LIBS = -l:libavdevice.a -l:libavformat.a -l:libavcodec.a -lavfilter -lswresample -lswscale -l:libavutil.a -lpthread -lz -lbz2 -lm -ldl

all: encode_to_gif

encode_to_gif: encode_to_gif.c
 $(CC) $(CFLAGS) -o $@ $< $(LIBS)



Tried The content in the macro definition is the relevant solution I found online. Unfortunately, the data I got is in original rgb8 format, not in gif format.ffmpeg writes data to file and Data dumped from buffer
The data dumped from the buffer seems to have no gif header


My expected result I want to output the encoded gif directly to the buffer,but i don't know what to do.