
Recherche avancée
Autres articles (57)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (4136)
-
ffmpeg generates file with only audio from ts
8 novembre 2016, par SeomanI’m trying to get some parts of a ts video and then merge them into a new video. The problem is that when doing the split, the video is lost. The splits only contains audio. Here is the video source information :
ffmpeg -i source_file.ts
ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.29)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mpegts, from '97274181.ts':
Duration: 00:02:30.70, start: 60.000000, bitrate: 3582 kb/s
Program 1
Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 139 kb/s
Stream #0:1[0x101]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, unknown/bt709/unknown), 1920x1080, 60 fps, 60 tbr, 90k tbn, 2k tbc
Stream #0:2[0x102]: Data: timed_id3 (ID3 / 0x20334449)
At least one output file must be specifiedThis is the command used for doing the split :
ffmpeg -ss 10 -i source_file.ts -t 5 -c copy cut1.ts
And this is the video information after the cut :
ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.29)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[NULL @ 0x7fc9ba008000] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 0x7fc9b9800000] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'siri1.ts':
Duration: 00:00:05.08, start: 1.400000, bitrate: 148 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 ([27][0][0][0] / 0x001B), none, 90k tbr, 90k tbn, 180k tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 120 kb/s
At least one output file must be specifiedIf I reproduce cut1.ts I can only hear the audio. Video is gone.
-
FFmpeg(C/libav) VPX to mpeg2video stream cannot be reproduce in VLC
21 septembre 2017, par caiomcgI am currently trying to transcode a VPX(VP8/VP9) video to a mpeg2video and stream it over UDP with mpegts.
I have initialized all of the contexts and the streams and as long as I stream it to ffplay it works, if I send the stream to VLC or another player, the receiver only display the first frame and do nothing else. If I do the same thing through the command line it works flawlessly -
ffmpeg -re -i video.webm -an -f mpegts udp://127.0.0.1:8080
My output context :
this->output_codec_ctx_->codec_type = AVMEDIA_TYPE_VIDEO; // Set media type
this->output_codec_ctx_->pix_fmt = AV_PIX_FMT_YUV420P; // Set stream pixel format
this->output_codec_ctx_->time_base.den = ceil(av_q2d(input_stream->r_frame_rate)); // Add the real video framerate. Eg.: 29.9
this->output_codec_ctx_->time_base.num = 1; // Numerator of the framerate. Eg.: num/29.9
this->output_codec_ctx_->width = input_stream->codecpar->width; // Video width
this->output_codec_ctx_->height = input_stream->codecpar->height; // Video height
this->output_codec_ctx_->bit_rate = 400000; // Video quality
this->output_codec_ctx_->gop_size = 12;
this->output_codec_ctx_->max_b_frames = 2;
this->output_codec_ctx_->framerate = this->input_codec_ctx_->framerate;
this->output_codec_ctx_->sample_aspect_ratio = this->input_codec_ctx_->sample_aspect_ratio;My av_dump :
Output #0, mpegts, to 'udp://127.0.0.1:20010':
Metadata:
encoder : Lavf57.72.101
Stream #0:0: Video: mpeg2video (Main), 1 reference frame, yuv420p, 480x640 (0x0), q=2-31, 400 kb/s, SAR 1:1 DAR 3:4, 24 fps, 24 tbr, 90k tbnFFMPEG av_dump :
Output #0, mpegts, to 'udp://127.0.0.1:20010':
Metadata:
title : Tears of Steel
encoder : Lavf57.72.101
Stream #0:0: Video: mpeg2video (Main), yuv420p, 480x640 [SAR 1:1 DAR 3:4], q=2-31, 200 kb/s, 24 fps, 90k tbn, 24 tbc (default)
Metadata:
encoder : Lavc57.96.101 mpeg2video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1Any ideia on what I may be doing wrong ?
-
ffmpeg create RTP stream
27 novembre 2016, par DankMemesI’m trying to encode and stream using ffmpeg (libavcodec/libavformat - MSVC x64 with Zeranoe builds)
Here is my code, largely adapted from the encoding example, error handling removed
#include "stdafx.h"
extern "C" {
#include <libavformat></libavformat>avformat.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavutil></libavutil>opt.h>
#include <libavutil></libavutil>channel_layout.h>
#include <libavutil></libavutil>common.h>
#include <libavutil></libavutil>imgutils.h>
#include <libavutil></libavutil>mathematics.h>
#include <libavutil></libavutil>samplefmt.h>
}
#pragma comment(lib, "avformat.lib")
#pragma comment(lib, "avutil.lib")
#pragma comment(lib, "avcodec.lib")
int main() {
avcodec_register_all();
av_register_all();
avformat_network_init();
AVCodecID codec_id = AV_CODEC_ID_H264;
AVCodec *codec;
AVCodecContext *c = NULL;
int i, ret, x, y, got_output;
AVFrame *frame;
AVPacket pkt;
codec = avcodec_find_encoder(codec_id);
c = avcodec_alloc_context3(codec);
c->bit_rate = 400000;
c->width = 352;
c->height = 288;
c->time_base.num = 1;
c->time_base.den = 25;
c->gop_size = 25;
c->max_b_frames = 1;
c->pix_fmt = AV_PIX_FMT_YUV420P;
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->flags = CODEC_FLAG_GLOBAL_HEADER;
if (codec_id == AV_CODEC_ID_H264) {
ret = av_opt_set(c->priv_data, "preset", "ultrafast", 0);
ret = av_opt_set(c->priv_data, "tune", "zerolatency", 0);
}
avcodec_open2(c, codec, NULL)
frame = av_frame_alloc();
frame->format = c->pix_fmt;
frame->width = c->width;
frame->height = c->height;
ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height,
c->pix_fmt, 32);
AVFormatContext* avfctx;
AVOutputFormat* fmt = av_guess_format("rtp", NULL, NULL);
ret = avformat_alloc_output_context2(&avfctx, fmt, fmt->name,
"rtp://127.0.0.1:49990");
printf("Writing to %s\n", avfctx->filename);
avio_open(&avfctx->pb, avfctx->filename, AVIO_FLAG_WRITE)
struct AVStream* stream = avformat_new_stream(avfctx, codec);
stream->codecpar->bit_rate = 400000;
stream->codecpar->width = 352;
stream->codecpar->height = 288;
stream->codecpar->codec_id = AV_CODEC_ID_H264;
stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
stream->time_base.num = 1;
stream->time_base.den = 25;
avformat_write_header(avfctx, NULL);
char buf[200000];
AVFormatContext *ac[] = { avfctx };
av_sdp_create(ac, 1, buf, 20000);
printf("sdp:\n%s\n", buf);
FILE* fsdp;
fopen_s(&fsdp, "test.sdp", "w");
fprintf(fsdp, "%s", buf);
fclose(fsdp);
system("PAUSE");
system("start "" \"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\" test.sdp");
int j = 0;
for (i = 0; i < 10000; i++) {
av_init_packet(&pkt);
pkt.data = NULL; // packet data will be allocated by the encoder
pkt.size = 0;
fflush(stdout);
/* prepare a dummy image */
/* Y */
for (y = 0; y < c->height; y++) {
for (x = 0; x < c->width; x++) {
frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3;
}
}
/* Cb and Cr */
for (y = 0; y < c->height / 2; y++) {
for (x = 0; x < c->width / 2; x++) {
frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2;
frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5;
}
}
frame->pts = i;
/* encode the image */
ret = avcodec_send_frame(c, frame);
ret = avcodec_receive_packet(c, &pkt);
if (ret == AVERROR_EOF) {
got_output = false;
printf("Stream EOF\n");
} else if(ret == AVERROR(EAGAIN)) {
got_output = false;
printf("Stream EAGAIN\n");
} else {
got_output = true;
}
if (got_output) {
printf("Write frame %3d (size=%5d)\n", j++, pkt.size);
av_interleaved_write_frame(avfctx, &pkt);
av_packet_unref(&pkt);
}
Sleep(40);
}
// end
ret = avcodec_send_frame(c, NULL);
/* get the delayed frames */
for (; ; i++) {
fflush(stdout);
ret = avcodec_receive_packet(c, &pkt);
if (ret == AVERROR_EOF) {
printf("Stream EOF\n");
break;
} else if (ret == AVERROR(EAGAIN)) {
printf("Stream EAGAIN\n");
got_output = false;
} else {
got_output = true;
}
if (got_output) {
printf("Write frame %3d (size=%5d)\n", j++, pkt.size);
av_interleaved_write_frame(avfctx, &pkt);
av_packet_unref(&pkt);
}
}
avcodec_close(c);
av_free(c);
av_freep(&frame->data[0]);
av_frame_free(&frame);
printf("\n");
system("pause");
return 0;
}However VLC (opened with the generated SDP file) isn’t able to play the stream. Messages has this
core error: ES_OUT_RESET_PCR called
followed by repeated
packetizer_h264 warning: waiting for SPS/PPS
core debug: Buffering <some percent="percent">%
</some>What am I doing wrong ?