Code Monkey home page Code Monkey logo

Comments (7)

nihil-admirari avatar nihil-admirari commented on September 27, 2024

From the comments to http://michael-peeters.blogspot.com/2019/03/hanging-m3u8-downloads-in-ffmpeg.html?m=1:

Apparently ffmpeg has a flag named "rw_timeout" that should enforce a read timeout on the TCP socket. By default it has a value of -1, meaning that in the worst case it would hang forever. I'll give that a try before I go tinyproxy.
Edit: Since it looks you're also using youtube-dl, you would be able to specify this flag like so: youtube-dl --external-downloader-args '-rw_timeout 10000000' ...

Have you tried that? If it works, then making yt-dlp pass -rw_timeout would be easier than patching FFmpeg.

from ffmpeg-builds.

nihil-admirari avatar nihil-admirari commented on September 27, 2024

The patch from FFmpeg/FFmpeg@master...bsenftner:FFmpeg:master doesn't seem to be usable: it simply makes av_read_frame call a given callback, but no default callback is provided. Apparently the patch was done to support that guy's ffvideo, since the example uses the callback from ffvideo:

AVFormatContext* p_format_context = avformat_alloc_context();
p_format_context->interrupt_callback.callback = FFVideo_FrameMgr::interrupt_callback;
p_format_context->interrupt_callback.opaque = mp_frameMgr;

from ffmpeg-builds.

h82b8 avatar h82b8 commented on September 27, 2024

From the comments to http://michael-peeters.blogspot.com/2019/03/hanging-m3u8-downloads-in-ffmpeg.html?m=1:

Apparently ffmpeg has a flag named "rw_timeout" that should enforce a read timeout on the TCP socket. By default it has a value of -1, meaning that in the worst case it would hang forever. I'll give that a try before I go tinyproxy.
Edit: Since it looks you're also using youtube-dl, you would be able to specify this flag like so: youtube-dl --external-downloader-args '-rw_timeout 10000000' ...

Have you tried that? If it works, then making yt-dlp pass -rw_timeout would be easier than patching FFmpeg.

Yeah, I tried that before and it didn't change the behavior I described.

from ffmpeg-builds.

h82b8 avatar h82b8 commented on September 27, 2024

Sorry fat fingered the close comment.

The patch from FFmpeg/[email protected]:FFmpeg:master doesn't seem to be usable: it simply makes av_read_frame call a given callback, but no default callback is provided. Apparently the patch was done to support that guy's ffvideo, since the example uses the callback from ffvideo:

AVFormatContext* p_format_context = avformat_alloc_context();
p_format_context->interrupt_callback.callback = FFVideo_FrameMgr::interrupt_callback;
p_format_context->interrupt_callback.opaque = mp_frameMgr;

I see, well I guess then the only thing I can try would be the proxy unless you have another idea?

from ffmpeg-builds.

nihil-admirari avatar nihil-admirari commented on September 27, 2024

RSTP does not respect -rw_timeout: https://fftrac-bg.ffmpeg.org/ticket/7609.

Try -timeout and -stimeout. There are also -reconnect options.

If none work: you can try asking in the main repo to forcefully kill FFmpeg on timeout if it haven't written anything to stdout/stderr (not sure how it would interactive with resume download though).

from ffmpeg-builds.

h82b8 avatar h82b8 commented on September 27, 2024

RSTP does not respect -rw_timeout: https://fftrac-bg.ffmpeg.org/ticket/7609.

Try -timeout and -stimeout. There are also -reconnect options.

If none work: you can try asking in the main repo to forcefully kill FFmpeg on timeout if it haven't written anything to stdout/stderr (not sure how it would interactive with resume download though).

I tried the -timeout/-stimeout commands before but i give -reconnect a shot, I'll report back if this helps or I'll find something else.

thanks for the help so far :)

from ffmpeg-builds.

h82b8 avatar h82b8 commented on September 27, 2024

I tried out all the commands, none of them worked.

Randomly it still just hangs and then sits forever waiting, until I end it by 2x ctrl+c

I googled around some more and found a couple of people that describe the same issue but none with a solution.

So I guess I'll now wait until someone responds from the mailing list @ ffmpeg, if someone has any other idea what I can try in the meantime, I'll be happy to hear it.

from ffmpeg-builds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.