
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (68)
-
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site -
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 (...)
Sur d’autres sites (8862)
-
FFMPEG compiled binaries don't run on XP using MinGW
10 juin 2015, par Paul KnopfI am trying to build windows executables/dlls for Windows XP, and they are not working. They are the correct architecture. They run fine on my Windows 8 device machine.
I used dependency walker to find missing DLLs, and all were present.
Here are the compiled executables I am trying to run.
I ran the windows build script for ffmpeg.
Here is a
dumpbin /headers ffmpeg.exe
Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file ffmpeg.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (x86)
7 number of sections
51A40 time date stamp Sun Jan 04 15:53:20 1970
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
32F characteristics
Relocations stripped
Executable
Line numbers stripped
Symbols stripped
Application can handle large (>2GB) addresses
32 bit word machine
Debug information stripped
OPTIONAL HEADER VALUES
10B magic # (PE32)
2.25 linker version
41400 size of code
4FA00 size of initialized data
1200 size of uninitialized data
14E0 entry point (004014E0)
1000 base of code
43000 base of data
400000 image base (00400000 to 00456FFF)
1000 section alignment
200 file alignment
4.00 operating system version
1.00 image version
4.00 subsystem version
0 Win32 version
57000 size of image
400 size of headers
597A9 checksum
3 subsystem (Windows CUI)
140 DLL characteristics
Dynamic base
NX compatible
200000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
0 [ 0] RVA [size] of Export Directory
51000 [ 36F0] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
0 [ 0] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
56004 [ 18] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
517F0 [ 6C4] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
412BC virtual size
1000 virtual address (00401000 to 004422BB)
41400 size of raw data
400 file pointer to raw data (00000400 to 000417FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60500060 flags
Code
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Execute Read
SECTION HEADER #2
.data name
19C virtual size
43000 virtual address (00443000 to 0044319B)
200 size of raw data
41800 file pointer to raw data (00041800 to 000419FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0700040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #3
.rdata name
A7D8 virtual size
44000 virtual address (00444000 to 0044E7D7)
A800 size of raw data
41A00 file pointer to raw data (00041A00 to 0004C1FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40700040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Only
SECTION HEADER #4
.bss name
1200 virtual size
4F000 virtual address (0044F000 to 004501FF)
0 size of raw data
0 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0700080 flags
Uninitialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #5
.idata name
36F0 virtual size
51000 virtual address (00451000 to 004546EF)
3800 size of raw data
4C200 file pointer to raw data (0004C200 to 0004F9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #6
.CRT name
3C virtual size
55000 virtual address (00455000 to 0045503B)
200 size of raw data
4FA00 file pointer to raw data (0004FA00 to 0004FBFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #7
.tls name
20 virtual size
56000 virtual address (00456000 to 0045601F)
200 size of raw data
4FC00 file pointer to raw data (0004FC00 to 0004FDFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
Summary
1000 .CRT
2000 .bss
1000 .data
4000 .idata
B000 .rdata
42000 .text
1000 .tlsWhen I attempt to run the executable on XP, it just closes. There is no "missing dll" messages, nor anything in the event viewer.
-
BGR0 -> VAAPI fmt -> VAAPI h264 encode - with BGR0 file input gives junk encoded data
4 avril 2019, par rgagI am writing a small c application using ffmpeg libraries to take a raw BGR0 file input and use VA apis to convert BGR0 to VAAPI pix_fmt which is directly fed to H264 encoder in GPU. The entire pipeline is working but the encoded frames are junk. Please go through the code and suggest if any changes needs to be done to the code. I suspect something related to setting of input and output frame, but I am not able to figure it out.
Summary of the code is
Create filters buffersrc and buffersink. Create vf_scale_vaapi filter
and connect all filters as buffersrc->vf_scale_vaapi->buffersink.
Input to buffersrc is BGR0 frame and output of buffersink is VAAPI
frame. This VAAPI frame is fed to h264 encoder in gpu for encoding.const char *filter_descr = "hwupload,scale_vaapi=format=nv12";
avfilter_register_all();
av_log_set_level(48);
char args[512];
AVFilter *buffersrc = avfilter_get_by_name("buffer");
AVFilter *buffersink = avfilter_get_by_name("buffersink");
if ( buffersink == NULL )
printf("getting nul as sfilter name\n");
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE };
AVBufferSinkParams *buffersink_params;
filter_graph = avfilter_graph_alloc();
/* buffer video source: the decoded frames from the decoder will be inserted here. */
snprintf(args, sizeof(args),
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
in_width,in_height,AV_PIX_FMT_BGR0,
1, 25,1,1);
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
args, NULL, filter_graph);
if (ret < 0) {
printf("Cannot create buffer source\n");
return ret;
}
/* buffer video sink: to terminate the filter chain. */
buffersink_params = av_buffersink_params_alloc();
buffersink_params->pixel_fmts = pix_fmts;
ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
NULL, buffersink_params, filter_graph);
av_free(buffersink_params);
if (ret < 0) {
printf("Cannot create buffer sink\n");
return ret;
}
/* Endpoints for the filter graph. */
outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0;
outputs->next = NULL;
inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx = 0;
inputs->next = NULL;
type = av_hwdevice_find_type_by_name("vaapi");
printf("did not find the hw device type\n");
ret = -1;
}
ret = av_hwdevice_ctx_create(&device_ref, AV_HWDEVICE_TYPE_VAAPI, "/dev/dri/renderD128", NULL, 0);
if ( ret < 0 )
printf("could not create tghe hw devicew nctx\n");
if (!(codec = avcodec_find_encoder_by_name(enc_name))) {
fprintf(stderr, "Could not find encoder.\n");
err = -1;
goto fail;
}
if (!(avctx = avcodec_alloc_context3(codec))) {
err = AVERROR(ENOMEM);
goto fail;
}
avctx->width = width;
avctx->height = height;
avctx->time_base = (AVRational){1, 25};
avctx->framerate = (AVRational){25, 1};
avctx->sample_aspect_ratio = (AVRational){1, 1};
avctx->pix_fmt = AV_PIX_FMT_VAAPI;
avctx->profile = FF_PROFILE_H264_HIGH;
hw_device_ctx = av_buffer_ref(device_ref);
if (!hw_device_ctx){
printf("could not ref hw device buf\n");
ret= AVERROR(ENOMEM);
}
AVBufferRef *device = hw_device_ctx;
for (i = 0; i < filter_graph->nb_filters; i++) {
filter_graph->filters[i]->hw_device_ctx = av_buffer_ref(device);
if (!filter_graph->filters[i]->hw_device_ctx) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
//========== BLOCK of CODE which I feel needs help===================
if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_descr, &inputs, &outputs, NULL)) < 0)
return ret;
for (i = 0; i < filter_graph->nb_filters; i++) {
filter_graph->filters[i]->hw_device_ctx = av_buffer_ref(device);
if (!filter_graph->filters[i]->hw_device_ctx) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
frame_out=av_frame_alloc();
frame_buffer_out=(unsigned char *)av_malloc(av_image_get_buffer_size(AV_PIX_FMT_VAAPI, in_width,in_height,1));
av_image_fill_arrays(frame_out->data, frame_out->linesize,frame_buffer_out,
AV_PIX_FMT_VAAPI,in_width, in_height,1);
frame_in->width=in_width;
frame_in->height=in_height;
frame_in->format=AV_PIX_FMT_BGR0;
avctx->hw_frames_ctx = av_buffer_ref(av_buffersink_get_hw_frames_ctx(buffersink_ctx));
if ( !avctx->hw_frames_ctx){
fprintf(stderr, "Failed to set hwframe context.\n");
goto fail;
}
if ((err = avcodec_open2(avctx, codec, NULL)) < 0) {
fprintf(stderr, "Cannot open video encoder codec. Error code: %s\n", av_err2str(err));
goto fail;
}
//=====================================================================
i = 0;
while (1) {
if(fread(frame_buffer_in, 1, in_width*in_height*4, fp_in)!= in_width*in_height*4){ //bgr0 read
break;
}
//input BGR 0
frame_in->data[0]=frame_buffer_in;
frame_in->pts = (1.0 / 30) * 90 * i;
i++;
if (av_buffersrc_add_frame(buffersrc_ctx, frame_in) < 0) {
printf( "Error while add frame.\n");
break;
}
/* pull filtered pictures from the filtergraph */
ret = av_buffersink_get_frame(buffersink_ctx, frame_out);
if (ret < 0){
printf("unable to get frma e from buffer sink\n");
break;
}
// Make sure Closed Captions will not be duplicated
av_frame_remove_side_data(frame_out, AV_FRAME_DATA_A53_CC);
int ret = 0;
AVPacket enc_pkt;
av_init_packet(&enc_pkt);
enc_pkt.data = NULL;
enc_pkt.size = 0;
if ((ret = avcodec_send_frame(avctx, frame_out)) < 0) {
fprintf(stderr, "Error code: %s\n", av_err2str(ret));
goto fail;
}
// Make sure Closed Captions will not be duplicated
av_frame_remove_side_data(frame, AV_FRAME_DATA_A53_CC);
while (1) {
ret = avcodec_receive_packet(avctx, &enc_pkt);
if (ret ) //< 0 && ret != AVERROR(EAGAIN))
break;
enc_pkt.stream_index = 0;
ret = fwrite(enc_pkt.data, enc_pkt.size, 1, fp_out);
}
av_packet_unref(&enc_pkt);
} -
Can I know which byte range to read from a remote mp4 file for FFMpeg to decode a keyframe ?
12 octobre 2023, par db9117I need to decode a of keyframe of a video file (mp4, h264 encoded). I know the timestamp of the keyframe I want to extract/decode. I want to minimize amount of data being read in memory. For this, I need to know beforehand exactly the minimal byte range I would require that encompasses this keyframe. How do I know what is the minimal byte range in the whole mp4 byte stream I need to read in order to be able to decode the keyframe ?


I currently find the appropriate keyframe in the
index_entries
contained in the header. I get its byte position (pos
attribute) and timestamp (timestamp
attribute). I calculate the range as follows :

startBytes
: minimum of :

- 

- the
pos
of the keyframe - the
pos
of the nearest index entry in the audio stream happening at or before the keyframe's timestamp.






This way when it's decoding the frame, if it also needs the audio content for demuxing, it would have it.


endBytes
: maximum of :

- 

- the
pos
of the next frame in the video stream's index, after the keyframe - the
pos
of the next frame in the audio stream's index after the timestamp of the wished keyframe.






This way I know that I have everything up until the next frame in the index, which theoretically should be enough to decode the keyframe only.


I then read the appropriate byte range.


When I try to decode the frame, I run in a loop until I succeed :


- 

avcodec_read_frame
avcodec_send_packet
avcodec_receive_frame








I ignore
AVERROR(EAGAIN)
errors.

avcodec_receive_frame
fails multiple times with errorAVERROR(EAGAIN)
which I ignore, until it fails saying that the memory it wants to read isn't available (wants to read afterendBytes
). I explicitly tell it to fail if it wants to read more than it has already read.

Note : for other keyframes at other positions in other videos, it sometimes succeeds (probably because the range is big enough by chance), but it fails more often than not.


My question is : Why is the end of the range not enough to be able to decode only the one keyframe ? Is there any way to more precisely calculate the exact range in bytes I would need in order to decode a particular keyframe ?


- the