The demuxer exports rawvideo, so there's no reason for the muxer to only work with wrapped_avframe.
Unified · Split
| @@ -189,6 +189,11 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) · 188 unmodified lines | ||
| 189 | 189 | |
| 190 | 190 | avio_printf(s->pb, Y4M_FRAME_MAGIC "\n"); |
| 191 | 191 | |
| 192 | + if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) { | |
| 193 | + avio_write(pb, pkt->data, pkt->size); | |
| 194 | + return 0; | |
| 195 | + } | |
| 196 | + | |
| 192 | 197 | width = st->codecpar->width; |
| 193 | 198 | height = st->codecpar->height; |
| 194 | 199 | desc = av_pix_fmt_desc_get(st->codecpar->format); |
| @@ -218,7 +223,8 @@ static int yuv4_init(AVFormatContext *s) · 23 unmodified lines | ||
| 218 | 223 | if (s->nb_streams != 1) |
| 219 | 224 | return AVERROR(EIO); |
| 220 | 225 | |
| 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) { | |
| 222 | 228 | av_log(s, AV_LOG_ERROR, "ERROR: Codec not supported.\n"); |
| 223 | 229 | return AVERROR_INVALIDDATA; |
| 224 | 230 | } |