Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#6139 closed defect (fixed)

stream_loop produces a "Error while filtering: Operation not permitted"

Reported by: Jononas Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: stream_loop mov edts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I've tried to loop a short mp4 file with the -stream_loop parameter and get a Error while filtering: Operation not permitted

ffmpeg -report -hide_banner -y
-stream_loop -1 -i /home/nas/loop.mp4
-c:v libx264 -b:v 5M -s 1280x720 -r 50 -pix_fmt yuv420p -c:a libfdk_aac -b:a 192k -ac 2 -ar 44100
-f flv -fflags +genpts+igndts rtmp://[host]/rtmp/monitor_loop

You can find the loop.mp4 and the report log in the attachments.
It plays once and fails, if it wants to loop.
And I get the error:

Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
Error while filtering: Operation not permittede=00:00:04.66 bitrate=3724.6kbits/s speed=1.53x
[flv @ 0xa05be0] Failed to update header with correct duration.
[flv @ 0xa05be0] Failed to update header with correct filesize.}}}

Attachments (2)

loop.mp4 (1.3 MB ) - added by Jononas 7 years ago.
Sample File
ffmpeg-20170210-211529.log (87.8 KB ) - added by Jononas 7 years ago.
ffmpeg -report file

Download all attachments as: .zip

Change History (7)

by Jononas, 7 years ago

Attachment: loop.mp4 added

Sample File

by Jononas, 7 years ago

Attachment: ffmpeg-20170210-211529.log added

ffmpeg -report file

comment:1 by Jononas, 7 years ago

I found out my file have only one keyframe and starts with negative time stamps.
In libavformat/mov.c a offset is calculated but not used in the mov_seek_stream.
The start_time is not set in mov.c and so av_index_search_timestamp used '0' as start_time.

comment:2 by Carl Eugen Hoyos, 7 years ago

Component: avformatundetermined
Keywords: stream_loop edst added
Priority: importantnormal

For future tickets: Please always provide both the command line that allows to reproduce an issue and the complete, uncut console output for a valid ticket.

$ ffmpeg -stream_loop 2 -i loop.mp4 -qscale 2 out.avi
ffmpeg version N-83477-gd96ebc5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-opengl
  libavutil      55. 46.100 / 55. 46.100
  libavcodec     57. 77.100 / 57. 77.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 73.100 /  6. 73.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'loop.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.56.100
  Duration: 00:00:05.02, start: 0.000000, bitrate: 2181 kb/s
    Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p, 1280x720 [SAR 1:1 DAR 16:9], 1908 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 4.0, fltp, 269 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    ISFT            : Lavf57.66.102
    Stream #0:0(eng): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 50 fps, 50 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.77.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 4.0, fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.77.100 ac3
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
Error while filtering: Operation not permitted=00:00:02.78 bitrate=4796.7kbits/s speed=5.56x
frame=  240 fps=0.0 q=2.0 Lsize=    3126kB time=00:00:04.99 bitrate=5130.5kbits/s speed=5.49x
video:2873kB audio:234kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.617069%

comment:3 by Carl Eugen Hoyos, 7 years ago

Keywords: edts added; edst removed

comment:4 by Carl Eugen Hoyos, 6 years ago

Component: undeterminedavformat
Keywords: mov added
Resolution: fixed
Status: newclosed

comment:5 by Carl Eugen Hoyos, 6 years ago

Thank you for the report and the fix!

Note: See TracTickets for help on using tickets.