用ffmpeg解交錯deinterlace將1080i影片轉成1080p影片
From: https://video.stackexchange.com/questions/17396/how-to-deinterlacing-with-ffmpeg
查看有哪些deinterlace可用
ffmpeg -filters | grep -i deinterlace
TS. bwdif V->V Deinterlace the input image.
T.. nnedi V->V Apply neural network edge directed interpolation intra-only deinterlacer.
TS. w3fdif V->V Apply Martin Weston three field deinterlace.
TS. yadif V->V Deinterlace the input image.
https://ffmpeg.org/ffmpeg-all.html#nnedi
這裡使用比較快速的yadif算法進行解交錯deinterlace
ffmpeg -i interlace.ts -vf yadif -c:v libx264 -preset slow -crf 19 -c:a copy deinterlaced.ts
-crf就類似量化參數QP, 數值愈低畫面品質愈高, 數值愈高畫面品質愈低
如果要順便改畫面幀率frame rate(fps)可加上-r
https://ffmpeg.org/ffmpeg-utils.html#Video-rate
-r格式是frame_rate_num/frame_rate_den
一些常用的-r參數:
- 50/1
- pal=25/1
- film=24/1
- 60000/1001=59.94
- ntsc=30000/1001=29.97
- 24000/1001=23.97
https://trac.ffmpeg.org/wiki/Encode/H.264
或是Mobile01的x264 - 高品質 H.264 編碼器
https://www.mobile01.com/topicdetail.php?f=510&t=3735840
留言