Repository navigation
AV1 muxer #125
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
Merged
Merged
AV1 muxer #125
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
93f4309
Support AV1 in Muxer
maslowalex c3a29aa
added membrane_av1_format library
maslowalex 0f6f9fe
removed redundant deps
maslowalex 54d6e3d
fix: reverted unrelated changes, refactored code, use the membrane_av…
maslowalex bfce5a4
fix: addressed the PR comments
maslowalex 35a0e8e
chore: bump membrane_av1_format to 0.3.1
maslowalex 0e1c23e
chore: addressed naming suggestions and fixed credo
maslowalex 883273f
test: added muxer test
maslowalex f9b5e70
Satisfy credo and compiler
Noarkhh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,7 +24,8 @@ defmodule Membrane.MP4.Muxer.ISOM do | |||||||||
| stream_structure: {_hevc, _dcr}, | ||||||||||
| alignment: :au | ||||||||||
| }, | ||||||||||
| %Membrane.Opus{self_delimiting?: false} | ||||||||||
| %Membrane.Opus{self_delimiting?: false}, | ||||||||||
| %Membrane.AV1{alignment: :tu} | ||||||||||
| ), | ||||||||||
| availability: :on_request | ||||||||||
|
|
||||||||||
|
|
@@ -188,6 +189,15 @@ defmodule Membrane.MP4.Muxer.ISOM do | |||||||||
| # decoding deltas, and so is the implementation of sample table in this plugin. | ||||||||||
| buffer = %{buffer | dts: Buffer.get_dts_or_pts(buffer)} | ||||||||||
|
|
||||||||||
| # For AV1 tracks, strip temporal delimiter OBUs from the payload | ||||||||||
| track = get_in(state, [:pad_to_track, pad_ref]) | ||||||||||
|
|
||||||||||
| buffer = | ||||||||||
| case track.stream_format do | ||||||||||
| %Membrane.AV1{} -> %Buffer{buffer | payload: strip_temporal_delimiter(buffer.payload)} | ||||||||||
| _other -> buffer | ||||||||||
| end | ||||||||||
|
|
||||||||||
| state | ||||||||||
| |> update_in([:pad_to_track, pad_ref], &Track.store_sample(&1, buffer)) | ||||||||||
| |> maybe_flush_chunk(pad_ref) | ||||||||||
|
|
@@ -286,4 +296,9 @@ defmodule Membrane.MP4.Muxer.ISOM do | |||||||||
| defp shift_left([]), do: [] | ||||||||||
|
|
||||||||||
| defp shift_left([first | rest]), do: rest ++ [first] | ||||||||||
|
|
||||||||||
| # Strip temporal delimiter OBUs from AV1 payload | ||||||||||
| # Temporal delimiter OBU: header=0x12 (type=2, has_size=1), size=0x00 | ||||||||||
| defp strip_temporal_delimiter(<<0x12, 0x00, rest::binary>>), do: strip_temporal_delimiter(rest) | ||||||||||
| defp strip_temporal_delimiter(payload), do: payload | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| end | ||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.