Skip to main content
bilivideodownloader.com
en

Free tool · files stay on your device

Bilibili M4S to MP4 converter

Videos you download in the Bilibili app or PC client are saved as two .m4s files, one with the picture and one with the sound. Drop both here to get a single MP4 that plays anywhere, with the original quality.

Where Bilibili saves downloaded videos

Bilibili’s own download button (缓存, “cache”) keeps videos for offline viewing inside the app. The files are real, but they are split and named for the app, so they don’t show up in your gallery or play in other players. Folder names can change between app versions, so treat these as a guide.

  • Android app: Android/data/tv.danmaku.bili/download/. Each video has a numbered folder, each part has a c_… folder inside it, and the quality folder in there holds video.m4s and audio.m4s. Android 11 and later hide the Android/data folder from most file managers, so the easiest way in is to connect the phone to a computer with a USB cable.
  • Windows and Mac desktop client: the download folder you picked in its settings. Each video gets a folder with two .m4s files with long number names.
  • iPhone and iPad: iOS keeps app downloads sealed inside the app, so there are no files to copy out. Use the iPhone download guide to save an MP4 from the link instead.

What the converter does

Bilibili cache files are fragmented MP4 tracks, the same format its website streams. The converter:

  • removes the padding bytes the PC client puts before the file header, which is why players call these files damaged;
  • reads each file to tell the picture track from the sound track, so the order you pick them in doesn’t matter;
  • writes both tracks into one MP4 container, copying the data as it is. Nothing is re-encoded, so quality is unchanged and even long videos take seconds.

We tested it on Bilibili tracks with the PC client’s nine-byte padding added. ffprobe couldn’t open the originals; the joined file played the full 2 minutes 34 seconds with H.264 video and AAC sound.

Skip the cache entirely

If you just want an MP4 of a public video, paste its link into the Bilibili video downloader. It saves one file with the sound already in it, in the best quality Bilibili gives out without signing in (see our 1080p download test). Use this converter for videos you already cached in the app, or for files you can no longer find online.

FAQ

Bilibili M4S and cache questions

What .m4s files are, why they won’t play, and what the converter can and can’t do.

What is an .m4s file from Bilibili?

It is one track of a video, cut out for streaming. Bilibili keeps the picture and the sound in separate files, usually video.m4s and audio.m4s, and its app joins them while you watch. On their own, most players either refuse the file or play it without sound.

Is my video uploaded anywhere?

No. The files are read and joined by JavaScript in this page, and the MP4 is created in your browser. Nothing is sent to our server, so even multi-gigabyte files work and the page keeps working offline once it has loaded.

Does converting lower the quality?

No. The tool copies the existing video and audio streams into one MP4 container without decoding or re-encoding them. The result has exactly the resolution, bitrate and sound of the cache files, and joining takes seconds even for long videos.

Why won’t VLC or Windows play my Bilibili cache file?

Two reasons. The picture and sound are in separate files, and the Bilibili PC client adds a few extra bytes (usually nine zeros) to the start of each file, which makes players think it is damaged. This tool removes those bytes and joins the two tracks.

Which file is the video and which is the audio?

You don’t need to know. Drop both files from the same folder and the tool reads each one to see which track it holds. In app caches they are named video.m4s and audio.m4s. In the PC client they have long number names, and the larger file is usually the video.

It says the file is FLV or not an M4S. What now?

Old versions of the Bilibili app saved downloads as .blv files, which are FLV video, not .m4s tracks. VLC plays most .blv files directly; rename them to .flv if your player is picky. Files that are encrypted, partly downloaded or not from Bilibili cannot be joined here.

Can I convert anime or premium downloads?

Only if the cache files are ordinary, unencrypted tracks. Some licensed and premium content is stored in a protected form that only the Bilibili app can play, and this tool will not get around that.