[FFmpeg-trac] #9160(ffmpeg:new): ffmpeg stuck at initialization

FFmpeg trac at avcodec.org
Wed May 5 23:33:29 EEST 2021

#9160: ffmpeg stuck at initialization
             Reporter:  Gyan        |                    Owner:  (none)
                 Type:  defect      |                   Status:  new
             Priority:  important   |                Component:  ffmpeg
              Version:  git-master  |               Resolution:
             Keywords:  regression  |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
Comment (by jeeb):

 Alright, so I seem to have isolated where it goes loop-de-loop.

 1. `transcode_step` first of all does `choose_output`.
 2. Since the stream is not yet initialized, it gets returned.
 3. `transcode_step` only sleeps and resets the "I need to sleep now for a
 bit" flag thing if it did not receive any stream from `choose_output`.
 4. Thus, the thing doesn't progress.

 I will have to see how this logic will look in the end, but for now a diff
 that seems to improve the situation:
 --- a/fftools/ffmpeg.c
 +++ b/fftools/ffmpeg.c
 @@ -3957,8 +3957,10 @@ static OutputStream *choose_output(void)
                  "cur_dts is invalid st:%d (%d) [init:%d i_done:%d
 finish:%d] (this is harmless if it occurs once at the start per
                  ost->st->index, ost->st->id, ost->initialized,
 ost->inputs_done, ost->finished);

 -        if (!ost->initialized && !ost->inputs_done)
 -            return ost;
 +        if (!ost->initialized && !ost->inputs_done) {
 +            av_log(NULL, AV_LOG_VERBOSE, "Noope, not initialized
 +            return ost->unavailable ? NULL : ost;
 +        }

          if (!ost->finished && opts < opts_min) {
              opts_min = opts;

Ticket URL: <https://trac.ffmpeg.org/ticket/9160#comment:14>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list