我刚刚完成了在debian上安装ffmpeg,使用了这些说明-- http://trac.ffmpeg.org/wiki/UbuntuCompilationGuide。现在我想编码一个视频在我的iPod经典上播放。该视频有以下信息:
$ mediainfo in.mp4
General
Complete name : in.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 1.21 GiB
Duration : 55mn 10s
Overall bit rate mode : Variable
Overall bit rate : 3 130 Kbps
Encoded date : UTC 2010-08-25 23:38:59
Tagged date : UTC 2010-08-25 23:38:59
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.2
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 55mn 10s
Bit rate mode : Variable
Bit rate : 3 000 Kbps
Maximum bit rate : 5 000 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.109
Stream size : 1.16 GiB (96%)
Language : English
Encoded date : UTC 2010-07-21 13:28:49
Tagged date : UTC 2010-07-21 13:28:49
Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
Transfer characteristics : BT.709-5, BT.1361
Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 55mn 10s
Bit rate mode : Variable
Bit rate : 125 Kbps
Maximum bit rate : 270 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 49.4 MiB (4%)
Language : English
Encoded date : UTC 2010-07-21 13:28:49
Tagged date : UTC 2010-07-21 13:28:49
mdhd_Duration : 3310353我已经尝试过用banshee复制视频到banshee,但是视频只显示了一个黑色的屏幕。在Ipod上播放视频的最佳格式是哪一种?我应该使用哪些ffmpeg参数?我想最大限度地提高分辨率,同时最小化文件大小。
发布于 2014-04-24 16:30:56
您可能需要重新编码,因为iPod经典版可以根据您提供的规格处理高达640x480,但您的视频是1280x720。视频可以是H.264,基线配置文件,3.0级:
ffmpeg -i in.mp4 -vcodec libx264 -crf 23 -preset fast -profile:v baseline \
-level 3 -refs 6 -vf "scale=640:-1,pad=iw:480:0:(oh-ih)/2,format=yuv420p" \
-acodec copy output.mp4-crf控制质量,用-preset控制编码速度。有关这些选项的更多信息,请参见FFmpeg和x264编码指南。-level目前没有为这个编码器设置-refs,所以手动设置它。有一个挂起的修补程序来解决这个问题,所以它应该很快就会修复。-1值在高度维度中保持原来的16:9高宽比,而640值则设置新的宽度。ffmpeg试图在使用libx264时避免或尽量减少色度次采样,但是非FFmpeg的播放器和设备不支持yuv420p以外的任何东西,因此包括这将确保兼容性。这与您在其他示例中可能看到的使用-pix_fmt yuv420p相同,但使用format允许您具体说明它将应用于其他筛选器的位置(在这种情况下,这并不是说它真的太重要了)。发布于 2020-03-15 17:51:09
ffmpeg.exe -i "Video.mp4“-vcodec libx264 -preset fast -profile:v -lossless 1 -vf,setsar=1,pad=720:540:0:0”-acodec aac -ac 2 -ar 22050 -ab 48k“视频(SD).mp4
https://stackoverflow.com/questions/23260944
复制相似问题