音视频文件音视频流抽取
1.FFmpeg抽取音视频文件中的AAC音频流
ffmpeg -i 222.mp4 -vn -acodec copy output.aac
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '222.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.19.100
Duration: 00:00:30.32, start: 0.000000, bitrate: 397 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x208 [SAR 16:15 DAR 32:13], 261 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, adts, to 'output.aac':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 483kB time=00:00:30.26 bitrate= 130.7kbits/s speed=2.73e+03x
video:0kB audio:474kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.884156%
2.FFmpeg抽取音视频文件中的H.264视频流
ffmpeg -i 222.mp4 -vcodec copy -an output.h264
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '222.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.19.100
Duration: 00:00:30.32, start: 0.000000, bitrate: 397 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x208 [SAR 16:15 DAR 32:13], 261 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, h264, to 'output.h264':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x208 [SAR 16:15 DAR 32:13], q=2-31, 261 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 756 fps=0.0 q=-1.0 Lsize= 965kB time=00:00:30.16 bitrate= 262.2kbits/s speed=4.48e+03x
video:965kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.056580%
3.FFmpeg抽取音视频文件中的H.265视频流
ffmpeg -i 222.mp4 -vcodec copy -an -bsf hevc_mp4toannexb -f hevc output.hevc
网友评论