VideoHelp Forum




+ Reply to Thread
Results 1 to 4 of 4
  1. Hello, I have a .mp4 on a folder. I need to turn it to .m3u8 in multiple resolutions and streaming it online.

    To do so, I used mmpeg. This command that I found online:

    Code:
    ffmpeg -y -i file.mp4 -preset slow -g 48 -sc_threshold 0 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -s:v:0 1920*1080 -b:v:0 1800k -s:v:1 1280*720 -b:v:1 1200k -s:v:2 858*480 -b:v:2 750k -s:v:3 630*360 -b:v:3 550k -s:v:4 426*240 -b:v:4 400k -s:v:5 256*144 -b:v:5 200k -c:a copy -var_stream_map "v:0,a:0,name:1080p v:1,a:1,name:720p v:2,a:2,name:480p v:3,a:3,name:360p v:4,a:4,name:240p v:5,a:5,name:144p" -master_pl_name master.m3u8 -f hls -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -hls_segment_filename "v%v/segment%d.ts" v%v/index.m3u8
    and it generated me the .m3u8 file correctly and all the various .ts chunks of videos in the relative resolution folders.
    I uploaded everywthing in the webserver but when I try to stream from the .m3u8 it simply doesn't start. I get generic errors. I tried multiple players, none worked. If I download the files in my computer though, I can stream them fine.
    My doubts are mainly 2:
    - is there any mistakes in the command I found online or is it fine? Does it has the right headers for online streaming?
    - is it possible that some error happened during encoding? specifically, multiple times I get lines like this in the command line during the encoding
    HTML Code:
    Opening 'v1080p/segment96.ts' for writing=N/A time=00:16:13.82 bitrate=N/A speed=0.566x
    that writing=N/A and bitrate=N/A does it means that chunk it was skipped or something?
    Quote Quote  
  2. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by giggioman00 View Post
    Hello, I have a .mp4 on a folder. I need to turn it to .m3u8 in multiple resolutions and streaming it online.

    To do so, I used mmpeg. This command that I found online:

    Code:
    ffmpeg -y -i file.mp4 -preset slow -g 48 -sc_threshold 0 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -s:v:0 1920*1080 -b:v:0 1800k -s:v:1 1280*720 -b:v:1 1200k -s:v:2 858*480 -b:v:2 750k -s:v:3 630*360 -b:v:3 550k -s:v:4 426*240 -b:v:4 400k -s:v:5 256*144 -b:v:5 200k -c:a copy -var_stream_map "v:0,a:0,name:1080p v:1,a:1,name:720p v:2,a:2,name:480p v:3,a:3,name:360p v:4,a:4,name:240p v:5,a:5,name:144p" -master_pl_name master.m3u8 -f hls -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -hls_segment_filename "v%v/segment%d.ts" v%v/index.m3u8
    and it generated me the .m3u8 file correctly and all the various .ts chunks of videos in the relative resolution folders.
    I uploaded everywthing in the webserver but when I try to stream from the .m3u8 it simply doesn't start. I get generic errors. I tried multiple players, none worked. If I download the files in my computer though, I can stream them fine.
    My doubts are mainly 2:
    - is there any mistakes in the command I found online or is it fine? Does it has the right headers for online streaming?
    - is it possible that some error happened during encoding? specifically, multiple times I get lines like this in the command line during the encoding
    HTML Code:
    Opening 'v1080p/segment96.ts' for writing=N/A time=00:16:13.82 bitrate=N/A speed=0.566x
    that writing=N/A and bitrate=N/A does it means that chunk it was skipped or something?
    try this here - https://stackoverflow.com/questions/46276162/mp4-to-dynamic-adaptive-hls-with-multiple...s-using-ffmpeg
    Quote Quote  
  3. Originally Posted by october262 View Post
    Originally Posted by giggioman00 View Post
    Hello, I have a .mp4 on a folder. I need to turn it to .m3u8 in multiple resolutions and streaming it online.

    To do so, I used mmpeg. This command that I found online:

    Code:
    ffmpeg -y -i file.mp4 -preset slow -g 48 -sc_threshold 0 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -map 0:0 -map 0:1 -s:v:0 1920*1080 -b:v:0 1800k -s:v:1 1280*720 -b:v:1 1200k -s:v:2 858*480 -b:v:2 750k -s:v:3 630*360 -b:v:3 550k -s:v:4 426*240 -b:v:4 400k -s:v:5 256*144 -b:v:5 200k -c:a copy -var_stream_map "v:0,a:0,name:1080p v:1,a:1,name:720p v:2,a:2,name:480p v:3,a:3,name:360p v:4,a:4,name:240p v:5,a:5,name:144p" -master_pl_name master.m3u8 -f hls -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -hls_segment_filename "v%v/segment%d.ts" v%v/index.m3u8
    and it generated me the .m3u8 file correctly and all the various .ts chunks of videos in the relative resolution folders.
    I uploaded everywthing in the webserver but when I try to stream from the .m3u8 it simply doesn't start. I get generic errors. I tried multiple players, none worked. If I download the files in my computer though, I can stream them fine.
    My doubts are mainly 2:
    - is there any mistakes in the command I found online or is it fine? Does it has the right headers for online streaming?
    - is it possible that some error happened during encoding? specifically, multiple times I get lines like this in the command line during the encoding
    HTML Code:
    Opening 'v1080p/segment96.ts' for writing=N/A time=00:16:13.82 bitrate=N/A speed=0.566x
    that writing=N/A and bitrate=N/A does it means that chunk it was skipped or something?
    try this here - https://stackoverflow.com/questions/46276162/mp4-to-dynamic-adaptive-hls-with-multiple...s-using-ffmpeg
    Thanks. Actually I found it wasn't a problem of the encoding but it was a problem with CORS.
    Now it works. But I was wondering, is there a way to replace the encoding script I published in my first message in order to use crf? Instead of bitrate?
    Quote Quote  
  4. Remove all the "-b:v:0 1800k", "-b:v:1 1200k", etc. Then add "-crf 26" to the list of x264 arguments, eg, change "-preset slow -g 48 -sc_threshold 0" to "-preset slow -g 48 -sc_threshold 0 -crf 26". In practice this may not work well without VBV settings for each resolution.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!