TypesettingTools / Aegisub-Motion

Lua plugin for Aegisub auto4 that parses motion tracking data and applies it to selected subtitles.
Other
172 stars 23 forks source link

FFMpeg custom command (mp4 output) don't work with mocha (black white frames) #54

Closed VegethB closed 3 years ago

VegethB commented 3 years ago

the default command generates too low quality .jpg and gives problems if you do a 1 minute trim (since prefix doesn't work).

So I searched for a commando for ffmpeg and found 2:

"#{encbin}" -ss #{startt} -sn -an -i "#{inpath}\#{input}" -vframes #{lenf} -c:v libx264 -r 24000/1001 "#{prefix}/#{output}[#{startf}-#{endf}].mp4" from #45

"#{encbin}" -ss #{startt} -sn -an -i "#{inpath}/#{input}" -to #{endt} -copyts -map 0:v "#{prefix}/#{output}[#{startt}-#{endt}].mp4"

both do the trim ... Except that when opened on mocha the frames are all black or white. If you open the file on mediainfo under duration (in general): For the first command it is the duration of the source video file (ex, 1 hour instead of 2 seconds); For the second command it is the duration in the -to parameter (ex, 44minutes and 21seconds instead of 2seconds);

First Command: image image

Second Command: image image

I don't understand how to fix

VegethB commented 3 years ago

Fix, add -pix_fmt yuv420p after -crf 4 it seems that quicktime needs forced "4: 2: 0" or from the above problems.

Final Command: "#{encbin}" -ss #{startt} -sn -an -i "#{inpath}\#{input}" -vframes #{lenf} -c:v libx264 -r 24000/1001 -crf 4 -pix_fmt yuv420p "#{prefix}/#{output}[#{startf}-#{endf}].mp4"