History

avformat/yuvmpegenc: add support for rawvideo input

The demuxer exports rawvideo, so there's no reason for the muxer to only work with wrapped_avframe.

James Almer committed 3 years ago

Commit a2a0a811 parent 4c695bf1 file · +7 −1Browse files

Unified · Split

libavformat/yuv4mpegenc.c+7−1
@@ -189,6 +189,11 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) · 188 unmodified lines
189189
190190 avio_printf(s->pb, Y4M_FRAME_MAGIC "\n");
191191
192+ if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
193+ avio_write(pb, pkt->data, pkt->size);
194+ return 0;
195+ }
196+
192197 width = st->codecpar->width;
193198 height = st->codecpar->height;
194199 desc = av_pix_fmt_desc_get(st->codecpar->format);
@@ -218,7 +223,8 @@ static int yuv4_init(AVFormatContext *s) · 23 unmodified lines
218223 if (s->nb_streams != 1)
219224 return AVERROR(EIO);
220225
221− if (s->streams[0]->codecpar->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME) {
226+ if (s->streams[0]->codecpar->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME &&
227+ s->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) {
222228 av_log(s, AV_LOG_ERROR, "ERROR: Codec not supported.\n");
223229 return AVERROR_INVALIDDATA;
224230 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t