0

I am using ffmpeg to convert an HLS stream to mp4 using this command:

ffmpeg -i https://example.com/xxx.m3u8 -y -vcodec copy -c copy -bsf:a aac_adtstoasc test.mp4

I only have access to this video from the stream, and I need it in mp4 format to send on for processing, but I want to be able to set the FPS of the mp4, so that it is consistent.

The HLS stream looks like this:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=264000
xxx/xxx007e.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=464000
xxx/xxx0080.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=768000
xxx/xxx0082.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1200000
xxx/xxx0084.m3u8
  • Is re-encoding ok? Why do you believe the stream is variable FPS? That is a master playlist with entries for variants. They don't represent differing framerates. – Gyan Nov 29 '17 at 13:33
  • have you solved your problem? – Tara Aug 1 '18 at 10:05
0

You can use -r 30 to designate 30 fps for your mp4 output. The whole cmd can be like this

ffmpeg -i https://example.com/xxx.m3u8 -y -vcodec copy -c copy -bsf:a aac_adtstoasc test.mp4

0

Try this:

ffmpeg -re -y -i https://example.com/xxx.m3u8 -map 0 -vcodec copy -c copy -bsf:a aac_adtstoasc test.mp4

See the new options:

  1. -map 0 maps all streams from the input.
  2. -re reads in the live stream HLS at its' rate. Not specifying this may result in FFmpeg hanging (as it waits for referenced packets that are not in the manifest).

It would be more useful if you could provide stream details, such as running mediainfo or ffprobe against the master manifest. That way we can recommend encoding settings to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.