bramp / ffmpeg-cli-wrapper

Java wrapper around the FFmpeg command line tool
BSD 2-Clause "Simplified" License
1.73k stars 413 forks source link

How can I rewrite pts? #196

Open AalisaM opened 5 years ago

AalisaM commented 5 years ago

Hello, I'm new to ffmpeg and I have a silly question. I need to read mp4 video and rewrite frames pts data. Is there any way to achieve it with your lib?

I came with one solution, but it's not good: I may read frames, save it as png and then write a new mp4 from my png with any settings I want. Is there another way, which is more elegant?

bramp commented 5 years ago

This library just wraps the ffmpeg command line. If the command line can do it, then this library can.

There seems to be a few solutions on Google when u search for this problem: https://superuser.com/questions/1159056/ffmpeg-recreate-timestamps-without-reencoding https://gist.github.com/mukunm/5c338a375585c12a3679ccc4d85276d5

Once you find a set of command line args that work for you, I can suggest how to use the library.

AalisaM commented 5 years ago

@bramp , Thank you, I've came to one of your solutions, which is

Could you please give me a hint how to use your wrapper for these two commands?