
Recherche avancée
Autres articles (28)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)
Sur d’autres sites (5720)
-
Debian php ffmpeg error "Could not get frame filename number 2 from pattern"
22 août 2021, par SamMy code below works fine in on my osx laptop


$sec = 1;
$ffmpeg = \FFMpeg\FFMpeg::create([
 'ffmpeg.binaries' => exec('which ffmpeg'),
 'ffprobe.binaries' => exec('which ffprobe')
]);

$video = $ffmpeg->open($file);
$frame = $video->frame(TimeCode::fromSeconds($sec));
if(!file_exists($newFilePath)) {
 $frame->save($newFilePath);
 $this->output->writeln('make: ' . $newFilePath);
}



but on debian I get error
Could not get frame filename number 2 from pattern


here is the error description from ffmpeg website




This usually occurs because the output name is incorrect or some option was omitted.
If outputting a single image you need to include -frames:v 1.
If outputting a series of images you need to use the proper naming pattern as described in the image muxer documentation. For example, output_%03d.png will make a series named output_001.png, output_002.png, output_003.png, etc.
If outputting a single image that is continuously overwritten with new images, add -update 1.




My filename looks fine to me


here is the detailed error :


ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-ss' '00:00:01.00' '-i' '/var/www/web/public/data/post/J4ukGXDowqFFA6hNIuP11606468845/BuF8e7HrkX1606 
 468845.mov' '-vframes' '1' '-f' 'image2' '/var/www/web/public/data/post/J4ukGXDowqFFA6hNIuP11606468845/BuF8e7HrkX1606468845-preview.webp':

Error Output:

ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd
64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libf
ribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-li
bpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-l
ibtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-li
bzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chrom
aprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/web/public/data/post/J4ukGXDowqFFA6hNIuP11606468845/BuF8e7HrkX1606468845.mov': 
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2020-11-27T09:17:34.000000Z
Duration: 00:00:03.18, start: 0.000000, bitrate: 932 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 138 kb/s (default) 
Metadata:
creation_time : 2020-11-27T09:17:34.000000Z
handler_name : Core Media Audio
Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 480x264, 780 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default) 
Metadata:
creation_time : 2020-11-27T09:17:34.000000Z
handler_name : Core Media Video
encoder : H.264
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> webp (libwebp_anim)) 
Press [q] to stop, [?] for help
Output #0, image2, to '/var/www/web/public/data/post/J4ukGXDowqFFA6hNIuP11606468845/BuF8e7HrkX1606468845-preview.webp': 
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
encoder : Lavf58.20.100
Stream #0:0(und): Video: webp (libwebp_anim), yuv420p, 480x264, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default) 
Metadata:
creation_time : 2020-11-27T09:17:34.000000Z
handler_name : Core Media Video
encoder : Lavc58.35.100 libwebp_anim
[image2 @ 0x55bc313ccfc0] Could not get frame filename number 2 from pattern '/var/www/web/public/data/post/J4ukGXDowqFFA6hNIuP11606468845/BuF8e7HrkX16064688 
 45-preview.webp' (either set update or use a pattern like %03d within the filename pattern) 
 av_interleaved_write_frame(): Invalid argument 
 frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.06 bitrate=N/A speed=1.54x 
 video:18kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown 
 Conversion failed! 



-
FFMPEG using AV_PIX_FMT_D3D11 gives "Error registering the input resource" from NVENC
13 novembre 2024, par nbabcockInput frames start on the GPU as
ID3D11Texture2D
pointers.

I encode them to H264 using FFMPEG + NVENC. NVENC works perfectly if I download the textures to CPU memory as format
AV_PIX_FMT_BGR0
, but I'd like to cut out the CPU texture download entirely, and pass the GPU memory pointer directly into the encoder in native format. I write frames like this :

int write_gpu_video_frame(ID3D11Texture2D* gpuTex, AVFormatContext* oc, OutputStream* ost) {
 AVFrame *hw_frame = ost->hw_frame;

 printf("gpuTex address = 0x%x\n", &gpuTex);

 hw_frame->data[0] = (uint8_t *) gpuTex;
 hw_frame->data[1] = (uint8_t *) (intptr_t) 0;
 hw_frame->pts = ost->next_pts++;

 return write_frame(oc, ost->enc, ost->st, hw_frame);
 // write_frame is identical to sample code in ffmpeg repo
}



Running the code with this modification gives the following error :


gpuTex address = 0x4582f6d0
[h264_nvenc @ 00000191233e1bc0] Error registering an input resource: invalid call (9):
[h264_nvenc @ 00000191233e1bc0] Could not register an input HW frame
Error sending a frame to the encoder: Unknown error occurred




Here's some supplemental code used in setting up and configuring the hw context and encoder :


/* A few config flags */
#define ENABLE_NVENC TRUE
#define USE_D3D11 TRUE // Skip downloading textures to CPU memory and send it straight to NVENC



/* Init hardware frame context */
static int set_hwframe_ctx(AVCodecContext* ctx, AVBufferRef* hw_device_ctx) {
 AVBufferRef* hw_frames_ref;
 AVHWFramesContext* frames_ctx = NULL;
 int err = 0;

 if (!(hw_frames_ref = av_hwframe_ctx_alloc(hw_device_ctx))) {
 fprintf(stderr, "Failed to create HW frame context.\n");
 throw;
 }
 frames_ctx = (AVHWFramesContext*) (hw_frames_ref->data);
 frames_ctx->format = AV_PIX_FMT_D3D11;
 frames_ctx->sw_format = AV_PIX_FMT_NV12;
 frames_ctx->width = STREAM_WIDTH;
 frames_ctx->height = STREAM_HEIGHT;
 //frames_ctx->initial_pool_size = 20;
 if ((err = av_hwframe_ctx_init(hw_frames_ref)) < 0) {
 fprintf(stderr, "Failed to initialize hw frame context. Error code: %s\n", av_err2str(err));
 av_buffer_unref(&hw_frames_ref);
 throw;
 }
 ctx->hw_frames_ctx = av_buffer_ref(hw_frames_ref);
 if (!ctx->hw_frames_ctx)
 err = AVERROR(ENOMEM);

 av_buffer_unref(&hw_frames_ref);
 return err;
}



/* Add an output stream. */
static void add_video_stream(
 OutputStream* ost,
 AVFormatContext* oc,
 const AVCodec** codec,
 enum AVCodecID codec_id,
 int width,
 int height
) {
 AVCodecContext* c;
 int i;
 bool nvenc = false;

 /* find the encoder */
 if (ENABLE_NVENC) {
 printf("Getting nvenc encoder\n");
 *codec = avcodec_find_encoder_by_name("h264_nvenc");
 nvenc = true;
 }
 
 if (!ENABLE_NVENC || *codec == NULL) {
 printf("Getting standard encoder\n");
 avcodec_find_encoder(codec_id);
 nvenc = false;
 }
 if (!(*codec)) {
 fprintf(stderr, "Could not find encoder for '%s'\n",
 avcodec_get_name(codec_id));
 exit(1);
 }

 ost->st = avformat_new_stream(oc, NULL);
 if (!ost->st) {
 fprintf(stderr, "Could not allocate stream\n");
 exit(1);
 }
 ost->st->id = oc->nb_streams - 1;
 c = avcodec_alloc_context3(*codec);
 if (!c) {
 fprintf(stderr, "Could not alloc an encoding context\n");
 exit(1);
 }
 ost->enc = c;

 printf("Using video codec %s\n", avcodec_get_name(codec_id));

 c->codec_id = codec_id;
 c->bit_rate = 4000000;
 /* Resolution must be a multiple of two. */
 c->width = STREAM_WIDTH;
 c->height = STREAM_HEIGHT;
 /* timebase: This is the fundamental unit of time (in seconds) in terms
 * of which frame timestamps are represented. For fixed-fps content,
 * timebase should be 1/framerate and timestamp increments should be
 * identical to 1. */
 ost->st->time_base = {1, STREAM_FRAME_RATE};
 c->time_base = ost->st->time_base;
 c->gop_size = 12; /* emit one intra frame every twelve frames at most */

 if (nvenc && USE_D3D11) {
 const std::string hw_device_name = "d3d11va";
 AVHWDeviceType device_type = av_hwdevice_find_type_by_name(hw_device_name.c_str());

 // set up hw device context
 AVBufferRef *hw_device_ctx;
 // const char* device = "0"; // Default GPU (may be integrated in the case of switchable graphics!)
 const char* device = "1";
 ret = av_hwdevice_ctx_create(&hw_device_ctx, device_type, device, nullptr, 0);

 if (ret < 0) {
 fprintf(stderr, "Could not create hwdevice context; %s", av_err2str(ret));
 }

 set_hwframe_ctx(c, hw_device_ctx);
 c->pix_fmt = AV_PIX_FMT_D3D11;
 } else if (nvenc && !USE_D3D11)
 c->pix_fmt = AV_PIX_FMT_BGR0;
 else
 c->pix_fmt = STREAM_PIX_FMT;

 if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
 /* just for testing, we also add B-frames */
 c->max_b_frames = 2;
 }

 if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
 /* Needed to avoid using macroblocks in which some coeffs overflow.
 * This does not happen with normal video, it just happens here as
 * the motion of the chroma plane does not match the luma plane. */
 c->mb_decision = 2;
 }

 /* Some formats want stream headers to be separate. */
 if (oc->oformat->flags & AVFMT_GLOBALHEADER)
 c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}



-
"connection reset by peer" error when streaming from ffmpeg to ffserver
7 juillet 2021, par g KishoreI'm trying to stream a static video file using ffmpeg to ffserver in androidv7.1.2 embedded board.


- 

- Started ffserver with command "ffserver -d /etc/ffserver.conf &"
- ffmpeg command used to stream :
ffmpeg -i ./sample_960x400_ocean_with_audio.3gp -f flv http://192.168.47.174:8090/feed1.ffm






ffserver.conf file content


HTTPPort 8090
HTTPBindAddress 192.168.47.174
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 100000

#NoDaemon
#UseDefaults
#NoDefaults

<feed>
File /data/local/tmp/feed1.ffm
FileMaxSize 5M
</feed>

<stream>
Feed feed1.ffm
Format flv

VideoCodec libx264
VideoFrameRate 24
VideoBufferSize 80000
VideoBitRate 512
VideoQMin 1
VideoQMax 5
VideoSize 960x418
PreRoll 0
Noaudio
</stream>



Error :


Thu Jan 1 00:20:04 2015 192.168.47.174 - - [POST] "/feed1.ffm HTTP/1.1" 200 415
av_interleaved_write_frame(): Connection reset by peer
 Last message repeated 1 times
[flv @ 0x41be1d40] Failed to update header with correct duration.
[flv @ 0x41be1d40] Failed to update header with correct filesize.
Error writing trailer of http://192.168.47.174:8090/feed1.ffm: Connection reset by peer
frame= 1 fps=0.0 q=1.6 Lsize= 0kB time=00:00:00.09 bitrate= 33.0kbits/s speed=1.68x 
video:10kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!



Any help is greatly appreciated.