nilaoda / N_m3u8DL-RE

Cross-Platform, modern and powerful stream downloader for MPD/M3U8/ISM. English/简体中文/繁體中文.
MIT License
4.76k stars 499 forks source link

Is it possible to convert generated ts file to mp4 using ffmpeg automatically, or just generate a mp4 on-the-fly? #423

Closed wnpllrzodiac closed 3 months ago

wnpllrzodiac commented 4 months ago

/opt/N_m3u8DL-RE/N_m3u8DL-RE "http://hello.com/sample.m3u8" --save-dir /mnt/mmc/tv/cctv5 --tmp-dir /mnt/mmc/tmp --live-record-limit 02:40:00 --live-pipe-mux --task-start-at 20240707025800

current file was a single ts file: index_2024-07-27_01-30-00.ts

nilaoda commented 3 months ago

You can try using custom LIVE PIPE MUX commands to invoke ffmpeg for this purpose

EnvironmentVariable RE_LIVE_PIPE_OPTIONS

wnpllrzodiac commented 3 months ago

@nilaoda thanks. RE_LIVE_PIPE_OPTIONS="-c copy /mnt/mmc/tv/cctv5/out.mp4" /opt/N_m3u8DL-RE/N_m3u8DL-RE "http://source.com/index.m3u8" --save-dir /mnt/mmc/tv/cctv5 --tmp-dir /mnt/mmc/tmp --live-record-limit 00:03:00 --live-pipe-mux It works.

But output filename should be hard-code(/mnt/mmc/tv/cctv5/out.mp4) and I cannot use origin output name generated automatically. Is there some placeholder can be used? e.g. CCTV5_HHmmss.mp4

wnpllrzodiac commented 3 months ago

RE_LIVE_PIPEOPTIONS="-c copy /mnt/mmc/tv/cctv5/`date "+%Y%m%d%H%M%S"`.mp4"

I set it to some time string of start-up time. Should work now.