Add hls_wrap option to FFMPEG before remux IPTV to hls #3220

Closed
opened 2026-02-06 22:59:20 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @mailbyms on GitHub (Aug 31, 2021).

Describe the feature you'd like
I set up my live tv (IPTV) by adding a .m3u source file, and during watching IPTV program, I find FFMPEG generates lots of TS files on the jellyfin server side, the directory is /volume1/@appstore/jellyfin/var/data/transcodes
Those files won't delete themselves, and it will consume serval GB of disk.
In fact , ffmpeg has a parameter called "hls_wrap", it would fix this problem.

root@MIKE_NAS:/volume1/@appstore/jellyfin/var/data/transcodes# ll
total 14108
drwxr-xr-x 2 root        root           0 Aug 31 22:53 .
drwxr-xr-x 7 sc-jellyfin jellyfin    4096 Aug 27 11:17 ..
-rw-r--r-- 1 root        jellyfin 2923024 Aug 31 22:53 03605298a695a29cde33834f234b8b5e0.ts
-rw-r--r-- 1 root        jellyfin 2889936 Aug 31 22:53 03605298a695a29cde33834f234b8b5e1.ts
-rw-r--r-- 1 root        jellyfin 2833536 Aug 31 22:53 03605298a695a29cde33834f234b8b5e2.ts
-rw-r--r-- 1 root        jellyfin 3372908 Aug 31 22:53 03605298a695a29cde33834f234b8b5e3.ts
-rw-r--r-- 1 root        jellyfin 2408468 Aug 31 22:53 03605298a695a29cde33834f234b8b5e4.ts
-rw-r--r-- 1 root        jellyfin     560 Aug 31 22:53 03605298a695a29cde33834f234b8b5e.m3u8
...
and a lot more .

Then I check Jellyfin's processes, I find there is no hls_wrap when invoking FFMPEG

root@MIKE_NAS:/volume1/@appstore/jellyfin/var/data/transcodes# ps -ef|grep ffmpeg
sc-jell+  7660     1  0 Aug29 ?        00:17:52 /volume1/@appstore/jellyfin/share/jellyfin --service --package-name synology -d /volume1/@appstore/jellyfin/var/data -C /volume1/@appstore/jellyfin/var/cache -c /volume1/@appstore/jellyfin/var/config -l /volume1/@appstore/jellyfin/var/log -w /volume1/@appstore/jellyfin/web --ffmpeg /var/packages/ffmpeg/target/bin/ffmpeg
root     10784  7660  2 22:53 ?        00:00:03 /var/packages/ffmpeg/target/bin/ffmpeg -analyzeduration 3000000 -rtsp_transport tcp -rtsp_transport udp -rtsp_flags prefer_tcp -fflags +igndts+genpts -f rtsp -i rtsp://183.59.168.27/PLTV/88888905/224/3221227346/10000100000000060000000003100521_0.smil?rrsip=125.88.104.45,rrsip=125.88.70.140&zoneoffset=480&icpid=1111116&accounttype=1&limitflux=-1&limitdur=-1&GuardEncType=2&accountinfo=%7E%7EV2.0%7ErN-BuTVrGNWqfRpgcaeoYA%7EApBzL3r_voXq10M-GWtX1pp12YK6-zQpQOUIOl0wbjEq730dUqnc_SjPYjiOQWwdythRrEf7Hp9ToXshxUNGDpwMHPmgDEdR_mdoJOtFf3o~ExtInfoWNHSPSTb+3AG0FnUkYLPMw==%3A20190922160629%2C10.157.14.51%2C20190922160629%2C02000001000000052013120900000001%2C2900877920190922160629%2C-1%2C0%2C1%2C%2C%2C7%2C%2C%2C%2C4%2CEND&it=H4sIAAAAAAAAAC2Oyw6CMBBF_6bLRijPRVcYExNTF6BbM8JQCQOtLZj49wKym5lzT-ZODmo8H-U4EzGPb2VkyGog6katTLOie1k8gkzwOOci5WHIqtU5EWh52KJqHp7o9mXxSnSfrkbZ-JZbgu_siHvbbfPN0Y4ZVvvvIE7yIBIiSbM4YtN6rcD3C2Ev8IUZLDhsLkZvgmyBPDILdQ8aFQz4L795V9csTX5bnL8A1QAAAA -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 copy -start_at_zero -flags -global_header -vsync -1 -acodec copy -strict -2 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_base_url hls/03605298a695a29cde33834f234b8b5e/ -hls_playlist_type event -hls_segment_filename /volume1/@appstore/jellyfin/var/data/transcodes/03605298a695a29cde33834f234b8b5e%d.ts -y /volume1/@appstore/jellyfin/var/data/transcodes/03605298a695a29cde33834f234b8b5e.m3u8

Additional context

Originally created by @mailbyms on GitHub (Aug 31, 2021). **Describe the feature you'd like** I set up my live tv (IPTV) by adding a .m3u source file, and during watching IPTV program, I find FFMPEG generates lots of TS files on the jellyfin server side, the directory is `/volume1/@appstore/jellyfin/var/data/transcodes` Those files won't delete themselves, and it will consume serval GB of disk. In fact , ffmpeg has a parameter called "hls_wrap", it would fix this problem. ``` root@MIKE_NAS:/volume1/@appstore/jellyfin/var/data/transcodes# ll total 14108 drwxr-xr-x 2 root root 0 Aug 31 22:53 . drwxr-xr-x 7 sc-jellyfin jellyfin 4096 Aug 27 11:17 .. -rw-r--r-- 1 root jellyfin 2923024 Aug 31 22:53 03605298a695a29cde33834f234b8b5e0.ts -rw-r--r-- 1 root jellyfin 2889936 Aug 31 22:53 03605298a695a29cde33834f234b8b5e1.ts -rw-r--r-- 1 root jellyfin 2833536 Aug 31 22:53 03605298a695a29cde33834f234b8b5e2.ts -rw-r--r-- 1 root jellyfin 3372908 Aug 31 22:53 03605298a695a29cde33834f234b8b5e3.ts -rw-r--r-- 1 root jellyfin 2408468 Aug 31 22:53 03605298a695a29cde33834f234b8b5e4.ts -rw-r--r-- 1 root jellyfin 560 Aug 31 22:53 03605298a695a29cde33834f234b8b5e.m3u8 ... and a lot more . ``` Then I check Jellyfin's processes, I find there is no `hls_wrap` when invoking FFMPEG ``` root@MIKE_NAS:/volume1/@appstore/jellyfin/var/data/transcodes# ps -ef|grep ffmpeg sc-jell+ 7660 1 0 Aug29 ? 00:17:52 /volume1/@appstore/jellyfin/share/jellyfin --service --package-name synology -d /volume1/@appstore/jellyfin/var/data -C /volume1/@appstore/jellyfin/var/cache -c /volume1/@appstore/jellyfin/var/config -l /volume1/@appstore/jellyfin/var/log -w /volume1/@appstore/jellyfin/web --ffmpeg /var/packages/ffmpeg/target/bin/ffmpeg root 10784 7660 2 22:53 ? 00:00:03 /var/packages/ffmpeg/target/bin/ffmpeg -analyzeduration 3000000 -rtsp_transport tcp -rtsp_transport udp -rtsp_flags prefer_tcp -fflags +igndts+genpts -f rtsp -i rtsp://183.59.168.27/PLTV/88888905/224/3221227346/10000100000000060000000003100521_0.smil?rrsip=125.88.104.45,rrsip=125.88.70.140&zoneoffset=480&icpid=1111116&accounttype=1&limitflux=-1&limitdur=-1&GuardEncType=2&accountinfo=%7E%7EV2.0%7ErN-BuTVrGNWqfRpgcaeoYA%7EApBzL3r_voXq10M-GWtX1pp12YK6-zQpQOUIOl0wbjEq730dUqnc_SjPYjiOQWwdythRrEf7Hp9ToXshxUNGDpwMHPmgDEdR_mdoJOtFf3o~ExtInfoWNHSPSTb+3AG0FnUkYLPMw==%3A20190922160629%2C10.157.14.51%2C20190922160629%2C02000001000000052013120900000001%2C2900877920190922160629%2C-1%2C0%2C1%2C%2C%2C7%2C%2C%2C%2C4%2CEND&it=H4sIAAAAAAAAAC2Oyw6CMBBF_6bLRijPRVcYExNTF6BbM8JQCQOtLZj49wKym5lzT-ZODmo8H-U4EzGPb2VkyGog6katTLOie1k8gkzwOOci5WHIqtU5EWh52KJqHp7o9mXxSnSfrkbZ-JZbgu_siHvbbfPN0Y4ZVvvvIE7yIBIiSbM4YtN6rcD3C2Ev8IUZLDhsLkZvgmyBPDILdQ8aFQz4L795V9csTX5bnL8A1QAAAA -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 copy -start_at_zero -flags -global_header -vsync -1 -acodec copy -strict -2 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_base_url hls/03605298a695a29cde33834f234b8b5e/ -hls_playlist_type event -hls_segment_filename /volume1/@appstore/jellyfin/var/data/transcodes/03605298a695a29cde33834f234b8b5e%d.ts -y /volume1/@appstore/jellyfin/var/data/transcodes/03605298a695a29cde33834f234b8b5e.m3u8 ``` **Additional context** <!-- Add any other context or screenshots about the feature request here. -->
Author
Owner

@DomiStyle commented on GitHub (Aug 12, 2023):

This sounds like a duplicate of https://github.com/jellyfin/jellyfin/issues/3929 and is fixed by https://github.com/jellyfin/jellyfin/pull/8744 .

Could probably close this?

@DomiStyle commented on GitHub (Aug 12, 2023): This sounds like a duplicate of https://github.com/jellyfin/jellyfin/issues/3929 and is fixed by https://github.com/jellyfin/jellyfin/pull/8744 . Could probably close this?
Author
Owner

@Shadowghost commented on GitHub (Aug 23, 2023):

Fixed in master by #8744

@Shadowghost commented on GitHub (Aug 23, 2023): Fixed in master by #8744
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#3220