我使用 FFmpeg 从一张持续时间为10s的图片创建视频,然后将其与另一个视频共同播放。问题是视频在播放Android的默认播放器时出现故障,但是当我使用 MX播放器时,它只显示 HW解码器模式中的故障,但不显示 SW解码器模式。我认为它由值 tbc 引起的非常高。
这是我用来从图像创建视频(名为 test3.mp4 )的命令:
ffmpeg -loop 1 -t 10 -framerate 25 -i a03.jpg -f lavfi -t 10 -i anullsrc -vf scale=720:1280,setsar=1:1 -video_track_timescale 90k -ac 1 -c:a aac -shortest -pix_fmt yuv420p -strict experimental -y test3.mp4
命令将其与视频连接:
ffmpeg -f concat -i file.txt -c copy -y out.mp4
file.txt的:
file 'test1.mp4'
file 'test3.mp4'
视频 test1.mp4 :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.46.101
Duration: 00:00:36.68, start: 0.000000, bitrate: 1512 kb/s
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 1446 kb/s, 32.32 fps, 32 tbr, 90k tbn, 7143 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 69 kb/s (default)
Metadata:
handler_name : SoundHandler
视频 test3.mp4 :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.46.101
Duration: 00:00:10.02, start: 0.000000, bitrate: 543 kb/s
Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 536 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 1 kb/s (default)
Metadata:
handler_name : SoundHandler
视频 out.mp4 :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.46.101
Duration: 00:00:46.73, start: 0.000000, bitrate: 1303 kb/s
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 1240 kb/s, 30.51 fps, 32 tbr, 90k tbn, 7143 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 54 kb/s (default)
Metadata:
handler_name : SoundHandler
有什么建议吗?非常感谢!