tmp
authoryu.dongliang <18588496441@163.com>
Mon, 10 Apr 2023 10:18:28 +0000 (18:18 +0800)
committeryu.dongliang <18588496441@163.com>
Mon, 10 Apr 2023 10:18:28 +0000 (18:18 +0800)
scf_def.h
simp_ffmpeg_output.c
simp_filter.c

index c735f3425f01d4787a4860ff7a5d66761835147a..22d1be52f51abe8f48808d8f4113e21a93928007 100644 (file)
--- a/scf_def.h
+++ b/scf_def.h
@@ -11,6 +11,9 @@
 #include<time.h>
 #include<unistd.h>
 #include<pthread.h>
+#include<sys/types.h>
+#include<sys/stat.h>
+#include<fcntl.h>
 
 #if 1
 #include<sys/time.h>
index b5e4cc17f8c4b869eb87b362a7747d09e9c853f1..7f232981cf684764d9eedcf162f3599a6244931b 100644 (file)
@@ -29,7 +29,7 @@ static int _video_init(simp_ffmpeg_t* priv)
        priv->vcodec_ctx->gop_size     = 30;
        priv->vcodec_ctx->max_b_frames = 2;
        priv->vcodec_ctx->pix_fmt      = AV_PIX_FMT_YUV420P;
-       priv->vcodec_ctx->sample_aspect_ratio = (AVRational){16, 9};
+       priv->vcodec_ctx->sample_aspect_ratio = (AVRational){1, 1};
        s->time_base                   = priv->vcodec_ctx->time_base;
 
        if (priv->fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
index 978da9af9eccf8500e47dd8bc6789141022a70c3..6501430f23e88f6ee59f99b9d35cbb34bf47c303 100644 (file)
@@ -341,7 +341,23 @@ static void* __filter_run(void* arg)
                                f->error = ret;
                                goto error;
                        }
+#if 1
+                       static int fd = -1;
+                       if (-1 == fd)
+                               fd = open("1.yuv", O_RDWR | O_CREAT | O_TRUNC, 0666);
 
+                       if (fd > 0) {
+                               int i;
+                               for (i = 0; i < f->vframe->height; i++)
+                                       write(fd, f->vframe->data[0] + i * f->vframe->linesize[0], f->vframe->width);
+
+                               for (i = 0; i < f->vframe->height / 2; i++)
+                                       write(fd, f->vframe->data[1] + i * f->vframe->linesize[1], f->vframe->width / 2);
+
+                               for (i = 0; i < f->vframe->height / 2; i++)
+                                       write(fd, f->vframe->data[2] + i * f->vframe->linesize[2], f->vframe->width / 2);
+                       }
+#endif
                        for (l = scf_list_head(&f->outputs); l != scf_list_sentinel(&f->outputs); l = scf_list_next(l)) {
                                io = scf_list_data(l, simp_avio_t, list);