我正在尝试使用 ffmpeg 将 mp4 文件中的 converart/thumbnail 添加到 3gp 文件中:
$ ffmpeg -hide_banner -i toto.mp4 -map 0 -map -0:v:0 -c:s copy -c:v:1 png -vf:v:1 scale=704x576 -q:v:1 10 -r:v 1 -ar:a 16000 -c:a libvo_amrwbenc -b:a 12.65k -ac:a 1 toto.3gp -y
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x6da7d80] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'toto.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Joseph Prince - The Prayer That Repairs Your Body
date : 20170910
synopsis : Description
encoder : Lavf58.29.100
Duration: 00:21:41.87, start: 0.000000, bitrate: 386 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 247 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : English
Stream #0:3(fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : French
Stream #0:4(spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : Spanish
Stream #0:5(deu): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : German
Stream #0:6: Video: png, rgb24(pc), 640x480, 90k tbr, 90k tbn, 90k tbc (attached pic)
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> amr_wb (libvo_amrwbenc))
Stream #0:2 -> #0:1 (copy)
Stream #0:3 -> #0:2 (copy)
Stream #0:4 -> #0:3 (copy)
Stream #0:5 -> #0:4 (copy)
Stream #0:6 -> #0:5 (png (native) -> h263 (native))
Press [q] to stop, [?] for help
[3gp @ 0x6f6ec40] Could not find tag for codec h263 in stream #5, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!
$
3GP 或 3GP2 是否支持添加转换/缩略图?
如果是的话怎么做 ffmpeg ?
EDIT0:mp4art
从v2.0.0 开始mp4v2-utils
。似乎能够做到:
1.Converting toto.mp4
to toto.3gp
without thecoverart/thumbnail with ffmpeg
:
$ time command ffmpeg -hide_banner -i toto.mp4 -map 0 -map -0:v -c:s copy -ar:a 16000 -c:a libvo_amrwbenc -b:a 12.65k -ac:a 1 toto.3gp -y
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5949d40] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'toto.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Joseph Prince - The Prayer That Repairs Your Body
date : 20170910
synopsis : Description
encoder : Lavf58.29.100
Duration: 00:21:41.87, start: 0.000000, bitrate: 386 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 247 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : English
Stream #0:3(fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : French
Stream #0:4(spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : Spanish
Stream #0:5(deu): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : German
Stream #0:6: Video: png, rgb24(pc), 640x480, 90k tbr, 90k tbn, 90k tbc (attached pic)
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> amr_wb (libvo_amrwbenc))
Stream #0:2 -> #0:1 (copy)
Stream #0:3 -> #0:2 (copy)
Stream #0:4 -> #0:3 (copy)
Stream #0:5 -> #0:4 (copy)
Press [q] to stop, [?] for help
Output #0, 3gp, to 'toto.3gp':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Joseph Prince - The Prayer That Repairs Your Body
date : 20170910
synopsis : Description
encoder : Lavf58.76.100
Stream #0:0(und): Audio: amr_wb (sawb / 0x62776173), 16000 Hz, mono, s16, 12 kb/s (default)
Metadata:
handler_name : ISO Media file produced by Google Inc.
vendor_id : [0][0][0][0]
encoder : Lavc58.134.100 libvo_amrwbenc
Stream #0:1(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
handler_name : English
Stream #0:2(fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : French
Stream #0:3(spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : Spanish
Stream #0:4(deu): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Metadata:
handler_name : German
size= 2401kB time=00:21:36.79 bitrate= 15.2kbits/s speed=20.8x
video:0kB audio:2090kB subtitle:234kB other streams:0kB global headers:0kB muxing overhead: 3.322898%
real 1m2.414s
user 1m1.499s
sys 0m0.276s
$
mp4art
2.使用 v2.0.0 将封面/缩略图添加到toto.3g mp4v2-utils
。:
$ mp4art --overwrite --add toto.png toto.3gp
adding toto.png -> toto.3gp
$ ffprobe -hide_banner toto.3gp 2>&1 | egrep "Input|Duration:|Stream .*:"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'toto.3gp':
Duration: 00:21:43.75, start: 0.000000, bitrate: 16 kb/s
Stream #0:0(und): Audio: amr_wb (sawb / 0x62776173), 16000 Hz, mono, flt, 13 kb/s (default)
Stream #0:1(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Stream #0:2(fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Stream #0:3(spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Stream #0:4(deu): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
Stream #0:5: Video: png, rgb24(pc), 640x480, 90k tbr, 90k tbn, 90k tbc (attached pic)