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

Support generating multiple videotracks and single audio from from a mp4 file using FFmpeg #19

Merged
merged 4 commits into from
Nov 14, 2024

Conversation

TilsonJoji
Copy link
Contributor

@TilsonJoji TilsonJoji commented Nov 11, 2024

Hello Mike @englishm ,

Re-opening this PR that had raised in Luke's repo , along with the code and description here.

In context to the PR in moq-js , this PR holds the changes done to ./dev/pub to enable us to create 3 video renditions for a video file that could be ingested for a single namespace via moq-pub.

I have tried to optimize FFmpeg args to help us get the best of video quality and latency and also tried to make the config parameters in the script readable, at times occasionally I have observed video artefacts at higher video quality track. Since the context is the same I added the changes in ./dev/pub , please let me know if you would like me to keep this as a separate file like ./dev/pub_multi

Script usage scenarios:

  • Scenario 1: Legacy single track

    • ./dev/pub
  • Scenario 2:

    • Multi-track , 3 video tracks and 1 audio track will be ingested into moq-pub
    • Default video quality parameters are:
      • 1920x1080:6000K:60

      • 1280x720:5000K:30

      • 640x480:4000K:25

      • ./dev/pub_multi_track

  • Scenario 3

    • With argument multi and video quality of the 3 tracks specified in arguments
      - ./dev/pub_multi_track 1920x1080:6000K:60 1280x720:5000K:30 360x480:4000K:25

All the arguments that are not in this 1920x1080:6000K:60 format will be passed to cargo

With pub_multi_track script , a realtime live video track stream will be simulated and the video will be watermarked/overlayed with real-time UTC clock from the server on the top left corner that can be visually compared with https://time.is/UTC to check real-time latency and the videoresolition-bitrate will be watermarked/overlayed at the bottom right corner to assist in visually identifying the track.

[Outdated para.] ./dev/pub script had an "$@" as the last argument to moq-pub , which passes all the arguments to the script to moq-pub , had to remove it to incorporate the current implementation and legacy flow works without it, to my understanding moq-pub usage is moq-pub --name , so we can safely remove "$@" . Kindly advise if I overlooked this.

Kindly review and let me know your thoughts and amendments to be done.

@TilsonJoji
Copy link
Contributor Author

UT

trackswap-UT-draft05.mp4

@TilsonJoji TilsonJoji marked this pull request as ready for review November 11, 2024 13:55
@englishm
Copy link
Owner

Thank you, @TilsonJoji!

As for the dev/pub script, I do think it would be best to leave the current script as-is and supporting $@ and have a separate script for this new multi-track mode for now. We could always roll it back in to the main script again later, but I know that I often make use of the $@ to pass in additional arguments, and others may, too.

* committosupport-generatingMultipleVideotracksFromaSinglefileusingFFmpeg-newpubscript

* committosupport-generatingMultipleVideotracksFromaSinglefileusingFFmpeg-newpubscript2
@TilsonJoji
Copy link
Contributor Author

TilsonJoji commented Nov 11, 2024

Thank you, @TilsonJoji!

As for the dev/pub script, I do think it would be best to leave the current script as-is and supporting $@ and have a separate script for this new multi-track mode for now. We could always roll it back in to the main script again later, but I know that I often make use of the $@ to pass in additional arguments, and others may, too.

Thank you for your comment/advise , as desired , I have separated the multi-track script into a new one and retained $@ .

@TilsonJoji
Copy link
Contributor Author

TilsonJoji commented Nov 11, 2024

Please hold-on your review , there is one more check required in my commit will update shortly

@TilsonJoji
Copy link
Contributor Author

TilsonJoji commented Nov 11, 2024

Done with addressing your comment/advise @englishm , kindly review and let me know your thoughts and amendments to be done.

@englishm
Copy link
Owner

Thanks, @TilsonJoji!

@englishm englishm merged commit 003d930 into englishm:main Nov 14, 2024
1 check passed
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.

2 participants