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

How can I rewrite pts? #196

Open
AalisaM opened this issue Apr 11, 2019 · 2 comments
Open

How can I rewrite pts? #196

AalisaM opened this issue Apr 11, 2019 · 2 comments
Labels

Comments

@AalisaM
Copy link

AalisaM commented Apr 11, 2019

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

bramp commented Apr 11, 2019

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

AalisaM commented Apr 12, 2019

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

  • ffmpeg -i source.mp4 -map 0:v -vcodec copy -bsf:v h264_mp4toannexb source-video.h264
  • ffmpeg -fflags +genpts -r 60 -i source-video.h264 -vcodec copy output.mp4

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants