我有一系列以纵向模式拍摄的照片,分辨率为 480x800。我使用 ffmpeg 命令制作了视频ffmpeg -r 1 -y -i image%d.jpeg out.mp4
,并以横向模式获取视频,分辨率为 480x800 和 4:3,因此视频的图像横向拉伸。如何使视频不拉伸并且侧面呈黑色条纹?
日志
ffmpeg version N-56554-ge07ac72 Copyright (c) 2000-2013 the FFmpeg developers
built on Oct 23 2013 21:24:32 with gcc 4.4.3 (GCC)
ffmpeg4android: 1.1.03
libavutil 52. 45.100 / 52. 45.100
libavcodec 55. 33.100 / 55. 33.100
libavformat 55. 18.102 / 55. 18.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 86.102 / 3. 86.102
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
Splitting the commandline.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument '/sdcard/videokit/i%d.jpeg'.
Reading option '/sdcard/videokit/scr.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /sdcard/videokit/i%d.jpeg.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 1.
Successfully parsed a group of options.
Opening an input file: /sdcard/videokit/i%d.jpeg.
Statistics: 298974 bytes read, 0 seeks
marker=d8 avail_size_in_buf=298972
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=298970
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=298952
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=298883
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=298814
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=298795
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=298762
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=298579
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=298546
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 2590 bytes
marker=da avail_size_in_buf=298363
component: 0
component: 1
component: 2
marker parser used 295772 bytes (2366171 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
Statistics: 76534 bytes read, 0 seeks
Statistics: 154535 bytes read, 0 seeks
Statistics: 199474 bytes read, 0 seeks
Statistics: 200272 bytes read, 0 seeks
Statistics: 200805 bytes read, 0 seeks
Statistics: 201336 bytes read, 0 seeks
Statistics: 201897 bytes read, 0 seeks
Statistics: 201869 bytes read, 0 seeks
Statistics: 200555 bytes read, 0 seeks
Statistics: 202662 bytes read, 0 seeks
Statistics: 203348 bytes read, 0 seeks
Statistics: 203689 bytes read, 0 seeks
Statistics: 204322 bytes read, 0 seeks
Statistics: 204731 bytes read, 0 seeks
Statistics: 205169 bytes read, 0 seeks
Statistics: 205779 bytes read, 0 seeks
Statistics: 204628 bytes read, 0 seeks
Input #0, image2, from '/sdcard/videokit/i%d.jpeg':
Duration: 00:00:00.72, start: 0.000000, bitrate: N/A
Stream #0:0, 18, 1/25: Video: mjpeg, yuvj420p(pc), 480x800 [SAR 1:1 DAR 3:5], 25 fps, 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
Parsing a group of options: output file /sdcard/videokit/scr.mp4.
Successfully parsed a group of options.
Opening an output file: /sdcard/videokit/scr.mp4.
Successfully opened the file.
detected 2 logical cores
Setting 'video_size' to value '480x800'
Setting 'pix_fmt' to value '12'
Setting 'time_base' to value '1/1'
Setting 'pixel_aspect' to value '1/1'
Setting 'sws_param' to value 'flags=2'
Setting 'frame_rate' to value '1/1'
w:480 h:800 pixfmt:yuvj420p tb:1/1 fr:1/1 sar:1/1 sws_param:flags=2
Setting 'expr' to value 'N'
compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p]
Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p'
query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
TB:1.000000 FRAME_RATE:1.000000 SAMPLE_RATE:NaN
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
using SAR=1/1
using cpu capabilities: ARMv6 NEON
profile High, level 2.2
264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - 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=1 lookahead_threads=1 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=1 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 '/sdcard/videokit/scr.mp4':
Metadata:
encoder : Lavf55.18.102
Stream #0:0, 0, 1/16384: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p, 480x800 [SAR 1:1 DAR 3:5], q=-1--1, 16384 tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press [q] to stop, [?] for help
marker=d8 avail_size_in_buf=298972
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=298970
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=298952
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=298883
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=298814
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=298795
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=298762
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=298579
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=298546
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 2590 bytes
marker=da avail_size_in_buf=298363
component: 0
component: 1
component: 2
marker parser used 295772 bytes (2366171 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:0 PTS:0 T:0.000000 POS:nan INTERLACED:0 -> PTS:0 T:0.000000
marker=d8 avail_size_in_buf=76532
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=76530
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=76512
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=76443
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=76374
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=76355
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=76322
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=76139
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=76106
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 1467 bytes
marker=da avail_size_in_buf=75923
component: 0
component: 1
component: 2
marker parser used 74455 bytes (595639 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:1 PTS:1 T:1.000000 POS:nan INTERLACED:0 -> PTS:1 T:1.000000
marker=d8 avail_size_in_buf=154533
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=154531
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=154513
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=154444
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=154375
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=154356
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=154323
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=154140
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=154107
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 2539 bytes
marker=da avail_size_in_buf=153924
component: 0
component: 1
component: 2
marker parser used 151384 bytes (1211070 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:2 PTS:2 T:2.000000 POS:nan INTERLACED:0 -> PTS:2 T:2.000000
marker=d8 avail_size_in_buf=199472
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=199470
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=199452
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=199383
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=199314
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=199295
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=199262
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=199079
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=199046
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 3374 bytes
marker=da avail_size_in_buf=198863
component: 0
component: 1
component: 2
marker parser used 195488 bytes (1563900 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:3 PTS:3 T:3.000000 POS:nan INTERLACED:0 -> PTS:3 T:3.000000
marker=d8 avail_size_in_buf=200270
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=200268
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=200250
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=200181
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=200112
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=200093
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=200060
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=199877
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=199844
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 3450 bytes
marker=da avail_size_in_buf=199661
component: 0
component: 1
component: 2
marker parser used 196210 bytes (1569680 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:4 PTS:4 T:4.000000 POS:nan INTERLACED:0 -> PTS:4 T:4.000000
marker=d8 avail_size_in_buf=200803
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=200801
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=200783
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=200714
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=200645
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=200626
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=200593
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=200410
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=200377
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 3447 bytes
marker=da avail_size_in_buf=200194
component: 0
component: 1
component: 2
marker parser used 196746 bytes (1573962 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:5 PTS:5 T:5.000000 POS:nan INTERLACED:0 -> PTS:5 T:5.000000
marker=d8 avail_size_in_buf=201334
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=201332
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=201314
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=201245
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=201176
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=201157
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=201124
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=200941
class=0 index=1 nb_codes=12
.....
marker=c4 avail_size_in_buf=205600
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=205567
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=205384
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=205351
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 3602 bytes
marker=da avail_size_in_buf=205168
component: 0
component: 1
component: 2
marker parser used 201565 bytes (1612516 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:16 PTS:16 T:16.000000 POS:nan INTERLACED:0 -> PTS:16 T:16.000000
marker=d8 avail_size_in_buf=204626
marker parser used 0 bytes (0 bits)
marker=e0 avail_size_in_buf=204624
marker parser used 16 bytes (128 bits)
marker=db avail_size_in_buf=204606
index=0
qscale[0]: 0
marker parser used 67 bytes (536 bits)
marker=db avail_size_in_buf=204537
index=1
qscale[1]: 0
marker parser used 67 bytes (536 bits)
marker=c0 avail_size_in_buf=204468
sof0: picture: 480x800
component 0 2:2 id: 0 quant:0
component 1 1:1 id: 1 quant:1
component 2 1:1 id: 2 quant:1
pix fmt id 22111100
marker parser used 17 bytes (136 bits)
marker=c4 avail_size_in_buf=204449
class=0 index=0 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=204416
class=1 index=0 nb_codes=251
marker parser used 181 bytes (1448 bits)
marker=c4 avail_size_in_buf=204233
class=0 index=1 nb_codes=12
marker parser used 31 bytes (248 bits)
marker=c4 avail_size_in_buf=204200
class=1 index=1 nb_codes=251
marker parser used 181 bytes (1448 bits)
escaping removed 3751 bytes
marker=da avail_size_in_buf=204017
component: 0
component: 1
component: 2
marker parser used 200265 bytes (1602113 bits)
marker=d9 avail_size_in_buf=0
decode frame unused 0 bytes
N:17 PTS:17 T:17.000000 POS:nan INTERLACED:0 -> PTS:17 T:17.000000
frame= 18 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A
EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
frame= 0 QP=18.27 NAL=3 Slice:I Poc:0 I:1500 P:0 SKIP:0 size=79447 bytes
frame= 1 QP=17.68 NAL=2 Slice:P Poc:2 I:1442 P:3 SKIP:55 size=16738 bytes
frame= 2 QP=17.00 NAL=2 Slice:P Poc:4 I:1438 P:12 SKIP:50 size=34918 bytes
scene cut at 3 Icost:1316705 Pcost:1231427 ratio:0.0648 bias:0.1024 gop:3 (imb:1247 pmb:97)
frame= 3 QP=9.48 NAL=3 Slice:I Poc:0 I:1500 P:0 SKIP:0 size=100475 bytes
frame= 4 QP=12.94 NAL=2 Slice:P Poc:2 I:3 P:31 SKIP:1466 size=464 bytes
frame= 5 QP=16.31 NAL=2 Slice:P Poc:4 I:8 P:8 SKIP:1484 size=422 bytes
frame= 6 QP=14.33 NAL=2 Slice:P Poc:10 I:6 P:26 SKIP:1468 size=899 bytes
frame= 7 QP=17.58 NAL=2 Slice:B Poc:8 I:1 P:20 SKIP:1478 size=159 bytes
frame= 8 QP=19.96 NAL=0 Slice:B Poc:6 I:0 P:28 SKIP:1472 size=129 bytes
frame= 9 QP=14.80 NAL=2 Slice:P Poc:18 I:8 P:15 SKIP:1477 size=762 bytes
frame= 10 QP=20.28 NAL=2 Slice:B Poc:14 I:0 P:22 SKIP:1477 size=108 bytes
frame= 11 QP=18.18 NAL=0 Slice:B Poc:12 I:132 P:277 SKIP:1054 size=7450 bytes
frame= 12 QP=19.95 NAL=0 Slice:B Poc:16 I:0 P:24 SKIP:1475 size=151 bytes
frame= 13 QP=19.55 NAL=2 Slice:P Poc:26 I:10 P:10 SKIP:1480 size=952 bytes
frame= 14 QP=19.94 NAL=2 Slice:B Poc:22 I:0 P:30 SKIP:1470 size=171 bytes
frame= 15 QP=19.98 NAL=0 Slice:B Poc:20 I:0 P:26 SKIP:1474 size=138 bytes
frame= 16 QP=19.93 NAL=0 Slice:B Poc:24 I:1 P:23 SKIP:1476 size=146 bytes
frame= 17 QP=18.70 NAL=2 Slice:P Poc:28 I:159 P:260 SKIP:1081 size=7512 bytes
frame= 18 fps=4.6 q=17.0 Lsize= 247kB time=00:00:16.00 bitrate= 126.4kbits/s
video:246kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.388076%
frame I:2 Avg QP:13.87 size: 89961
frame P:8 Avg QP:16.41 size: 7833
frame B:8 Avg QP:19.48 size: 1056
consecutive B-frames: 38.9% 0.0% 16.7% 44.4%
mb I I16..4: 17.5% 26.8% 55.7%
mb P I16..4: 16.1% 1.3% 8.2% P16..4: 1.6% 1.0% 0.4% 0.0% 0.0% skip:71.3%
mb B I16..4: 0.4% 0.1% 0.7% B16..8: 2.3% 1.4% 0.3% direct: 0.1% skip:94.8% L0:53.7% L1:46.0% BI: 0.3%
8x8 transform intra:15.6% inter:40.1%
coded y,uvDC,uvAC intra: 53.6% 33.8% 27.4% inter: 0.6% 0.0% 0.0%
i16 v,h,dc,p: 65% 33% 2% 1%
i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 6% 62% 12% 4% 3% 3% 3% 2% 5%
i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 34% 13% 5% 5% 5% 5% 4% 5%
i8c dc,h,v,p: 69% 19% 10% 2%
Weighted P-Frames: Y:0.0% UV:0.0%
ref P L0: 79.9% 3.8% 14.9% 1.4%
ref B L0: 97.3% 1.5% 1.1%
ref B L1: 82.0% 18.0%
kb/s:111.57
18 frames successfully decoded, 0 decoding errors
Statistics: 34 seeks, 50 writeouts