I'm currently trying to transcode a VPX video (VP8 / VP9) to mpeg2video and transmit it over UDP using mpegts.
I initialized all contexts and streams, and as long as I pass it to ffplay, it works, if I send a stream to VLC or another player, the receiver displays only the first frame and does nothing. If I do the same 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
FFMPEG av_dump:
Output
Any idea on what I can do wrong?
source share