0

After I recorded and saved streamed video files, it was saved in the following formats .ts and .m3u8 file extension names

In the folder called video I have the following files:

video/chunk_0.ts
video/chunk_1.ts
video/chunk_2.ts
video/content.m3u8

Here is what I want to achieve:

How do I merge all these files in video folder into .mp4 video file formats?

I have researched on Stack Overflow on how to do that, the Stack Overflow source suggest using exec and ffmpeg.

I guess something like the code below but they are other files in the folder:

<?php

$vi = exec(ffmpeg -i video/chunk_0.ts output.mp4);

How can I achieve that?

halfer
  • 19,824
  • 17
  • 99
  • 186
Nancy Moore
  • 2,322
  • 2
  • 21
  • 38
  • Just try some commands on the console first. Maybe list them in order, separated by spaces, before the output file. – halfer Feb 02 '22 at 21:16

1 Answers1

0

as .m3u8 contains all segment information of .ts, you can directly transfer .m3u8 file to .mp4 using ffmpeg and shall merge all .ts files together

$vi = exec(ffmpeg -i video/content.m3u8 output.mp4);

Dan
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 07 '22 at 11:45