0

I am trying to convert MKV video file to HLS and DASH format with dual audio track and add subtitle, which sometimes is integrated and sometimes not.

Using this code

ffmpeg -re -i INPUT -c:v libx264 -c:a aac -preset ultrafast -tune zerolatency -f flv rtmp://127.0.0.1/live/ARBITRARY_NAME

I got only the end of the video file around 30s, not full video and no tracks, after long time waiting.

However, now I've found a new code and it is working as full video but no audio track and resolution setting

ffmpeg -i sample.mkv \
   -c:v libx264 \
   -crf 18 \
   -preset ultrafast \
   -maxrate 4000k \
   -bufsize 8000k \
   -vf "scale=1280:-1,format=yuv420p" \
   -c:a copy -start_number 0 \
   -hls_time 10 \
   -hls_list_size 0 \
   -f hls \ file.m3u8

The video is playing fine, but the language audio tracks are not there and subtitle is not there.

Update I tried to use map command -map 0:v:0 -map 0:a:1 -map 0:a:0 -map 0:s:3 but the result is the same here is the example

ffmpeg -i 'One Piece - 005.mkv' \
   -map 0:v:0 \
   -map 0:a:1 \
   -c:v libx264 \
   -crf 18 \
   -preset ultrafast \
   -maxrate 4000k \
   -bufsize 8000k \
   -vf "scale=1280:-1,format=yuv420p" \
   -c:a copy -start_number 0 \
   -hls_time 10 \
   -hls_list_size 0 \
   -f hls \ 
OnePiece05.m3u8
islam
  • 21

0 Answers0