How to merge the segmented video files into one .MP4 video file?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to merge the segmented video files into one .MP4 video file?

mikelee164396
I installed an app with Android Tablet, and then downloaded a video through this app. Actually the app download a  .m3u8 file and several .ts files. The file list picture and  .m3u8 files See Attachment. How can I merge these files to generate an mp4 video file?


| |
mikelee164396
|
|
邮箱:[hidden email]
|

签名由 网易邮箱大师 定制
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

Screenshot.jpg (663K) Download Attachment
1053645342_1.m3u8 (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to merge the segmented video files into one .MP4 video file?

Moritz Barsnick
> I installed an app with Android Tablet, and then downloaded a video
> through this app. Actually the app download a  .m3u8 file and several
> .ts files. The file list picture and  .m3u8 files See Attachment. How
> can I merge these files to generate an mp4 video file?

Usually, just
$ ffmpeg -i 1053645342_1.m3u8 -c copy output.mp4
should be sufficient.

In this case, the m3u8 "playlist" refernces a crypto key:

> #EXT-X-KEY:METHOD=AES-128,URI="http://127.0.0.1/hls.key"

I don't know whether the Android app inserted or modified this line.
You will have to get hold of that key file, and modify that line to
point to its location.

Or better: Just use the original video location with ffmpeg:

$ ffmpeg -i http://server.example.com/path/to/1053645342_1.m3u8 -c copy output.mp4

ffmpeg will then pick up the key file and decrypt the video for you.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to merge the segmented video files into one .MP4 video file?

penguin flying
https://trac.ffmpeg.org/wiki/Concatenate

Moritz Barsnick <[hidden email]> 于2020年3月10日周二 下午8:51写道:

> > I installed an app with Android Tablet, and then downloaded a video
> > through this app. Actually the app download a  .m3u8 file and several
> > .ts files. The file list picture and  .m3u8 files See Attachment. How
> > can I merge these files to generate an mp4 video file?
>
> Usually, just
> $ ffmpeg -i 1053645342_1.m3u8 -c copy output.mp4
> should be sufficient.
>
> In this case, the m3u8 "playlist" refernces a crypto key:
>
> > #EXT-X-KEY:METHOD=AES-128,URI="http://127.0.0.1/hls.key"
>
> I don't know whether the Android app inserted or modified this line.
> You will have to get hold of that key file, and modify that line to
> point to its location.
>
> Or better: Just use the original video location with ffmpeg:
>
> $ ffmpeg -i http://server.example.com/path/to/1053645342_1.m3u8 -c copy
> output.mp4
>
> ffmpeg will then pick up the key file and decrypt the video for you.
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How to merge the segmented video files into one .MP4 video file?

mikelee164396
In reply to this post by Moritz Barsnick
My m3u8 file include the line :  #EXT-X-KEY:METHOD=AES-128,URI="http://127.0.0.1/hls.key";
but I can't find the file hls.key on my Android tablet. Maybe the file is a private file.please tell me how to get the file and copy it out? but I don't want to root.





| |
mikelee164396
|
|
邮箱:[hidden email]
|

签名由 网易邮箱大师 定制

On 03/10/2020 20:51, Moritz Barsnick wrote:
> I installed an app with Android Tablet, and then downloaded a video
> through this app. Actually the app download a  .m3u8 file and several
> .ts files. The file list picture and  .m3u8 files See Attachment. How
> can I merge these files to generate an mp4 video file?

Usually, just
$ ffmpeg -i 1053645342_1.m3u8 -c copy output.mp4
should be sufficient.

In this case, the m3u8 "playlist" refernces a crypto key:

> #EXT-X-KEY:METHOD=AES-128,URI="http://127.0.0.1/hls.key&quot;

I don't know whether the Android app inserted or modified this line.
You will have to get hold of that key file, and modify that line to
point to its location.

Or better: Just use the original video location with ffmpeg:

$ ffmpeg -i http://server.example.com/path/to/1053645342_1.m3u8 -c copy output.mp4

ffmpeg will then pick up the key file and decrypt the video for you.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".