赞
踩
ffmpeg mp4 mp3 pcm flac转换
ffmpeg mp4转yuv
zhihu
ffmpeg m4a 转pcm_详细介绍ffmpeg基础命令(2)
使用 ffmpeg 实现 MP4 与 GIF 的互转
使用ffmpeg来将mp4视频转换成gif格式图片
用 ffmpeg 压缩视频
ffmpeg -i a.mp4 -f MP3 a1.mp3
ffmpeg -i a.mp4 -f flac -acodec flac -ac 1 -ar 16000 a.flac
这个方法可以转换成功,但是比较耗时
ffmpeg -i out.mp4 out.gif
ffmpeg -y -i “F:\mp3\11.mp3” -f flac -acodec flac -ac 1 -ar 16000 “F:\flac\11.flac”
ffmpeg -y -i a.mp3 -acodec pcm_s16le -f s16le -ac 1 -ar 16000 a.pcm
ffmpeg -i buweisui.mp3 -ar 48000 -ac 2 -f s16le 48000_2_s16le.pcm
ffmpeg -i buweisui.mp3 -ar 48000 -ac 2 -sample fmt s16 out s16.wav
ffmpeg -i buweisui.mp3 -ar 48000 -ac 2 -codec:a pcm s16le out2 s16le.wav
ffmpeg -i buweisui.mp3 -ar 48000 -ac 2 f32le 48000_2_f32le.pcm
ffmpeg -i test.mp4 test.yuv
ffmpeg -i 720.mp4 -pix_fmt yuv420p -s 424x240 out.yuv
ffplay.exe -f rawvideo -video_size 1280x720 -i test.yuv
ffplay -f rawvideo -video_size 1920x1080 -i v1080.yuv
ffmpeg -i xxx.mp4
ffprobe -select_streams v -show_entries format=duration,size,bit_rate,filename -show_streams -v quiet -of csv=“p=0” -of json -i v1080.mp4
{ "streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_time_base": "1/50", "codec_tag_string": "avc1", "codec_tag": "0x31637661", "width": 1920, "height": 1080, "coded_width": 1920, "coded_height": 1088, "closed_captions": 0, "has_b_frames": 2, "sample_aspect_ratio": "1:1", "display_aspect_ratio": "16:9", "pix_fmt": "yuv420p", "level": 40, "chroma_location": "left", "refs": 1, "is_avc": "true", "nal_length_size": "4", "r_frame_rate": "25/1", "avg_frame_rate": "25/1", "time_base": "1/12800", "start_pts": 0, "start_time": "0.000000", "duration_ts": 768000, "duration": "60.000000", "bit_rate": "1928685", "bits_per_raw_sample": "8", "nb_frames": "1500", "disposition": { "default": 1, "dub": 0, "original": 0, "comment": 0, "lyrics": 0, "karaoke": 0, "forced": 0, "hearing_impaired": 0, "visual_impaired": 0, "clean_effects": 0, "attached_pic": 0, "timed_thumbnails": 0 }, "tags": { "language": "eng", "handler_name": "VideoHandler" } } ], "format": { "filename": "v1080.mp4", "duration": "60.024000", "size": "15486233", "bit_rate": "2064005" } }
ffmpeg -i test.mp4 -t 3 -pix_fmt yuv420p yuv420p_orig.yuv
ffmpeg -i test.mp4 -t 3 -pix_fmt yuv420p -s 320x240 yuv420p_320x240.yuv
ffmpeg -i test.mp4 -t 3 -pix_fmt rgb24 -s 320x240 rgb24_320x240.rgb
ffmpeg -s 320x240 -pix_fmt yuv420p -i yuv420p_320x420.yuv -pix_fmt rgb24 rgb24_320x240_2.rgb
ffplay -pixel_format yuv420p -video_size 320x240 -framerate 5 yuv420p_320x420.yuv
ffplay -pixel_format rgb24 -video_size 1920x1080 -i v1080.rgb
ffplay -pixel_format rgb24 -video_size 320x240 -framerate 5 -i rgb24_320x240.rgb
ffplay -ar 48000 -ac 2 -f f32le 48000_2_f32le.pcm
-ar set audio sampling rate(int Hz)(from 0 to INT_MAX)(default 0)
-ac set number of audio channels (from 0 to INT_MAX)(default 0)
ffplay -ar 16000 -channels 1 -f s16le -i v1080.pcm
ffmpeg -i xxx.mp4 -codec copy -f flv out.flv
ffmpeg -i xxx.mp4 -codec copy -ss 10 -t 20 -f flv out.flv
ffmpeg -encodeers | findstr mp3
ffmpeg pi xxx.mp4 -b:a 192k -ar 48000 -ac 2 -acodec libmp3lane out.mp3
ffprobe out.mp3
ffmpeg -i xxx.mp4 -b:a 192k -ar 48000 -ac 2 -acodec libmp3lane -aframes 200 out2.mp3
ffmpeg -encoders | findstr h265
-aspect:是指在显示的时候,做拉伸,并不是所编码的时候。16:9指的是纵横比(主要是显示拉伸比例),与分辨率是不同概念。
ffmpeg -i xxx.mp4 -vframes 300 -b:v 300k -r 30 -s 640x480 -aspect 16:9 -vcodec libx265 out.h265
ffmpeg -i xxx.mp4 -vcodec copy -an video.mp4
ffmpeg -i test.mp4 -acodc copy -vn audio.mp4
ffmpeg -i test.mp4 -vcodec copy -an test_copy.h264
ffmpeg -i test.mp4 -vcodec libx264 -an test.h264
ffmpeg -i test_1280x720.mp4 -t 3 -pix_fmt yuv420p yuv420p_test.yuv
ffmpeg -i test_1280x720.mp4 -t 3 -pix_fmt yuv420p -s 320x240 yuv420p_320x240_test.yuv
ffmpeg -i test.mp4 -t 3 -pix_fmt rgb24 -s 320x240 rgb24_320x240.rgb
ffmpeg -s 320x240 -pix_fmt yuv420p -i yuv420p_320x240.yuv -pix_fmt rgb24 rgb24_320x240_2.rgb
-f 就是设置音频输出格式,pcm是纯裸音频数据。wav是有个头数据,不同的地方只有头部,对比如下图:
ffmpeg -i xxx.mp3 -ar 48000 -ac 2 -f s16le 48000_2_s16le.pcm
ffmpeg -i xxx.mp3 -ar 48000 -ac 2 -sample_fmt s16 out_s16.wav
ffmpeg -i xxx.mp3 -ar 48000 -ac 2 -codec:a pcm_s16le out2_s16le.wav
ffmpeg -i xxx.mp3 -ar 48000 -ac 2 -f f32le 48000_2_f32le.pcm
ffmpeg -i xxx.mp4 -t 10 -vn -ar 48000 -ac 2 -f f32le 48000_2_f32le_2.pcm
ffprobe -i your_mp3_file.mp3 -show_entries format=duration -v quiet -of csv=p=0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。