官方的亚当项目 https://assetstore.unity.com/packages/templates/film-sample-project-130415
使用了timeline PostProcessingV2 和recorder
可以在运行状态下手动录制, 可以在timeline中录制。

亚当项目使用的是在timeline中录制。可以将导出图片,然后在后期软件中制作movie,也可以直接制作mp4 或 webm。 运行一遍场景后就导出了影片或图片。

使用ffmpeg 合成影片 命令行如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
PS D:\GITHOME\New Unity Project (4)\Recordings> ffmpeg -r 24 -i 'image_%4d.jpg' -c:v libx264 -vf fps=60 -pix_fmt yuv420p out.mp4 ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.2.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 Input #0, image2, from 'image_%4d.jpg': Duration: 00:00:15.40, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1170x890 [SAR 1:1 DAR 117:89], 25 fps, 25 tbr, 25 tbn, 25 tbc File 'out.mp4' already exists. Overwrite ? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Press [q] to stop, [?] for help [swscaler @ 00000281e23263a0] deprecated pixel format used, make sure you did set range correctly [libx264 @ 00000281e023aa20] using SAR=1/1 [libx264 @ 00000281e023aa20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 00000281e023aa20] profile High, level 4.2 [libx264 @ 00000281e023aa20] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'out.mp4': Metadata: encoder : Lavf57.83.100 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1170x890 [SAR 1:1 DAR 117:89], q=-1--1, 60 fps, 15360 tbn, 60 tbc Metadata: encoder : Lavc57.107.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1 frame= 963 fps=118 q=-1.0 Lsize= 4228kB time=00:00:16.00 bitrate=2164.8kbits/s speed=1.96x video:4216kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.288756% [libx264 @ 00000281e023aa20] frame I:6 Avg QP:21.51 size: 45020 [libx264 @ 00000281e023aa20] frame P:243 Avg QP:24.94 size: 13276 [libx264 @ 00000281e023aa20] frame B:714 Avg QP:26.75 size: 1149 [libx264 @ 00000281e023aa20] consecutive B-frames: 0.9% 0.6% 0.0% 98.4% [libx264 @ 00000281e023aa20] mb I I16..4: 16.3% 81.8% 1.9% [libx264 @ 00000281e023aa20] mb P I16..4: 6.1% 12.6% 0.3% P16..4: 33.7% 8.0% 3.4% 0.0% 0.0% skip:35.9% [libx264 @ 00000281e023aa20] mb B I16..4: 0.2% 0.4% 0.0% B16..8: 14.2% 0.6% 0.1% direct: 0.4% skip:84.1% L0:43.2% L1:52.8% BI: 4.0% [libx264 @ 00000281e023aa20] 8x8 transform intra:67.7% inter:85.1% [libx264 @ 00000281e023aa20] coded y,uvDC,uvAC intra: 34.3% 32.2% 4.3% inter: 4.4% 4.4% 0.1% [libx264 @ 00000281e023aa20] i16 v,h,dc,p: 20% 53% 4% 23% [libx264 @ 00000281e023aa20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 27% 30% 2% 3% 3% 3% 3% 2% [libx264 @ 00000281e023aa20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 24% 14% 4% 7% 8% 7% 5% 3% [libx264 @ 00000281e023aa20] i8c dc,h,v,p: 60% 20% 18% 2% [libx264 @ 00000281e023aa20] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 00000281e023aa20] ref P L0: 61.3% 22.4% 13.5% 2.9% [libx264 @ 00000281e023aa20] ref B L0: 92.2% 6.2% 1.6% [libx264 @ 00000281e023aa20] ref B L1: 98.5% 1.5% [libx264 @ 00000281e023aa20] kb/s:2151.50 |
下方movie是unity导出的,out.mp4 是ffmpeg导出的

转载请注明:veyvin » FilmSample 导出影片