the duration (-t) option seems to be ignore

Bug #1818363 reported by Jason
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ffmpeg (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

previous to upgrading to 18.04 from 16.04 I scripted to ffmpeg to capture a video feed for 30 mins. Now the capture only lasts for about 30 secs.

Command,
  ffmpeg -t 1800 -i rtsp:<source> -vcodec libx264 -y "<dest>"

$ lsb_release -rd
Description: Ubuntu 18.04.2 LTS
Release: 18.04

$ apt-cache policy ffmpeg
ffmpeg:
  Installed: 7:3.4.2-2
  Candidate: 7:3.4.4-0ubuntu0.18.04.1
  Version table:
     7:3.4.4-0ubuntu0.18.04.1 500
        500 http://ca.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
 *** 7:3.4.2-2 500
        500 http://ca.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

Note I tried version 7:3.4.4 but same result.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ffmpeg 7:3.4.2-2
ProcVersionSignature: Ubuntu 4.15.0-45.48-generic 4.15.18
Uname: Linux 4.15.0-45-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
Date: Sat Mar 2 15:22:37 2019
SourcePackage: ffmpeg
UpgradeStatus: Upgraded to bionic on 2019-03-02 (0 days ago)

Revision history for this message
Jason (jprokopowich) wrote :
Jason (jprokopowich)
description: updated
Revision history for this message
James Cowgill (jcowgill) wrote :

What's the output of that ffmpeg command?

Note that the -t option is an upper limit on the duration. If your input is already shorter than that, it will have no effect.

Changed in ffmpeg (Ubuntu):
status: New → Incomplete
Revision history for this message
Jason (jprokopowich) wrote :
Download full text (22.4 KiB)

Output below. The feed is an IP camera so it is a constant stream. I am setting up another Ubuntu 16.04 instance to see if that still works.

$ cat /tmp/output
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu2)
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avutil configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libs...

Revision history for this message
Jason (jprokopowich) wrote :

I confirmed the same command works on,
$ lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

$ apt-cache policy ffmpeg
ffmpeg:
  Installed: 7:2.8.15-0ubuntu0.16.04.1
  Candidate: 7:2.8.15-0ubuntu0.16.04.1
  Version table:
 *** 7:2.8.15-0ubuntu0.16.04.1 500
        500 http://ca.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     7:2.8.6-1ubuntu2 500
        500 http://ca.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

James Cowgill (jcowgill)
Changed in ffmpeg (Ubuntu):
status: Incomplete → New
Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

You are using an input option (it used to be a global option in the past) that apparently does not (or cannot) work for your input, please use the output option that is supposed to work as expected.

Revision history for this message
Jason (jprokopowich) wrote :

Using the "-to" option doesn't work either. If this is not the option you mean please advise on the option I should be using.

Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

Instead of the input option "-t" (that used to be a global option) please use the output option "-t".

Revision history for this message
Jason (jprokopowich) wrote :

I have tried the "-t" before the output URL with the same result. The command exits prematurely.

Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

How does the console output look without any "-t" option specified?

Revision history for this message
Jason (jprokopowich) wrote :
Download full text (22.6 KiB)

as requested .... output without the "-t" option,

$ ffmpeg -hwaccel_device vdpau -i rtsp://admin:<password>@192.168.0.97:554/cgi/mjpg/mjpeg.cgi -vcodec libx264 -y -loglevel verbose "/tmp/out.mp4"
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu2)
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avutil configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libsh...

Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

Do you agree that the issue is (most likely) unrelated to the option -t?

Please run git bisect to find the change introducing the issue, the alternative would be to provide a public rtsp stream (that may not be stable enough to reproduce).

Revision history for this message
Jason (jprokopowich) wrote :

I have proven that this works in a previous version so I am relucktant to agree that this is not related to the "-t" option. Do you want to see the output from that version (using previous LTS version of Ubuntu)?

Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

The console output of an earlier working version may be helpful.

Revision history for this message
Jason (jprokopowich) wrote :
Download full text (32.0 KiB)

as you can see I have -t 120 with the output below with no issue,

$ ffmpeg -t 120 -hwaccel_device vdpau -i rtsp://admin:<paasword>@192.168.0.97:554/cgi/mjpg/mjpeg.cgi -vcodec libx264 -y -loglevel verbose /tmp/out.mpg
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil 54. 31.100 / 54. 31.100
  libavcodec 56. 60.100 / 56. 60.100
  libavformat 56. 40.101 / 56. 40.101
  libavdevice 56. 4.100 / 56. 4.100
  libavfilter 5. 40.101 / 5. 40.101
  libavresample 2. 1. 0 / 2. 1. 0
  libswscale 3. 1.101 / 3. 1.101
  libswresample 1. 2.101 / 1. 2.101
  libpostproc 53. 3.100 / 53. 3.100
[rtsp @ 0x80b140] SDP:
v=0
o=- 1552556527950000 1552556527950000 IN IP4 192.168.0.97
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://192.168.0.97:554/cgi/mjpg/mjpeg.cgi/
m=video 0 RTP/AVP 26
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=control:rtsp://192.168.0.97:554/cgi/mjpg/mjpeg.cgi/trackID=1
a=rtpmap:26 JPEG/90000
a=Media_header:MEDIAINFO=494D4B48010100000400040000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0

[mjpeg @ 0x80dea0] Changeing bps to 8
Input #0, rtsp, from 'rtsp://admin:<password>@192.168.0.97:554/cgi/mjpg/mjpeg.cgi':
  Metadata:
    title : Media Presentation
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown), 704x480 [SAR 1:1 DAR 22:15], 30 tbr, 90k tbn, 90k tbc
[graph 0 input from stream 0:0 @ 0x932d60] w:704 h:480 pixfmt:yuvj420p tb:1/90000 fr:30/1 sar:1/1 sws_param:flags=2
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x835d20] using SAR=1/1
[libx264 @ 0x835d20] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 @ 0x835d20] profile High, level 3.0
[mpeg @ 0x837e80] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some spec...

Revision history for this message
Carl Eugen Hoyos (cehoyos) wrote :

Isn't the point of this bug report that current FFmpeg quits after 30 seconds while older FFmpeg works for longer - completely independent of the "-t" option?
Anyway, please run git bisect to find the change introducing the issue as I don't think there is another way to understand this issue.
FFmpeg compilation by default produces static libraries and a binary that you do not have to install, it can be tested from the build directory, the issue should be reproducible with "./configure && make ffmpeg" if you use "-vcodec mpeg4 -qscale 5" as encoder.

Revision history for this message
Jason (jprokopowich) wrote :

Here are the ffmpeg versions,

capture doesn't work past 30 secs,
7:3.4.2-2
And yes, it seems that the "-t" is independent of the issue because if -t is to set 10 then that capture stops at 10 secs.

capture does work past 30 secs,
7:2.8.15-0ubuntu0.16.04.1

Changed in ffmpeg (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for ffmpeg (Ubuntu) because there has been no activity for 60 days.]

Changed in ffmpeg (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.