Opened 8 years ago

Last modified 8 years ago

#4951 reopened defect

Different frame rate using ts and mov containers

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

Description

I am using a udp video source @ 1080i, 25FPS, 25K bitrate, when I output into a .ts and use ffprobe the file shows 25 fps, 50 tbr, 90k tbn, 50 tbc

I then change the file extension to be a mov and probe the file i get the following output 50 fps, 50 tbr, 90k tbn, 50 tbc.

I am using the following command but just changing the file extension

ffmpeg -i udp://@239.200.90.1:11080 -vcodec copy -acodec pcm_s16le -top 1 /tmp/interlaced1080.mov

The output from ffmpeg is the following

Output #0, mov, to '/tmp/interlaced1080.mov':

Metadata:

encoder : Lavf56.40.101
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
Stream #0:1: Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s

Which displays the it is outputting into the file at 25 fps but this isn't the same when I use ffprobe on the finished file.

My version and build information is as follows

ffmpeg version 2.8.1-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2015 the FFmpeg developers

built with gcc 4.9.3 (Debian 4.9.3-4)

Change History (17)

comment:1 by Carl Eugen Hoyos, 8 years ago

Component: ffmpegundetermined
Keywords: mpegts added; ts frame rate incorrect removed

Is the issue reproducible with current FFmpeg git head? Please provide your command line together with the complete, uncut console output of current FFmpeg git head to make this a valid ticket.

Please explain which playback application plays which of the two output samples with wrong speed.

comment:2 by Liam, 8 years ago

I am using the latest static build available from the ffmpeg website. I have also tried this with the latest ffmpeg deb build.

ffmpeg version 2.8.1-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (Debian 4.9.3-4)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --cc=gcc-4.9
  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
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

The command line I used to wrap into the ts container is:

ffmpeg -i udp://@239.200.90.1:11080 -vcodec copy -acodec pcm_s16le -top 1 /tmp/interlaced1080.ts 

the command line i used to wrap into the mov container is:

ffmpeg -i udp://@239.200.90.1:11080 -vcodec copy -acodec pcm_s16le -top 1 /tmp/interlaced1080.ts

Other than changing the file extensions these are the exact same command. When I probe the files after I have finished writing to them, the frame rate is different in the mov than in the ts. As you can see I am using copy option for the video codec and as the source is @ 25FPS i am not aware of any reason why these should differ.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 8 years ago

Replying to liamf91:

I am using the latest static build available from the ffmpeg website.

The FFmpeg website does not provide any builds, only source code.

I have also tried this with the latest ffmpeg deb build.

Then please provide command line including complete, uncut console output to make this a valid ticket.

When I probe the files after I have finished writing to them, the frame rate is different in the mov than in the ts.

And what effect does this have? I mean, is one of the files working and the other not?

comment:4 by Liam, 8 years ago

OK, the ffmpeg website provides a link to a static build.

Output from the deb build

ffmpeg version 2.6.4 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265 --enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Working? It depends what you mean by working? Do they play in a media player? Yes. Are they at the expected frame rate? No.

You seem to be missing my point. When I output the file in a ts container the video is @ 25FPS, when I then output the file into a mov container this then changes to 50FPS. Nothing changes with the source which is at 25FPS and nothing changes with the commands I have used, other than the file extension, which I have included examples of in my previous comment.

comment:5 by Carl Eugen Hoyos, 8 years ago

Resolution: needs_more_info
Status: newclosed

Please reopen this ticket if you can provide the command line that allows to reproduce the issue together with the complete, uncut console output.

comment:6 by Liam, 8 years ago

I can provide a file which you can use to reproduce what I have mentioned. The commands will just be as i mentioned earlier but instead of using the udp stream you will just specify the file.

Does ffmpeg offer anywhere I can upload the file as it is quite a large file (16GB~)?

comment:7 by Carl Eugen Hoyos, 8 years ago

Before you upload a sample please test current FFmpeg git head and provide command line together with complete, uncut console output.
If the issue is also reproducible with file input, please provide such a command line, issues with network input are much harder to reproduce.

comment:8 by Liam, 8 years ago

I have written video data from a stream to a .ts file using -codec copy. The file is 1080i 25FPS 25Mb/s bitrate.

I have then tried to convert the file using the latest git head and the following is the command and console output.

ffmpeg -i ffmpeg_test_video.ts -vcodec copy -acodec pcm_s24le -top 1 ffmpeg_test_video.mov
ffmpeg version N-76159-gda43e9e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  8.100 / 57.  8.100
  libavformat    57. 10.101 / 57. 10.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 12.100 /  6. 12.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mpegts, from 'ffmpeg_test_video.ts':
  Duration: 00:04:59.95, start: 1.450600, bitrate: 25138 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 127 kb/s
[mov @ 0x34b9780] Codec for stream 0 does not use global headers but container format requires global headers
Output #0, mov, to 'ffmpeg_test_video.mov':
  Metadata:
    encoder         : Lavf57.10.101
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s
    Metadata:
      encoder         : Lavc57.8.100 pcm_s24le
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
frame=14955 fps= 95 q=-1.0 Lsize=  932056kB time=00:04:59.96 bitrate=25454.1kbits/s
video:847498kB audio:84366kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.020640%

I then use ffprobe on the finished file with the following output.

ffprobe ffmpeg_test_video.mov
ffprobe version N-76159-gda43e9e Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-x11grab --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libdc1394 --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
  libavutil      55.  4.100 / 55.  4.100
  libavcodec     57.  8.100 / 57.  8.100
  libavformat    57. 10.101 / 57. 10.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 12.100 /  6. 12.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ffmpeg_test_video.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.10.101
  Duration: 00:04:59.97, start: 0.000000, bitrate: 25454 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23211 kb/s, 50 fps, 50 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      handler_name    : DataHandler

As you can see the file is showing 50FPS although when I was running the first command it claimed that the file output is at 25FPS.

The file I have used as the source is 900MB, just an FYI you would like me to upload it somewhere.

Thanks

comment:9 by Liam, 8 years ago

Resolution: needs_more_info
Status: closedreopened

comment:10 by Carl Eugen Hoyos, 8 years ago

How did you create the input file?

comment:11 by Liam, 8 years ago

The input file was created via a udp stream coming from a hardware encoder. The command i used was the following

ffmpeg -i udp://230.100.1.1:1234 -vcodec copy -acodec copy -top 1 ffmpeg_test_video.ts

comment:12 by Carl Eugen Hoyos, 8 years ago

(I am not sure this creates a valid stream, the mpegts muxer is known not to be perfect.)

There are three possibilities (actually certainly more) to save the network stream:
$ ffmpeg -f data -i udp://230.100.1.1:1234 -map 0 -codec copy -f data out1.ts
$ mplayer udp://230.100.1.1:1234 -dumpstream
$ tools/aviocat udp://230.100.1.1:1234 out3.ts

You can build aviocat with make tools/aviocat.

comment:13 by Carl Eugen Hoyos, 8 years ago

Version: 2.8.1git-master

comment:14 by Liam, 8 years ago

I have used the first example you supplied to create a source file. After running the same command in my previous comment I am left with the same output.

ffmpeg -i out1.ts -vcodec copy -acodec pcm_s24le -top 1 ffmpeg_test_video_1.mov
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags=                                                           '-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthr                                                           eads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-                                                           amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-                                                           libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enab                                                           le-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-                                                           linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --ena                                                           ble-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab -                                                           -enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx26                                                           5 --enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
[h264 @ 0x1a05b00] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1a05b00] decode_slice_header error
[h264 @ 0x1a05b00] no frame!
Input #0, mpegts, from 'out1.ts':
  Duration: 00:06:59.35, start: 64924.324611, bitrate: 24467 kb/s
  Program 1
    Stream #0:0[0x21]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn                                                           , 50 tbc
    Stream #0:1[0x24]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 142 kb/s
Output #0, mov, to 'ffmpeg_test_video_1.mov':
  Metadata:
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s
    Metadata:
      encoder         : Lavc56.26.100 pcm_s24le
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
frame=20957 fps=7217 q=-1.0 Lsize= 1332132kB time=00:06:59.35 bitrate=26023.2kbits/s
video:1213927kB audio:117936kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.020201%

This is a probe of the output file

ffprobe ffmpeg_test_video_1.mov
ffprobe version 2.6.3 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags=                                                           '-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthr                                                           eads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-                                                           amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-                                                           libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enab                                                           le-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-                                                           linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --ena                                                           ble-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab -                                                           -enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx26                                                           5 --enable-libiec61883 --enable-vaapi --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ffmpeg_test_video_1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf56.25.101
  Duration: 00:06:59.33, start: 0.022000, bitrate: 26024 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23725 kb/s, 50 fps, 50 tbr, 9                                                           0k tbn, 50 tbc (default)
    Metadata:
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      handler_name    : DataHandler

in reply to:  14 comment:15 by Carl Eugen Hoyos, 8 years ago

Replying to liamf91:

ffmpeg -i out1.ts -vcodec copy -acodec pcm_s24le -top 1 ffmpeg_test_video_1.mov
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers

So the issue is not reproducible with current FFmpeg git head?

Anyway: Please upload 20MB or so of the input transport stream (or more if you want).

comment:16 by Liam, 8 years ago

Sorry, I did it on a different server. I've just ran it again and I've had the same outcome.

I've uploaded the full file. If you would like me to cut it down I will do (it's 1.3GB)

https://drive.google.com/file/d/0B9ptbF3j-FOjblM4bzc4YWp5MGc/view?usp=sharing

comment:17 by Liam, 8 years ago

Something I have noticed with this is that if i change the source to be progressive rather than interlaced the correct frame rate is shown.

Note: See TracTickets for help on using tickets.