Giter Site home page Giter Site logo

Comments (6)

barbibulle avatar barbibulle commented on August 24, 2024 1

the --select-streams option of mp4-dash-encode.py should allow you to ignore the data streams in your input video.
(I also forgot to mention that mp4fragment needs to be in your path, as the encoding script will fragment the video files after encoding)

from bento4.

barbibulle avatar barbibulle commented on August 24, 2024

The typical encoding workflow is to configure an encoder/transcoder to produce one file per bitrate, in a way that guarantees the alignment of GOPs (Group Of Picture), so that a valid, aligned, set of DASH segments can be made. Some encoders can produce files that are already in fragmented-mp4 form, but some don't (in which case mp4fragment is used to fragment the encoder output).
It isn't always easy to constrain encoders/transcoders to produce outputs with fixed GOP sizes (encoders try to be smart, with features like automatic scene-cut detection, etc.), but it is necessary. Some encoders are sophisticated enough to know about multi-bitrate encoding right from the start, which is more efficient than doing multiple single-bitrate encodings.
The simple utility mp4-dash-encode.py included in the Bento4 distribution shows how this can be done with ffmpeg (both for h.264 and hevc).

from bento4.

nickdesaulniers avatar nickdesaulniers commented on August 24, 2024

when I run that tool, I get an error:

➜  builds git:(master) ✗ py ../Source/Python/utils/mp4-dash-encode.py -b 5 frag_bunny.mp4
ERROR: binary tool failed with error 1

I get the feeling that this has to do with me not installing the binary tools, or having them in my path. Or not having the option for --exec-dir=. like with Source/Python/utils/mp4-dash.py.

Anyways, I'm giving a talk next week on MSE that will be live streamed from air.mozilla.org, and I plan on plugging these great FOSS tools! https://air.mozilla.org/tech-talk-3/

from bento4.

barbibulle avatar barbibulle commented on August 24, 2024

mp4-dash-encode.py needs to run ffmpeg, so you'll need that to be in your path.
You can see a detailed report on that the 'binary tool error' is exactly here by running the tool with the '-v -d' options (verbose and debug).
That tools hasn't received a lot of testing, it is something that I use myself regularly, but I always have the same settings/patterns, so there are probably a lot of unexplored combinations.

from bento4.

nickdesaulniers avatar nickdesaulniers commented on August 24, 2024

Data stream encoding not supported yet (only streamcopy)
https://pastebin.mozilla.org/8836681

ffmpeg and ffprobe are in my path. both are version 2.6.3.

hmm, I have libfdk_aac:

➜  builds git:(master) ✗ ffmpeg -codecs 2>/dev/null| grep aac
 DEA.L. aac                  AAC (Advanced Audio Coding) (decoders: aac libfdk_aac ) (encoders: aac libfdk_aac libvo_aacenc )
 D.A.L. aac_latm             AAC LATM (Advanced Audio Coding LATM syntax)

from bento4.

nickdesaulniers avatar nickdesaulniers commented on August 24, 2024

Looks like I have to play around with muxing. I was able to edit the first command that ran to:

➜  builds git:(master) ✗ ffmpeg -i "bunny.mp4" -strict experimental -codec:a libfdk_aac -ac 2 -ab 128k -preset slow -map_metadata -1 -codec:v libx264 -profile:v baseline -force_key_frames 'expr:eq(mod(n,72),0)' -bufsize 500k -maxrate 750k -x264opts rc-lookahead=72 -s 256x144 -f mp4 video_00500.mp4_ -map 0:0 -map 0:1

which worked. Ah, if I strip out the two unsupported streams:

➜  builds git:(master) ✗ ffmpeg -i bunny.mp4 -map 0:0 -map 0:1 -c copy bunny_clean.mp4
➜  builds git:(master) ✗ py ../Source/Python/utils/mp4-dash-encode.py -b 5 bunny_clean.mp4
➜  builds git:(master) ✗ py ../Source/Python/utils/mp4-dash-encode.py -b 5 bunny_clean.mp4
/bin/sh: mp4fragment: command not found
ERROR: binary tool failed with error 127
➜  builds git:(master) ✗ PATH=$PATH:. py ../Source/Python/utils/mp4-dash-encode.py -b 5 bunny_clean.mp4

ahoy mateys, were in business!

from bento4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.