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

MP4 support for HTTP push. #1429

Merged
merged 8 commits into from
Apr 9, 2020
Merged

MP4 support for HTTP push. #1429

merged 8 commits into from
Apr 9, 2020

Conversation

j0sh
Copy link
Contributor

@j0sh j0sh commented Mar 20, 2020

What does this pull request do? Explain your changes. (required)

This implements most of #1418 . The exception is that it does not implement output configuration via webhook. The output can be set to MP4 via the HTTP push file extension. This can be quickly tested on the broadcaster via:

ffmpeg -re -i input -c:a copy -c:v copy -f hls -hls_segment_filename "http://localhost:8935/live/mp4/%d.mp4" -

and the results inspected via curl the resulting playlist(s) at http:localhost:8935/live/mp4.m3u8 . ffplay of individual segments will work as well.

Specific updates (required)

  • server: Take MP4s as input for HTTP push …
    Most of the changes are in the following areas:

    • Adds a format -> extension lookup function
    • Adds a extension -> format inverse lookup function
    • Adds a format -> mime type lookup function
    • Protocol Buffers changes, and conversions to/from VideoProfile
    • Slotting in the lookups and error handling where appropriate
    • Lots and lots of tests.

The extensive testing and strict error handling is both to codify
intended behavior and to ensure misuse resistance to further changes. 949a063

How did you test each of these updates (required)

  • Unit testing. Tests are the bulk of the additions here.
  • Manual testing / playback with the following simple scenarios (B -> OT, local storage on both, played back via ffplay):
    • RTMP
    • ffmpeg HLS push (with mpegts)
    • ffmpeg HLS push (with mp4, as described above)
    • Standalone T with MP4 and mpegts
  • Visual inspection of multipart hexdump (but did not attempt to parse + extract)
  • Checked with GCS to verify file extension and content type

Does this pull request close any open issues?

Fixes #1418

Checklist:

  • README and other documentation updated
  • Node runs in OSX and devenv
  • All tests in ./test.sh pass

@j0sh j0sh mentioned this pull request Mar 26, 2020
@j0sh j0sh changed the base branch from master to ja/misc March 30, 2020 07:32
@j0sh j0sh changed the title WIP: MP4 support for HTTP push. MP4 support for HTTP push. Mar 30, 2020
@j0sh j0sh marked this pull request as ready for review March 30, 2020 08:48
Copy link
Contributor

@darkdarkdragon darkdarkdragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mp4 muxer/demuxer should be added to install_ffmpeg.sh

@j0sh j0sh changed the base branch from ja/misc to master March 31, 2020 19:51
@j0sh
Copy link
Contributor Author

j0sh commented Mar 31, 2020

@darkdarkdragon Ah yes.

Added a unit test that will iterate through all our formats, to catch this type of oversight in the future: 8abe8ab . That failed exactly as expected.

Added mp4 to the muxer/demuxer and tests pass now. 06b8783

@j0sh
Copy link
Contributor Author

j0sh commented Apr 2, 2020

Rebased to fix up a merge conflict. Git SHAs have changed but commit structure is otherwise the same in case someone was in the middle of reviewing things (eg, still contains the pending fixups from #1429 (comment))

@j0sh
Copy link
Contributor Author

j0sh commented Apr 6, 2020

2c075d9 Updated to incorporate latest LPMS, including the libavfilter performance fix and MP4 support among other things:

livepeer/lpms#176
livepeer/lpms#177
livepeer/lpms#178
livepeer/lpms#179

Copy link
Contributor

@darkdarkdragon darkdarkdragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left one note about a comment about a possible bug in existing code. I'll leave it up to you whether to address it in this PR or separately (I noted that I'm fine with doing it separately).

server/segment_rpc.go Show resolved Hide resolved
j0sh added 8 commits April 8, 2020 21:45
Most of the changes are in the following areas:

* Adds a format -> extension lookup function
* Adds a extension -> format inverse lookup function
* Adds a format -> mime type lookup function
* Protocol Buffers changes, and conversions to/from VideoProfile
* Slotting in the lookups and error handling where appropriate
* Lots and lots of tests.

The extensive testing and strict error handling is both to codify
intended behavior and to ensure misuse resistance to further changes.
The extension doesn't matter, and may no longer be mpegts.
This allows us to fail out quickly on orchestrators that do not
recognize the FullProfile field.
Only use this field for non-mpegts profiles in order to maintain
compatibility with older orchestrators. If an older orchestrator
receives a request for non-mpegts transcoding, it will fail out.
@j0sh j0sh merged commit 4ba2a73 into master Apr 9, 2020
@j0sh j0sh deleted the ja/mp4 branch April 9, 2020 05:39
@j0sh j0sh mentioned this pull request Apr 27, 2020
3 tasks
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

Successfully merging this pull request may close these issues.

MP4 Support
3 participants