Opened 4 years ago

Last modified 4 years ago

#5078 new defect

FFMPEG "loop=0" value results in warnings and extremely long runtime

Reported by: eric Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When attempting to replace the audio stream of an MP4 video with looping MP3 audio, FFmpeg begins going very slowly and generating warnings like the one below at the point when the audio starts looping.

[mp4 @ 0x7fd80a00e200] Non-monotonous DTS in output stream 0:1; previous: 678336, current: 832; changing to 678337. This may result in incorrect timestamps in the output file.

How to reproduce:

% ffmpeg -i video.mp4 -f lavfi -i "amovie=filename=audio.mp3:loop=0" -map 0:v -map 1:a -shortest -c:v copy output.mp4

Running the above command takes ~5 minutes for a 30 second video.mp4 and a 15 second audio.mp3. The resulting video at face value appears to be correct (it plays correctly, the audio was replaced, and the audio loops as expected).

If I remove the "loop=0" option, the resulting output.mp4 is only 15 seconds (as expected since the audio doesn't loop), but it's generated in less than 0.5 seconds on my machine.

Attached report file has the result of running the command with "-v 9 -loglevel 99 -report" options also specified. The resulting report was over 100 MB (due to all the warnings) so I replaced the majority of them with "..." to keep the file size down.

Tested with FFMPEG 2.8.3 on Mac OS X 10.11.1.

Possibly related to:
https://trac.ffmpeg.org/ticket/1799
https://trac.ffmpeg.org/ticket/1670
https://trac.ffmpeg.org/ticket/3315

Attachments (4)

ffmpeg-20151208-192018.log (10.1 KB) - added by eric 4 years ago.
Report log
audio.mp3 (16.4 KB) - added by eric 4 years ago.
Sample 1s audio file
video.mp4 (2.1 MB) - added by eric 4 years ago.
Sample 3s video file
ffmpeg-20151209-125328.log (1.9 MB) - added by eric 4 years ago.
New report log using sample audio and video

Change History (10)

Changed 4 years ago by eric

Report log

comment:1 follow-up: Changed 4 years ago by cehoyos

Is the issue reproducible with current FFmpeg git head?

comment:2 Changed 4 years ago by cehoyos

  • Component changed from ffmpeg to undetermined

comment:3 in reply to: ↑ 1 Changed 4 years ago by eric

Replying to cehoyos:

Is the issue reproducible with current FFmpeg git head?

Sorry about not including that. I confirmed the issue is also affecting git head as well as 2.8.3.

comment:4 Changed 4 years ago by eric

  • Version changed from 2.8.3 to git-master

comment:5 follow-up: Changed 4 years ago by cehoyos

Please provide input files and command lines including complete, uncut console output with default verbosity for current FFmpeg.

Changed 4 years ago by eric

Sample 1s audio file

Changed 4 years ago by eric

Sample 3s video file

Changed 4 years ago by eric

New report log using sample audio and video

comment:6 in reply to: ↑ 5 Changed 4 years ago by eric

Replying to cehoyos:

Please provide input files and command lines including complete, uncut console output with default verbosity for current FFmpeg.

Due to the file size limits, I wasn't able to provide the original sources, but I was able to reproduce the issue using a 1 second audio.mp3 and a 3 second video.mp4. They've been attached to the ticket. Since the video is 3 seconds, the resulting output (which still takes multiple minutes to generate) has the video from video.mp4 and the audio from audio.mp3 looped 3 times.

I included the log file (ffmpeg-20151209-125328.log​) generated running this command-line but I did need to trim 90K lines from the middle in order to meet the file upload size restriction.

% ffmpeg -report -i video.mp4 -f lavfi -i "amovie=filename=audio.mp3:loop=0" -map 0:v -map 1:a -shortest -c:v copy output.mp4
Note: See TracTickets for help on using tickets.