Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6170 closed defect (fixed)

HLS - Problem with temp_file flag - Playlist and delete_segments referenced to temporal files.

Reported by: Frank_loz Owned by: Steven Liu
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When it's used temp_file flag for HLS, ffmpeg tries to delete the temporal files failing because this file doesn't exit (after rename). On the other hand the playlist is created with references to temporal files.

How to reproduce:

ffmpeg -v 9 -loglevel 99 -stream_loop -1 -y -i 1.mp4 -bsf:v h264_mp4toannexb -f hls -b:v 400k -b:a 64k -c:v libx264 -c:a aac -map 0:0 -map 0:1 -hls_time 10 -hls_list_size 5 -hls_allow_cache 0 -hls_segment_filename test/LQ_segment_%03d.ts -hls_flags delete_segments+append_list+split_by_time+temp_file test/playlist_LQ.m3u8  > ffmpeg_hls_bug.txt 2>&1

Messages:

[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_126.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_126.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_127.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_127.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_129.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_129.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_128.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_128.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_130.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_130.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_132.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_132.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_131.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_131.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_134.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_134.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_133.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_133.ts.tmp: No such file or directory
[hls muxer @ 0x1fcb920] deleting old segment LQ_segment_136.ts.tmp
[hls muxer @ 0x1fcb920] failed to delete old segment test/LQ_segment_136.ts.tmp: No such file or directory

ls -l

-rw-r--r-- 1 root root  708196 Feb 21 11:18 LQ_segment_126.ts
-rw-r--r-- 1 root root  793924 Feb 21 11:18 LQ_segment_127.ts
-rw-r--r-- 1 root root  603104 Feb 21 11:19 LQ_segment_128.ts
-rw-r--r-- 1 root root  748804 Feb 21 11:19 LQ_segment_129.ts
-rw-r--r-- 1 root root  110544 Feb 21 11:19 LQ_segment_130.ts
-rw-r--r-- 1 root root  664768 Feb 21 11:20 LQ_segment_131.ts
-rw-r--r-- 1 root root  708196 Feb 21 11:20 LQ_segment_132.ts
-rw-r--r-- 1 root root  793924 Feb 21 11:20 LQ_segment_133.ts
-rw-r--r-- 1 root root  603104 Feb 21 11:20 LQ_segment_134.ts
-rw-r--r-- 1 root root  748804 Feb 21 11:20 LQ_segment_135.ts
-rw-r--r-- 1 root root  203792 Feb 21 11:20 LQ_segment_136.ts
-rw-r--r-- 1 root root  574152 Feb 21 11:20 LQ_segment_137.ts
-rw-r--r-- 1 root root  955040 Feb 21 11:20 LQ_segment_138.ts
-rw-r--r-- 1 root root  557420 Feb 21 11:20 LQ_segment_139.ts
-rw-r--r-- 1 root root  872508 Feb 21 11:20 LQ_segment_140.ts
-rw-r--r-- 1 root root  471504 Feb 21 11:20 LQ_segment_141.ts
-rw-r--r-- 1 root root  262072 Feb 21 11:20 LQ_segment_142.ts
-rw-r--r-- 1 root root  581484 Feb 21 11:20 LQ_segment_143.ts
-rw-r--r-- 1 root root  913492 Feb 21 11:20 LQ_segment_144.ts
-rw-r--r-- 1 root root  673792 Feb 21 11:21 LQ_segment_145.ts
-rw-r--r-- 1 root root  889052 Feb 21 11:21 LQ_segment_146.ts
-rw-r--r-- 1 root root  200784 Feb 21 11:21 LQ_segment_147.ts
-rw-r--r-- 1 root root  514556 Feb 21 11:21 LQ_segment_148.ts
-rw-r--r-- 1 root root  952220 Feb 21 11:21 LQ_segment_149.ts
-rw-r--r-- 1 root root  560616 Feb 21 11:21 LQ_segment_150.ts
-rw-r--r-- 1 root root  910108 Feb 21 11:21 LQ_segment_151.ts
-rw-r--r-- 1 root root  471880 Feb 21 11:21 LQ_segment_152.ts
-rw-r--r-- 1 root root  280872 Feb 21 11:21 LQ_segment_153.ts
-rw-r--r-- 1 root root  524332 Feb 21 11:21 LQ_segment_154.ts
-rw-r--r-- 1 root root  908416 Feb 21 11:21 LQ_segment_155.ts
-rw-r--r-- 1 root root  683192 Feb 21 11:21 LQ_segment_156.ts
-rw-r--r-- 1 root root  919320 Feb 21 11:21 LQ_segment_157.ts
-rw-r--r-- 1 root root  197588 Feb 21 11:21 LQ_segment_158.ts
-rw-r--r-- 1 root root  532040 Feb 21 11:21 LQ_segment_159.ts
-rw-r--r-- 1 root root  927216 Feb 21 11:21 LQ_segment_160.ts
-rw-r--r-- 1 root root  618708 Feb 21 11:21 LQ_segment_161.ts
-rw-r--r-- 1 root root  874012 Feb 21 11:21 LQ_segment_162.ts
-rw-r--r-- 1 root root  451012 Feb 21 11:21 LQ_segment_163.ts
-rw-r--r-- 1 root root  306440 Feb 21 11:21 LQ_segment_164.ts
-rw-r--r-- 1 root root  486732 Feb 21 11:21 LQ_segment_165.ts
-rw-r--r-- 1 root root  896572 Feb 21 11:21 LQ_segment_166.ts
-rw-r--r-- 1 root root  705188 Feb 21 11:21 LQ_segment_167.ts
-rw-r--r-- 1 root root  912364 Feb 21 11:21 LQ_segment_168.ts
-rw-r--r-- 1 root root  198340 Feb 21 11:22 LQ_segment_169.ts
-rw-r--r-- 1 root root  629236 Feb 21 11:22 LQ_segment_170.ts
-rw-r--r-- 1 root root  840360 Feb 21 11:22 LQ_segment_171.ts
-rw-r--r-- 1 root root  600660 Feb 21 11:22 LQ_segment_172.ts
-rw-r--r-- 1 root root  895632 Feb 21 11:22 LQ_segment_173.ts
-rw-r--r-- 1 root root  423376 Feb 21 11:22 LQ_segment_174.ts
-rw-r--r-- 1 root root  338212 Feb 21 11:22 LQ_segment_175.ts
-rw-r--r-- 1 root root  487296 Feb 21 11:22 LQ_segment_176.ts
-rw-r--r-- 1 root root  856152 Feb 21 11:22 LQ_segment_177.ts
-rw-r--r-- 1 root root  786216 Feb 21 11:22 LQ_segment_178.ts
-rw-r--r-- 1 root root  845060 Feb 21 11:22 LQ_segment_179.ts
-rw-r--r-- 1 root root  201912 Feb 21 11:22 LQ_segment_180.ts
-rw-r--r-- 1 root root  624912 Feb 21 11:22 LQ_segment_181.ts
-rw-r--r-- 1 root root  845248 Feb 21 11:22 LQ_segment_182.ts
-rw-r--r-- 1 root root  625852 Feb 21 11:22 LQ_segment_183.ts
-rw-r--r-- 1 root root  474888 Feb 21 11:22 LQ_segment_184.ts
-rw-r--r-- 1 root root     315 Feb 21 11:22 playlist_LQ.m3u8

cat playlist_LQ.m3u8

root@ffmpeg-server:/var/tmp/test# cat playlist_LQ.m3u8 
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:11
#EXT-X-MEDIA-SEQUENCE:180
#EXTINF:10.010000,
LQ_segment_180.ts.tmp
#EXTINF:9.976633,
LQ_segment_181.ts.tmp
#EXTINF:9.976633,
LQ_segment_182.ts.tmp
#EXTINF:10.043367,
LQ_segment_183.ts.tmp
#EXTINF:6.272933,
LQ_segment_184.ts.tmp
#EXT-X-ENDLIST

Attachments (1)

ffmpeg_hls_bug.txt.gz (730.9 KB ) - added by Frank_loz 7 years ago.

Download all attachments as: .zip

Change History (13)

by Frank_loz, 7 years ago

Attachment: ffmpeg_hls_bug.txt.gz added

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: hls added; HLS hls_flags temp_file removed

Is this a regression?

comment:2 by Frank_loz, 7 years ago

It's a new feature over my last version installed and tested.

I don't have the las version but it was very old version.

comment:3 by Carl Eugen Hoyos, 7 years ago

Component: undeterminedavformat
Priority: importantnormal

comment:4 by Frank_loz, 7 years ago

Ok, it's normal the severity but If someone uses this functionlity the disk will be full and the video is not available.

comment:5 by Steven Liu, 7 years ago

Owner: set to Steven Liu
Status: newopen

comment:6 by Steven Liu, 7 years ago

Try the new patch fix this "normal the severity" :)
mail title: [PATCH] avformat/hlsenc: fix hls_flags temp_file bug

comment:7 by Frank_loz, 7 years ago

How will the fix be delivered?

in reply to:  7 comment:8 by Steven Liu, 7 years ago

Replying to Frank_loz:

How will the fix be delivered?

It should be applied if you test passed.

the new patch is :
[PATCH v2] avformat/hlsenc: fix hls_flags temp_file bug

comment:9 by Frank_loz, 7 years ago

I'm sorry it's my first ticket in ffmpeg.

How could I download and install the fix?

Is it compiling the last version of the Git?

in reply to:  9 comment:10 by Steven Liu, 7 years ago

Replying to Frank_loz:

I'm sorry it's my first ticket in ffmpeg.

How could I download and install the fix?

Is it compiling the last version of the Git?

open this link:
https://patchwork.ffmpeg.org/patch/2634/

you can download the patch and merge the patch into your ffmpeg code
and check if it is ok.

comment:11 by Steven Liu, 7 years ago

Resolution: fixed
Status: openclosed

comment:12 by Frank_loz, 7 years ago

Hi,

I have tested the patch and it passed.

Thanks!!!!

Note: See TracTickets for help on using tickets.