GithubHelp home page GithubHelp logo

aurora-jc / bilivdtool Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 645 KB

A handy tool designed to decode Bilibili's videos and seamlessly merge both video and audio streams.

Go 89.56% Makefile 10.44%

bilivdtool's Introduction

bilivdtool

A handy tool designed to decode Bilibili's videos and seamlessly merge both video and audio streams.

Features

  • Decode the downloaded video from bilibili.

  • Merge the video part and the audio part.

Configuration

This tool's video merge functionality is based on FFmpeg. So, if you need to install FFmpeg on your operating system, you can download it from the official site.

After installing FFmpeg, please make sure to add its path to the system's PATH variable.

Alternatively, you can place the FFmpeg binary file in the same folder as the bilivdtool.

Usage

bilivdtool -v [video_path] -a [audio_path] -o [output_path]

Build

git clone https://github.com/aURORA-JC/bilivdtool.git
cd ./bilivdtool
make

About

After downloading the video from Bilibili using either the official client or web scripts, it becomes apparent that the video stream and the audio stream are stored in separate files.

v&ainseparatefile

FFmpeg serves as a fitting tool to merge these two parts into a single video file. However, when utilizing FFmpeg directly, an error may occur.

ffmpegbeforeedit

To address this issue, it's necessary to inspect the file's hexadecimal representation.

videostreamhex audiostreamhex

It becomes evident that the highlighted portion at the start of the files, indicated in yellow, is padded with '0', causing FFmpeg to decode the video file incorrectly.

To resolve this, simply remove the highlighted section and save the files. Subsequently, attempt to merge the files using FFmpeg.

ffmpegafteredit

This time, no errors occur, and the file output.mp4 is successfully generated.

Upon opening it with VLC player, everything functions correctly.

playwithvlc

Contribution

Any positive contribution is welcome.

Please fork the repo and submit PRs.

License

(C) 2024 Aurora-JC. MIT License

bilivdtool's People

Contributors

aurora-jc avatar

Stargazers

ZxYdzero avatar

Watchers

 avatar

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.