FFmpeg icon indicating copy to clipboard operation
FFmpeg copied to clipboard

very slow speed for ffmpeg'segment and hls ?

Open akingbr opened this issue 6 years ago • 3 comments

hello, I compile shiftmediaproject ok, then test hls segment, command likes: ffmpeg.exe -i F:\web\express\testv\public\hls\ani.mp4 -codec:v libx264 -codec:a aac -map 0 -f ssegment -segment_format mpegts -segment_list F:\web\express\testv\public\hls\playlist.m3u8 -segment_wrap 5 -segment_time 5 F:\web\express\testv\public\hls\out%%03d.ts

or ffmpeg.exe -i F:\web\express\testv\public\hls\ani.mp4 -c:v libx264 -c:a aac -strict -2 -f hls -hls_wrap 5 -hls_time 5 F:\web\express\testv\public\hls\playlist.m3u8

but when I preview m3u8 in browser , I found that video is blocked frequently; I notice that ts(segemnt)file was produced very slowly。 if I use ffmpeg complied by mingw, ts file was produced very fast, any suggestion?

thanks a lot。

akingbr avatar Sep 10 '18 09:09 akingbr

This is potentially an issue with the FFmpeg code itself using different code paths when compiled with msvc than when compiled with mingw (this often occurs when the code uses a non standard gcc feature that is not natively supported by msvc). Although it could also be a difference due to ffmpeg being compiled using different libraries so first check to see if the mingw build you are comparing it to uses different libraries to this one.

Im not familiar enough with the hls code to know where the difference may be. So my suggestion would be to look in the used code for areas where the msvc compiled ffmpeg uses different code to the mingw one. Once that is identified then you can check in with the upstream ffmpeg coders for a potential fix.

Sibras avatar Sep 10 '18 13:09 Sibras

thanks for replay so quickly, i check two compiled ffmpeg codes recently。 if something be found, i will tell you, thanks。

akingbr avatar Sep 11 '18 06:09 akingbr

Did you establish whether this was the segmenter being slow or the x264 encode? i.e. try the comparison just encoding to a simple mp4 file.

oviano avatar Jan 01 '19 07:01 oviano