Git Product home page Git Product logo

ndash's Introduction

libndash README

This is not an official Google product.

libndash

libndash is a C++ library that provides all the functionality one would need to build an adaptive streaming media player (not including decoding/rendering frames to a display). It provides the following functionality:

  • download and parse DASH manifests
  • download segments from fragmented mp4 audio/video streams
  • parse video/audio frames from segments
  • deliver frames to a client decoder
  • switch to different representations based on network conditions
  • notify the client when protected content is encountered
  • provide seek/jump and trick play functionality (forward/backward)

This project is based on a translation of ExoPlayer v1 source files (https://github.com/google/ExoPlayer/tree/release-v1) with non-DASH related functionality removed. It is best suited for environments that require a native code solution for adaptive streaming.

sdl_player

sdl_player is a sample media player written on top of libndash. It demonstrates how to implement the final steps of decoding and rendering frames delivered by libndash using ffmpeg/SDL/Alsa.

Libraries

For Debian-type systems, the following packages should be installed:

  • libevent-dev
  • libmodpbase64-dev
  • libpthread-stubs0-dev
  • libxml2-dev
  • libcurl4-gnutls-dev
  • libsdl2-dev
  • libsdl2-mixer-dev
  • libbz2-dev

Copy and paste:

apt-get install libevent-dev libmodpbase64-dev libpthread-stubs0-dev libxml2-dev
libcurl4-gnutls-dev libsdl2-dev libsdl2-mixer-dev libbz2-dev

If you are using a recent Debian/Ubuntu with an up to date ffmpeg:

  • libavcodec-dev
  • libavdevice-dev
  • libavfilter-dev
  • libavformat-dev
  • libavresample-dev
  • libavresample3
  • libavutil-dev
  • libswresample-dev
  • libswscale-dev
  • libgoogle-glog-dev
  • libgflags-dev

Copy and paste:

apt-get install libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavresample-dev
libavresample3 libavutil-dev libswresample-dev libswscale-dev libgoogle-glog-dev libgflags-dev

Otherwise you will need to install the following from source:

To build:

From the top directory:

cmake . make -jX # where X is the number of cores on your machine or around there

To run the unit tests:

From the top directory:

./build/ndash_unittests --test_data_path=pwd/ndash/src

License

This software is licensed under Apache Software License, Version 2.0

ndash's People

Contributors

randyrossi avatar rdaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ndash's Issues

Dynamic manifests (LIVE) cause SEGFAULT after 1st refresh

This is a known issue. Dynamic manifests (LIVE) will cause SEGFAULT shortly after the 1st manifest refresh. This is a ownership issue mostly due to the period/representation holders still holding pointers to memory owned by the previous manifest which just got deleted.

Security Policy violation Binary Artifacts

This issue was automatically created by Allstar.

Security Policy Violation
Project is out of compliance with Binary Artifacts policy: binaries present in source code

Rule Description
Binary Artifacts are an increased security risk in your repository. Binary artifacts cannot be reviewed, allowing the introduction of possibly obsolete or maliciously subverted executables. For more information see the Security Scorecards Documentation for Binary Artifacts.

Remediation Steps
To remediate, remove the generated executable artifacts from the repository.

First 10 Artifacts Found

  • third_party/chromium/base/src/base/allocator/allocator_extension.os
  • third_party/chromium/base/src/base/allocator/allocator_shim.os
  • third_party/chromium/base/src/base/allocator/allocator_shim_default_dispatch_to_glibc.os
  • third_party/chromium/base/src/base/at_exit.os
  • third_party/chromium/base/src/base/test/data/file_util/binary_file.bin
  • third_party/chromium/base/src/base/test/data/file_util/binary_file_diff.bin
  • third_party/chromium/base/src/base/test/data/file_util/binary_file_same.bin
  • third_party/chromium/base/src/base/test/data/file_version_info_unittest/FileVersionInfoTest1.dll
  • third_party/chromium/base/src/base/test/data/file_version_info_unittest/FileVersionInfoTest2.dll
  • third_party/chromium/base/src/base/test/data/pe_image/pe_image_test_32.dll
  • Run a Scorecards scan to see full list.

Additional Information
This policy is drawn from Security Scorecards, which is a tool that scores a project's adherence to security best practices. You may wish to run a Scorecards scan directly on this repository for more details.


Allstar has been installed on all Google managed GitHub orgs. Policies are gradually being rolled out and enforced by the GOSST and OSPO teams. Learn more at http://go/allstar

This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

Smooth out frame dropping in the sample player

The sample player drops video frames to keep audio in sync. However, the frame dropping is quite noticible and causes jerky looking video sometimes. Investigate a way to smooth out the drops over a longer period so we don't ever drop more than one at a time. Or find a better approach to keeping video/audio in sync.

Map dash channel layout enums to ffmpeg channel_layout values in examples/sdl_player/src/frame_source_queue.cc

./sdl_player --dash_url='https://amssamples.streaming.mediaservices.windows.net/634cd01c-6822-4630-8444-8dd6279f94c6/CaminandesLlamaDrama4K.ism/manifest(format=mpd-time-csf)'

Output

[1012/160226:INFO:dash_thread.cc(117)] DashThread
[1012/160226:INFO:dash_thread.cc(128)] load
[1012/160226:INFO:dash_thread.cc(66)] AvailableRangeChanged / video static=1 range=[0s - 90s]
[1012/160226:INFO:load_control.cc(221)] NotifyLoadingChanged 1
[1012/160226:INFO:dash_thread.cc(66)] AvailableRangeChanged / audio static=1 range=[0s - 90.0053s]
[1012/160226:INFO:dash_thread.cc(66)] AvailableRangeChanged / text static=1 range=[0s - 90.005s]
[1012/160226:INFO:dash_thread.cc(613)] update state=3 dpos=0s rpos=0s buffer=0s
[1012/160227:INFO:dash_thread.cc(613)] update state=3 dpos=0s rpos=0s buffer=0s
[1012/160227:INFO:dash_thread.cc(613)] update state=3 dpos=0s rpos=0s buffer=0s
[1012/160227:INFO:dash_thread.cc(1466)] Current bandwidth 193.513513 Mbps
MEDIA_INFO_LOG_ENTRY {"info":"Video codec: avc1.64001F"}
[1012/160227:INFO:stream_parser_extractor.cc(251)] Track 0 type=2 id=1 kind=main label=VideoHandler language=eng
[1012/160227:WARNING:dash_thread.cc(416)] Unhandled chunk type in OnLoadCompleted callback
MEDIA_INFO_LOG_ENTRY {"info":"Audio codec: mp4a.40.2. Sampling frequency: 48000Hz. Sampling frequency(Extension): 0Hz. Channel layout: 12."}
[1012/160227:INFO:stream_parser_extractor.cc(251)] Track 0 type=1 id=5 kind=main label=SoundHandler language=eng
[1012/160227:INFO:dash_thread.cc(769)] Detected video codec h264
[1012/160227:WARNING:dash_thread.cc(416)] Unhandled chunk type in OnLoadCompleted callback
[1012/160227:INFO:dash_thread.cc(798)] Detected audio codec aac
[1012/160227:INFO:dash_thread.cc(798)] Detected audio codec aac
WARNING: Logging before InitGoogleLogging() is written to STDERR
E1012 16:02:27.905591 23506 frame_source_queue.cc:105] Unsupported channel layout: 12
E1012 16:02:27.905964 23506 player.cc:69] Can't create frame source queue
E1012 16:02:27.906013 23506 statusor.cc:56] Attempting to fetch value instead of handling error: UNAVAILABLE:Unsupported channel layout
sdl_player: /home/xdesk/github/google/ndash/examples/sdl_player/src/util/statusor.cc:58: static void util::internal::StatusOrHelper::Crash(const util::Status&): Assertion `0' failed.
Aborted (core dumped)

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.