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 could I produce a fragmented mp4? #79

Closed
MaxPleaner opened this issue Jul 1, 2016 · 2 comments
Closed

How could I produce a fragmented mp4? #79

MaxPleaner opened this issue Jul 1, 2016 · 2 comments

Comments

@MaxPleaner
Copy link

MaxPleaner commented Jul 1, 2016

I've found that I can use the headless gem to create an mp4 like so:

  headless = Headless.new(video: {frame_rate: 12, codec: 'libx264'})
  headless.start
  headess.video.start_capture
  headless.stop_and_save("test.mp4")

And the mp4 file produces is playable.

How could I make this a fragmented mp4?

The readme shows that the following options are supported for the videos hash in Headless.new's options, but I'm not sure how to set them up:

:codec - codec to be used by ffmpeg
:frame_rate - frame rate of video capture
:provider - ffmpeg provider - either :libav (default) or :ffmpeg
:provider_binary_path - Explicit path to avconv or ffmpeg. Only required when the binary cannot be discovered on the system $PATH.
:pid_file_path - path to ffmpeg pid file, default: "/tmp/.headless_ffmpeg_#{@display}.pid"
:tmp_file_path - path to tmp video file, default: "/tmp/.headless_ffmpeg_#{@display}.mov"
:log_file_path - ffmpeg log file, default: "/dev/null"
:extra - array of extra ffmpeg options, default: []

The reason I want to make a fragmented mp4 is that it's streamable.

@leonid-shevtsov
Copy link
Owner

This isn't really a Headless issue, you can pass any additional options to ffmpeg through :extra, and a quick googling reveals the options you need for a fragmented mp4.

@MaxPleaner
Copy link
Author

Well anyway thanks for your help
On Jul 2, 2016 12:56 AM, "Leonid Shevtsov" notifications@github.com wrote:

This isn't really a Headless issue, you can pass any additional options to
ffmpeg through :extra, and a quick googling reveals the options you need
for a fragmented mp4
http://stackoverflow.com/questions/8616855/how-to-output-fragmented-mp4-with-ffmpeg#9734251
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#79 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEzWx2ldLN0qxfBI1WHnHBLqY_Xtaip6ks5qRhmNgaJpZM4JDiDg
.

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

2 participants