Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/yuvmpegenc: add support for rawvideo input
@ 2023-05-17 14:23 James Almer
  2023-05-18 19:54 ` Ronald S. Bultje
  0 siblings, 1 reply; 3+ messages in thread
From: James Almer @ 2023-05-17 14:23 UTC (permalink / raw)
  To: ffmpeg-devel

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

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/yuv4mpegenc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index 2fa5ee2714..968ba2fa13 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -189,6 +189,11 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
 
     avio_printf(s->pb, Y4M_FRAME_MAGIC "\n");
 
+    if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
+        avio_write(pb, pkt->data, pkt->size);
+        return 0;
+    }
+
     width  = st->codecpar->width;
     height = st->codecpar->height;
     desc   = av_pix_fmt_desc_get(st->codecpar->format);
@@ -218,7 +223,8 @@ static int yuv4_init(AVFormatContext *s)
     if (s->nb_streams != 1)
         return AVERROR(EIO);
 
-    if (s->streams[0]->codecpar->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME) {
+    if (s->streams[0]->codecpar->codec_id != AV_CODEC_ID_WRAPPED_AVFRAME &&
+        s->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) {
         av_log(s, AV_LOG_ERROR, "ERROR: Codec not supported.\n");
         return AVERROR_INVALIDDATA;
     }
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/yuvmpegenc: add support for rawvideo input
  2023-05-17 14:23 [FFmpeg-devel] [PATCH] avformat/yuvmpegenc: add support for rawvideo input James Almer
@ 2023-05-18 19:54 ` Ronald S. Bultje
  2023-05-18 20:31   ` James Almer
  0 siblings, 1 reply; 3+ messages in thread
From: Ronald S. Bultje @ 2023-05-18 19:54 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi,

On Wed, May 17, 2023 at 10:23 AM James Almer <jamrial@gmail.com> wrote:

> The demuxer exports rawvideo, so there's no reason for the muxer to only
> work with wrapped_avframe.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/yuv4mpegenc.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>

Works for me, thanks - and LGTM.

Ronald
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avformat/yuvmpegenc: add support for rawvideo input
  2023-05-18 19:54 ` Ronald S. Bultje
@ 2023-05-18 20:31   ` James Almer
  0 siblings, 0 replies; 3+ messages in thread
From: James Almer @ 2023-05-18 20:31 UTC (permalink / raw)
  To: ffmpeg-devel

On 5/18/2023 4:54 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, May 17, 2023 at 10:23 AM James Almer <jamrial@gmail.com> wrote:
> 
>> The demuxer exports rawvideo, so there's no reason for the muxer to only
>> work with wrapped_avframe.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavformat/yuv4mpegenc.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
> 
> Works for me, thanks - and LGTM.
> 
> Ronald

Pushed, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-18 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-17 14:23 [FFmpeg-devel] [PATCH] avformat/yuvmpegenc: add support for rawvideo input James Almer
2023-05-18 19:54 ` Ronald S. Bultje
2023-05-18 20:31   ` James Almer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git