video - ffmpeg segmentation with multiple mp4 files to HLS stream -
i'm trying segment multiple mp4 files .txt concatenate works, doesn't seem work.
i have concat.txt
desired format:
file video1.mp4 file video2.mp4 file video3.mp4
etc...
and ffmpeg commands are:
ffmpeg -i concat.txt -map 0 -codec:v libx264 -codec:a libfaac -f ssegment \ -segment_list playlist.m3u8 -segment_list_flags +live -segment_time 10 out%03d.ts
unfortunately every mediaplayer drops error on playback.
i presume can't use method done concatenating. have concat mp4s single mp4, , segment mp4 final m3u8? or, can segment mp4s 1 one , concat .ts files better quality?
the ffmpeg concat demuxer
requires same codecs input files, although container can vary. need make sure video , audio streams have same ids across files.
ffmpeg -re -f concat -i concat.txt -c:v libx264 -vbsf h264_mp4toannexb -r 25 -g 75 -c:a libfdk_aac -hls_time 3 playlist.m3u8
i used h264_mp4toannexb
bitstream filter convert h.264 stream annex b format required mpeg-ts, set gop size 75 (3 seconds @ 25 fps) , used segment length of 3 seconds since each segment should start keyframe.
Comments
Post a Comment