Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th October 2020, 08:23   #1  |  Link
bjoker
Registered User
 
Join Date: Jan 2013
Posts: 50
ffmpeg CLI syntax for encoding DVD Remux please

Hi,

Source NTSC DVD Remux - specs: ( Mediainfo = https://pastebin.com/dRTLVWFC )
1) It has 720 x 480 resolution.
2) PAR should be 40/33 - tried to pass "--sar 40:33" to x264
3) cropping should be Crop(2,50,-0,-42) so used filter:v "crop=718:390:2:50"
4) De-interlacing needs to be done so used -vf yadif as one of 5 frames is duplicate.

so tried - (to encode first 10 min)
Code:
Z:\>ffmpeg -y -i "ABCD_Source.mkv" -ss 0 -t 600 -filter:v "crop=718:390:2:50" -vf yadif -vcodec libx264 -preset placebo -crf 16 -refs 16 -sar "40:33" -x264-params  "me=umh:subme=11:bframes=16:deblock=-3,-3:no-dct-decimate=1:rc-lookahead=100:me_range=48:keyint_min=23" -acodec copy  ABCD_ffm2.mkv
But it throws the below error:
Code:
[matroska @ 00000199d16f1e80] Aspect ratio mismatch between muxer (186/157) and encoder layer (40/33)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!
Then I tried without "-sar 40:33" , it encodes but with wrong o/p resolution 720:480. Expected is 718x390 with display size 870x390 as 718*(40/33)=870.30.

Please advise correct ffmpeg command with deinterlacing, cropping and SAR/PAR/DAR parameter for a DVD remux source. It would be good to include Color matrix

Thanks!
bjoker is offline   Reply With Quote
Old 9th October 2020, 18:23   #2  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Hi,

first of all your post is in the wrong thread. You are converting to AVC (H.264), so the post belongs in the MPEG4-AVC thread. Can a mod please move it...

Not being an FFMpeg specialist I usually let an encoder GUI do all the aspect ratio math. For FFmpeg I use dmMediaConverter, and for a source like yours it created this command line:
Quote:
ffmpeg.exe -fflags +genpts -y -i "I:\My.mkv" -map 0:0 -filter:v:0 "yadif,crop=718:388:2:50,scale=718:-2" -c:v:0 libx264 -preset:v:0 medium -tune:v:0 film -profile:v:0 high -level:v:0 4.1 -crf:v:0 18 -map 0:1 -c:a:0 copy "I:\My converted.mkv"
Please note that the crop filter needs to be follwed by the scale filter, and specifying SAR/PAR/DAR parameters is not needed. Since you are converting from SD to SD the ColorMatrix filter is also not needed.
Hope it helps...

Cheers
manolito

Last edited by manolito; 9th October 2020 at 18:38.
manolito is offline   Reply With Quote
Old 10th October 2020, 01:19   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by bjoker View Post
4) De-interlacing needs to be done so used -vf yadif as one of 5 frames is duplicate.
That comment suggests it needs to be inverse telecined . Fieldmatched, decimated, to return 23.976. If it's a "movie" or film, this is likely the case

Code:
-vf "fps=30000/1001,fieldmatch,yadif=deint=interlaced,decimate"
poisondeathray is offline   Reply With Quote
Old 10th October 2020, 14:18   #4  |  Link
bjoker
Registered User
 
Join Date: Jan 2013
Posts: 50
Thanks manolito & poisondeathray , will try them.
bjoker is offline   Reply With Quote
Old 2nd February 2021, 14:33   #5  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
bwdif is better than yadif and fast.
kolak is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.