Opened 2 months ago

Closed 2 months ago

Last modified 8 weeks 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: stevenliu
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 2 months ago.

Download all attachments as: .zip

Change History (13)

Changed 2 months ago by Frank_loz

comment:1 Changed 2 months ago by cehoyos

  • Keywords hls added; HLS hls_flags temp_file removed

Is this a regression?

comment:2 Changed 2 months ago by Frank_loz

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 Changed 2 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Priority changed from important to normal

comment:4 Changed 2 months ago by Frank_loz

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 Changed 2 months ago by stevenliu

  • Owner set to stevenliu
  • Status changed from new to open

comment:6 Changed 2 months ago by stevenliu

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

comment:7 follow-up: Changed 2 months ago by Frank_loz

How will the fix be delivered?

comment:8 in reply to: ↑ 7 Changed 2 months ago by stevenliu

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 follow-up: Changed 2 months ago by 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?

comment:10 in reply to: ↑ 9 Changed 2 months ago by stevenliu

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 Changed 2 months ago by stevenliu

  • Resolution set to fixed
  • Status changed from open to closed

comment:12 Changed 8 weeks ago by Frank_loz

Hi,

I have tested the patch and it passed.

Thanks!!!!

Note: See TracTickets for help on using tickets.