Search code examples
ffmpegstreamingmp4mpeg-dashmp4box

How to split a mp4 file into multiple .m4s chunks with one init.mp4 file


I am trying to split one audio.mp4 into multiple chunks(each of 10 seconds) with file format of .m4s or .mpd and one init.mp4 .

1>I have successfully made chunks of 10 secs with one m3u8 file by this command-

ffmpeg -i song.mp3 -c:a aac -b:a 64k -vn -hls_time 10 -hls_list_size 0 abc.m3u8

2>Tried this command also

MP4Box -dash 10000 -frag 1000 -rap -segment-name myDash -subsegs-per-sidx 5 -url-template test.mp4

But not able to make .m4s chunks with one init.mp4.


Solution

  • Now,I can make .m4s segments and one init.mp4 by using below command.

        MP4Box -dash 10000 -out video.mpd -dash-profile live -segment-name mv_ -rap video.mp4
    

    REFERENCE: Calculate .m4s segment file suffix in HTML5 video streaming when user seeks to another time