Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIPE to FFMPEG? #162

Open
dromicron opened this issue Apr 19, 2023 · 31 comments
Open

PIPE to FFMPEG? #162

dromicron opened this issue Apr 19, 2023 · 31 comments
Labels
enhancement New feature or request

Comments

@dromicron
Copy link

hi, i try to use pipe function but i only get .TS file
it is possible to pipe to ffmpeg to make live hls output?

@nilaoda nilaoda added the enhancement New feature or request label Apr 19, 2023
@atuctuc
Copy link

atuctuc commented Apr 19, 2023

yes, i would also appreciate it if it could redirect the output to a unix pipe!!

nilaoda added a commit that referenced this issue Jun 14, 2023
@edgar017
Copy link

@nilaoda how to use live pipe options?

@nilaoda
Copy link
Owner

nilaoda commented Jun 15, 2023

@nilaoda how to use live pipe options?

For example:

set RE_LIVE_PIPE_OPTIONS="-c copy -f flv rtmp://your-streaming-server-url/your-stream-key"

N_m3u8DL-RE.exe --live-real-time-merge --live-pipe-mux "http://path/to/a.mpd"

This will change the command line used for mixing streams and output it to the server you specify. You can also output it as HLS segments by set specific value of RE_LIVE_PIPE_OPTIONS.

On Linux, If you only want it to take effect on a specific command line:

RE_LIVE_PIPE_OPTIONS="..." ./N_m3u8DL-RE ...

@edgar017
Copy link

@nilaoda Very thanks!

@Shporterator
Copy link

Shporterator commented Jun 18, 2023

I noticed that in this mode, temporary files are not deleted after completion. The folder remains
The command looks like this. Maybe I did something wrong?

RE_LIVE_PIPE_OPTIONS="-c copy -f mpegts pipe:1" /home/N_m3u8DL-RE --log-level off --tmp-dir /tmp --no-log --ffmpeg-binary-path /home/ffmpeg --decryption-binary-path /home/mp4decrypt --key 0:0 "$URL" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" --del-after-done true --mp4-real-time-decryption true --live-keep-segments false --live-real-time-merge true --live-pipe-mux true --thread-count 3 -sv best -sa all

And I also noticed that errors in the image periodically freezes if you use this method. I can't figure out what this is related to yet. I tried different versions of ffmpeg, the result is the same

@liimee
Copy link

liimee commented Jun 27, 2023

I noticed that in this mode, temporary files are not deleted after completion.

@Shporterator have you figured this out? noticed this too

@Shporterator
Copy link

have you figured this out?

No.
Do you have any problems with the video when using this method?

@liimee
Copy link

liimee commented Jun 27, 2023

And I also noticed that errors in the image periodically freezes if you use this method.

what do you mean by periodically freezes? the stream/pipe stops?

@Shporterator
Copy link

what do you mean by periodically freezes? the stream/pipe stops?

During the loading of new fragments, the image stops for a few seconds, the sound continues to work normally.

@liimee
Copy link

liimee commented Jun 27, 2023

I think that happens to me too... the video fragment loads way slower (pauses for a moment) than the audio

@nilaoda
Copy link
Owner

nilaoda commented Jun 27, 2023

You can try set a smaller value for --live-wait-time

@Shporterator
Copy link

You can try set a smaller value for --live-wait-time

Problem remains

@nilaoda
Copy link
Owner

nilaoda commented Jun 28, 2023

@Shporterator Then there's nothing I can do. 🫠

@Shporterator
Copy link

Then there's nothing I can do.

Very sad

@Shporterator
Copy link

Then there's nothing I can do.

This problem is absolutely with any streams, which makes this new feature useless:(

@andremxmx
Copy link

Then there's nothing I can do.

This problem is absolutely with any streams, which makes this new feature useless:(

Yep i have the same problem, fo now just do this, maybe you do the same as me for now

N_m3u8DL-RE.exe
--save-dir stream
--del-after-done true
--save-name tNoticias
--tmp-dir temp
"url"
--live-real-time-merge true
--live-wait-time 5
--mp4-real-time-decryption true
--live-pipe-mux
-sv best
-sa all
--key xxxxxxxxxx:xxxxxxxxx
--use-system-proxy true
--custom-proxy http://xxx.xxxx.xxx.xxx:3128

FFMPEG

ffmpeg.exe
-re
-i stream/tNoticias.ts
-c copy -f hls
-hls_time 5
-hls_list_size 4
-hls_flags delete_segments
C:/wamp64/www/bin/m3u8/tNoticias.m3u8

@Shporterator
Copy link

Yep i have the same problem, fo now just do this, maybe you do the same as me for now

How can I contact you?

@andremxmx
Copy link

Telegram: @cursoryapp_uy

Yep i have the same problem, fo now just do this, maybe you do the same as me for now

How can I contact you?

@andremxmx
Copy link

Now working grate no jittler or audio loss or stuck, perfect!! thanks!

@alphalneo
Copy link

alphalneo commented Oct 7, 2023

To me the problem seems to be the output
Vid 1920x1080 | 5499 Kbps | 50 00m38s/00m55s 16/23 Recording 69% 0.00Bps(1) ⣟
Aud 129 Kbps | ita | 2CH 00m38s/00m55s 16/23 Recording 69% 0.00Bps(1) ⣯
Can we suppress easily?

Edited: Yes I confirmed, I changed pipe:1 to pipe:2 I sent the stdout to dev null and finally I resent stderr to stdout and evrything is working!!! Therefore is the contamination of the std out that create the problem

@michaelarnauts
Copy link

To me the problem seems to be the output Vid 1920x1080 | 5499 Kbps | 50 00m38s/00m55s 16/23 Recording 69% 0.00Bps(1) ⣟ Aud 129 Kbps | ita | 2CH 00m38s/00m55s 16/23 Recording 69% 0.00Bps(1) ⣯ Can we suppress easily?

Edited: Yes I confirmed, I changed pipe:1 to pipe:2 I sent the stdout to dev null and finally I resent stderr to stdout and evrything is working!!! Therefore is the contamination of the std out that create the problem

Could you share the full command that you used to make this work?

@alphalneo
Copy link

alphalneo commented Oct 12, 2023

Sure, I am using linux

RE_LIVE_PIPE_OPTIONS="-c copy -f mpegts pipe:2" /MYPATH/N_m3u8DL-RE --log-level off --no-date-info --no-log True THEURLOFYOURSTREAM --del-after-done true --mp4-real-time-decryption true --live-keep-segments false --live-real-time-merge true --live-pipe-mux true --thread-count 3 -sv best -sa all --concurrent-download --save-dir pippo_FOLDER 2>&1 >/dev/null

The output is N_m3u8DL-RE is done on STDERR, I am sending the SDTOUT to a devnull and I am sending the STDERR to STDOUT

@alphalneo
Copy link

Waiting for a solution, for now I solved in this way
modify this line
var progress = AnsiConsole.Progress().AutoClear(true);
which you can find in 3 files
with this
var progress = AnsiConsole.Progress().AutoClear(true).AutoRefresh( DownloaderConfig.MyOptions.LogLevel != LogLevel.OFF );

nilaoda added a commit that referenced this issue Oct 14, 2023
@alphalneo
Copy link

Thank you!

@JohnTrabusca
Copy link

@nilaoda is it possible to change the pipe file location (RE_pipe_dc3a37d4-9ef7-482f-975a-e6a6fa6579bf) to another folder instead of /tmp ?

@nilaoda
Copy link
Owner

nilaoda commented Nov 13, 2023

@nilaoda is it possible to change the pipe file location (RE_pipe_dc3a37d4-9ef7-482f-975a-e6a6fa6579bf) to another folder instead of /tmp ?

Latest Actions version supported RE_LIVE_PIPE_TMP_DIR environment var.

@JohnTrabusca
Copy link

@nilaoda It still creates to the default /tmp after setting the new path per example: /tmp/ramdisk

Not sure if I'm doing something wrong.

@nilaoda
Copy link
Owner

nilaoda commented Nov 14, 2023

@JohnTrabusca

RE_LIVE_PIPE_TMP_DIR="/data/my_temp" ./N_m3u8DL-RE xxx

@JohnTrabusca
Copy link

After setting and doing a stat to that file (RE_pipe) in the given path in logs, it cannot be found.

@neorom23
Copy link

Hello. There is such a link mpd...

https://vs12.vcdn.biz/ea7c2a50874e06892616c81fed8764f1_mgg/vod/mpd/b/450_900_1350_1500_2000_5000/u_sid/0/o/176166551/rsid/8a209735-8af0-46f9-afc9-5aae98954316/u_uid/1546846946/u_vod/4/u_device/cms_html5/u_devicekey/_site/u_srvc/2741/te/1760354712/u_did/web_ufUvWAJW4hh3VWBsJtUHNwHAi8JtabBU/wtrmrk/0/manifest.mpd

The program N_m3u8DL-RE 0.2.0 Beta normally downloads temporary video mp4 files 142 pieces (each size 10.0 MB), adds the disputed one 143 piece and the last one has a file size of 1.5 GB. Collect together the mp4 files have a size of - 2.11 GB with a duration of 01:15:38, although it should be 1.39 GB with a duration of 00:49:59 (only the video without sound and subtitles)

Here are the options available on the command line - N_m3u8DL-RE "%mpd%" --check-segments-count:false --save-name "02" --key 7d91116c8f0b95b8db4953f1f26e6aa2:5a4491ef67bc263c0 125c5914322dfba

yt-dlp - this program load normally video size 1.39 GB

@dark125
Copy link

dark125 commented Apr 18, 2024

There is a problem with this option RE_LIVE_PIPE_TMP_DIR="/tmp/channel", the pipe file keeps being created in the /tmp/ folder and N_m3u8DL-RE looks for that file in /tmp/channel/, that's why it gives an error
/tmp/channel/RE_pipe_f2eee6bf-6068-43aa-b36a-ac8bca0e5677: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests