Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9207897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:29:28+00:00 2026-06-18T00:29:28+00:00

I use ffmpeg to decode RTSP video.It likes that: When it’s on the end

  • 0

I use ffmpeg to decode RTSP video.It likes that:
When it’s on the end of file,it block in the av_read_frame() for a long time,why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:29:29+00:00Added an answer on June 18, 2026 at 12:29 am

    Various reasons can cause long blocking. But you can control the processing time for a I/O layer.

    Use the structure AVFormatContext::interrupt_callback to set the interrupt handler.

    class timeout_handler {
      public:
        timeout_handler(unsigned int t) : timeout_ms_(TimeoutMs){}
    
        void reset(unsigned int 0) {
          timeout_ms_ = TimeoutMs;
          lastTime_ = my_get_local_time();
        }
    
        bool is_timeout(){
          const my_time_duration actualDelay = my_get_local_time() - lastTime_;
          return actualDelay > timeout_ms_;
        }
    
        static int check_interrupt(void * t) {
           return t && static_cast<timeout_handler *>(t)->is_timeout();
        }
    
     public:
       unsigned int timeout_ms_;
       my_time_t lastTime_;      
     };
    
    
     /// .................
     AVFormatContext * ic;
     timeout_handler * th = new timeout_handler(kDefaultTimeout);
     /// .................
     ic->interrupt_callback.opaque = (void*)th ;
     ic->interrupt_callback.callback = &timeout_handler::check_interrupt;
     /// open input
     // avformat_open_input(ic, ... );
     // etc
    
     /// .................
     /// before any I/O operations, for example:
     th->reset(kDefaultTimeout);
     int e = AVERROR(EAGAIN);
     while (AVERROR(EAGAIN) == e) 
      e = av_read_frame(ic, &packet);
     // If the time exceeds the limit, then the process interruped at the next IO operation.   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to be able to use FFmpeg to convert a video file from
How can I use ffmpeg functions to decode video to images and then again
I have a buffer that contain packets read by ffmpeg from a video file
I am trying to decode audio samples from various file formats using ffmpeg. Therefore
i have been trying to decode an MP3 file to pcm, using ffmpeg API,
I use ffmpeg to capture screenshot from video. Here is the command code: ffmpeg
I understand that you can use ffmpeg to serve a sequence of images as
I use ffmpeg to decode flv frame to yuv420p.But I don't know how to
I want to use ffmpeg (in its c library form) to split a video
I am wanting to use ffmpeg to convert video to .flv in php. Currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.