Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
VegethB opened this issue Dec 8, 2020 · 1 comment

Comments

@VegethB
Copy link

VegethB commented Dec 8, 2020

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
Copy link
Author

VegethB commented Dec 8, 2020

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"

@VegethB VegethB closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant