ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 11440|回复: 7

[Linux] ffmpeg 视频合成失真问题

[复制链接]
发表于 2020-10-28 14:49:55 | 显示全部楼层 |阅读模式
centos 系统下 安装的 ffmpeg-4.3.1
  1. ffmpeg -i /www/wwwroot/oa/uploads/file/20201028/d7f7c44d845dc3fce6755833f7d48844.mp4 -i 1.mp4 -filter_complex "[1:v]scale=w=300:h=300:force_original_aspect_ratio=decrease[ckout];[0:v][ckout]overlay=x=main_w-overlay_w:y=main_h-overlay_h[out]" -map "[out]" -map 0:a -map 1:a -r:v 30 -movflags faststart /www/wwwroot/oa/uploads/file/20201028/out.mp4
复制代码
  1. ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  2.   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
  3.   configuration: --enable-shared --prefix=/usr/local/ffmpeg --disable-yasm
  4.   libavutil      56. 51.100 / 56. 51.100
  5.   libavcodec     58. 91.100 / 58. 91.100
  6.   libavformat    58. 45.100 / 58. 45.100
  7.   libavdevice    58. 10.100 / 58. 10.100
  8.   libavfilter     7. 85.100 /  7. 85.100
  9.   libswscale      5.  7.100 /  5.  7.100
  10.   libswresample   3.  7.100 /  3.  7.100
  11. Input #0, matroska,webm, from '/www/wwwroot/oa/uploads/file/20201028/d7f7c44d845dc3fce6755833f7d48844.mp4':
  12.   Metadata:
  13.     encoder         : Chrome
  14.   Duration: N/A, start: 0.000000, bitrate: N/A
  15.     Stream #0:0(eng): Audio: opus, 48000 Hz, mono, fltp (default)
  16.     Stream #0:1(eng): Video: h264 (Constrained Baseline), yuv420p(progressive), 392x720, SAR 1:1 DAR 49:90, 16.67 fps, 16.67 tbr, 1k tbn, 2k tbc (default)
  17. Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  18.   Metadata:
  19.     major_brand     : mp42
  20.     minor_version   : 0
  21.     compatible_brands: mp42isom
  22.     creation_time   : 2020-08-25T03:03:30.000000Z
  23.     copyright       :
  24.     copyright-eng   :
  25.   Duration: 00:00:59.30, start: 0.000000, bitrate: 1035 kb/s
  26.     Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
  27.     Metadata:
  28.       creation_time   : 2020-08-25T03:03:30.000000Z
  29.     Stream #1:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 544x960, 837 kb/s, 29.86 fps, 29.83 tbr, 90k tbn, 60 tbc (default)
  30.     Metadata:
  31.       creation_time   : 2020-08-25T03:03:31.000000Z
  32.       encoder         : JVT/AVC Coding
  33. Stream mapping:
  34.   Stream #0:1 (h264) -> overlay:main (graph 0)
  35.   Stream #1:1 (h264) -> scale (graph 0)
  36.   overlay (graph 0) -> Stream #0:0 (mpeg4)
  37.   Stream #0:0 -> #0:1 (opus (native) -> aac (native))
  38.   Stream #1:0 -> #0:2 (aac (native) -> aac (native))
  39. Press [q] to stop, [?] for help
  40. Output #0, mp4, to '/www/wwwroot/oa/uploads/file/20201028/out.mp4':
  41.   Metadata:
  42.     encoder         : Lavf58.45.100
  43.     Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 392x720 [SAR 1:1 DAR 49:90], q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
  44.     Metadata:
  45.       encoder         : Lavc58.91.100 mpeg4
  46.     Side data:
  47.       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
  48.     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
  49.     Metadata:
  50.       encoder         : Lavc58.91.100 aac
  51.     Stream #0:2(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
  52.     Metadata:
  53.       creation_time   : 2020-08-25T03:03:30.000000Z
  54.       encoder         : Lavc58.91.100 aac
  55. frame=   49 fps=0.0 q=24.8 size=       0kB time=00:00:01.96 bitrate=   0.2kbits/frame=  110 fps=110 q=31.0 size=     256kB time=00:00:03.96 bitrate= 528.6kbits/frame=  167 fps=111 q=31.0 size=     256kB time=00:00:05.97 bitrate= 351.1kbits/frame=  230 fps=114 q=31.0 size=     512kB time=00:00:07.97 bitrate= 525.7kbits/frame=  288 fps=114 q=31.0 size=     512kB time=00:00:09.98 bitrate= 420.1kbits/frame=  346 fps=115 q=31.0 size=     768kB time=00:00:11.98 bitrate= 524.8kbits/frame=  407 fps=115 q=31.0 size=     768kB time=00:00:13.99 bitrate= 449.6kbits/frame=  465 fps=115 q=31.0 size=    1024kB time=00:00:16.00 bitrate= 524.3kbits/frame=  524 fps=116 q=31.0 size=    1280kB time=00:00:18.00 bitrate= 582.4kbits/frame=  589 fps=117 q=24.8 size=    1280kB time=00:00:20.01 bitrate= 524.0kbits/frame=  648 fps=117 q=31.0 size=    1536kB time=00:00:22.01 bitrate= 571.6kbits/frame=  711 fps=118 q=31.0 size=    1536kB time=00:00:24.02 bitrate= 523.8kbits/frame=  753 fps=115 q=31.0 size=    1792kB time=00:00:26.02 bitrate= 564.1kbits/frame=  787 fps=111 q=31.0 size=    1792kB time=00:00:27.02 bitrate= 543.1kbits/frame=  848 fps=112 q=31.0 size=    1792kB time=00:00:29.03 bitrate= 505.6kbits/frame=  906 fps=112 q=31.0 size=    2048kB time=00:00:31.04 bitrate= 540.5kbits/frame=  968 fps=113 q=31.0 size=    2304kB time=00:00:33.04 bitrate= 571.2kbits/frame= 1032 fps=114 q=31.0 size=    2304kB time=00:00:35.05 bitrate= 538.5kbits/frame= 1097 fps=115 q=31.0 size=    2560kB time=00:00:37.05 bitrate= 566.0kbits/frame= 1159 fps=115 q=31.0 size=    2560kB time=00:00:39.06 bitrate= 536.9kbits/frame= 1200 fps=113 q=31.0 size=    2560kB time=00:00:40.06 bitrate= 523.5kbits/frame= 1237 fps=111 q=24.8 size=    2816kB time=00:00:42.06 bitrate= 548.4kbits/frame= 1279 fps=110 q=31.0 size=    2816kB time=00:00:43.07 bitrate= 535.6kbits/frame= 1325 fps=109 q=31.0 size=    3072kB time=00:00:45.07 bitrate= 558.3kbits/frame= 1382 fps=109 q=31.0 size=    3072kB time=00:00:46.22 bitrate= 544.4kbits/frame= 1444 fps=110 q=31.0 size=    3328kB time=00:00:48.11 bitrate= 566.6kbits/frame= 1501 fps=110 q=24.8 size=    3328kB time=00:00:50.10 bitrate= 544.1kbits/frame= 1564 fps=111 q=31.0 size=    3584kB time=00:00:52.15 bitrate= 563.0kbits/frame= 1624 fps=111 q=31.0 size=    3584kB time=00:00:54.13 bitrate= 542.4kbits/frame= 1685 fps=111 q=31.0 size=    3840kB time=00:00:56.16 bitrate= 560.1kbits/frame= 1745 fps=112 q=31.0 size=    3840kB time=00:00:58.49 bitrate= 537.8kbits/[mp4 @ 0x23aab00] Starting second pass: moving the moov atom to the beginning of the file
  56. frame= 1814 fps=113 q=31.0 Lsize=    4208kB time=00:01:00.49 bitrate= 569.9kbits/s dup=311 drop=2 speed=3.77x   
  57. video:2707kB audio:1440kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.466813%
  58. [aac @ 0x247cf80] Qavg: 122.322
  59. [aac @ 0x24af840] Qavg: 474.191
复制代码
回复

使用道具 举报

发表于 2020-10-28 16:58:54 | 显示全部楼层
首先,你的ffmpeg估计目前的状态很难提升画质,需要重新安装一下,并且支持上libx264
你现在的是
  1.   configuration: --enable-shared --prefix=/usr/local/ffmpeg --disable-yasm
复制代码
不支持H.264编码器

  1. ffmpeg -i /www/wwwroot/oa/uploads/file/20201028/d7f7c44d845dc3fce6755833f7d48844.mp4 -i 1.mp4 -filter_complex "[1:v]scale=w=300:h=300:force_original_aspect_ratio=decrease[ckout];[0:v][ckout]overlay=x=main_w-overlay_w:y=main_h-overlay_h[out]" -vocdec libx264 -b:v 800k -map "[out]" -map 0:a -map 1:a -r:v 30 -movflags faststart /www/wwwroot/oa/uploads/file/20201028/out.mp4
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-10-29 08:10:05 | 显示全部楼层
孙悟空 发表于 2020-10-28 16:58
首先,你的ffmpeg估计目前的状态很难提升画质,需要重新安装一下,并且支持上libx264
你现在的是不支持H.26 ...

需要安装哪个版本呢?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-10-29 09:49:17 | 显示全部楼层
zy3287 发表于 2020-10-29 08:10
需要安装哪个版本呢?
  1. ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  2.   built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
  3.   configuration: --prefix=/usr/local/ffmpeg --enable-shared --enable-yasm --enable-libx264 --enable-gpl --enable-pthreads --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib
  4.   libavutil      56. 51.100 / 56. 51.100
  5.   libavcodec     58. 91.100 / 58. 91.100
  6.   libavformat    58. 45.100 / 58. 45.100
  7.   libavdevice    58. 10.100 / 58. 10.100
  8.   libavfilter     7. 85.100 /  7. 85.100
  9.   libswscale      5.  7.100 /  5.  7.100
  10.   libswresample   3.  7.100 /  3.  7.100
  11.   libpostproc    55.  7.100 / 55.  7.100
  12. Unrecognized option 'vocdec'.
  13. Error splitting the argument list: Option not found
复制代码
回复 支持 反对

使用道具 举报

发表于 2020-10-29 10:25:13 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-10-29 10:50:22 | 显示全部楼层

Unrecognized option 'vocdec'.
Error splitting the argument list: Option not found
回复 支持 反对

使用道具 举报

发表于 2020-10-29 10:52:36 | 显示全部楼层
zy3287 发表于 2020-10-29 10:50
Unrecognized option 'vocdec'.
Error splitting the argument list: Option not found

请仔细看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-10-29 11:14:54 | 显示全部楼层

啊啊,看到了,不好意思
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-12-27 11:59 , Processed in 0.051434 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表