Opened 9 years ago

Last modified 8 years ago

#4350 new defect

Concatenating split files of a Ikegami GFPack camera

Reported by: Steve Dierker Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mxf
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I have 4 files of a Ikegami GFPack camera and want to concatenate them to one single file. Problem is, as soon as FFmpeg reaches the second file it segfaults.
Files can be found here: https://cloud.obstkiste.org/index.php/s/I2OUb2s4n22cvT7

I also tried to encode the single files first and transcode them afterwards, but FFmpeg refuses to transcode every file except for the first one.

thanks,
steved

How to reproduce:

$ cat list.txt 
file '0001V001.MXF'
file '0001V002.MXF'
file '0001V003.MXF'
file '0001V004.MXF'
$ ffmpeg -f concat -i list.txt -c copy output.mxf
ffmpeg version N-70414-gec5a4af Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype
  libavutil      54. 19.100 / 54. 19.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 24.101 / 56. 24.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, concat, from 'list.txt':
  Duration: N/A, bitrate: 50000 kb/s
    Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, bt470bg), 1920x1080 [SAR 1:1 DAR 16:9], 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Output #0, mxf, to 'output.mxf':
  Metadata:
    encoder         : Lavf56.24.101
    Stream #0:0: Video: mpeg2video, yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[1]    24495 segmentation fault  ffmpeg -f concat -i list.txt -c copy output.mxf/s

Change History (8)

comment:1 by Steve Dierker, 9 years ago

Version: unspecifiedgit-master

comment:2 by Carl Eugen Hoyos, 8 years ago

Please upload the files again if the issue is still reproducible.

comment:3 by Steve Dierker, 8 years ago

The seqfault is fixed in the current git-master, but the files are still not encoded as expected.
FFmpeg is only encoding the first file and omits the other three. FFmpeg is even not able to encode the files 0001V002.MXF, 0001V003.MXF, 0001V004.MXF standalone.
You can find the sample files here:
http://dl.flavoursys.com/samples/ffmpeg/ikegami/0001V001.MXF
http://dl.flavoursys.com/samples/ffmpeg/ikegami/0001V002.MXF
http://dl.flavoursys.com/samples/ffmpeg/ikegami/0001V003.MXF
http://dl.flavoursys.com/samples/ffmpeg/ikegami/0001V004.MXF

$ cat list.txt 
file '0001V001.MXF'
file '0001V002.MXF'
file '0001V003.MXF'
file '0001V004.MXF'
$ ffmpeg version N-80023-gd55568d Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
  configuration: --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 42.100 / 57. 42.100
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 45.100 /  6. 45.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with argument 'concat'.
Reading option '-i' ... matched as input file with argument 'control.list'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'out.mxf' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file control.list.
Applying option f (force format) with argument concat.
Successfully parsed a group of options.
Opening an input file: control.list.
[file @ 0x34e6ba0] Setting default whitelist 'file,crypto'
[mxf @ 0x34ef6a0] Format mxf probed with size=2048 and score=100
[mxf @ 0x34ef6a0] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x34ef6a0] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x34ef6a0] mpeg2video: Universal Label: 060e2b34.0401.0103.04010202.01040300
[mxf @ 0x34ef6a0] Before avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5
[mxf @ 0x34ef6a0] Probe buffer size limit of 5000000 bytes reached
[mxf @ 0x34ef6a0] rfps: 29.416667 0.016336
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.500000 0.011786
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.583333 0.007977
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.666667 0.004910
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.750000 0.002583
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.833333 0.000997
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 29.916667 0.000152
    Last message repeated 1 times
[mxf @ 0x34ef6a0] rfps: 30.000000 0.000048
[mxf @ 0x34ef6a0] rfps: 60.000000 0.000192
[mxf @ 0x34ef6a0] rfps: 120.000000 0.000767
[mxf @ 0x34ef6a0] rfps: 240.000000 0.003067
[mxf @ 0x34ef6a0] rfps: 29.970030 0.000000
[mxf @ 0x34ef6a0] rfps: 59.940060 0.000000
[mxf @ 0x34ef6a0] After avformat_find_stream_info() pos: 5411332 bytes read:5655920 seeks:5 frames:25
[concat @ 0x34e63e0] Before avformat_find_stream_info() pos: 80 bytes read:80 seeks:0
[concat @ 0x34e63e0] file:0 stream:0 pts:2 pts_time:0.0667333 dts:-1 dts_time:-0.0333667 -> pts:2 pts_time:0.0667333 dts:-1 dts_time:-0.0333667
[concat @ 0x34e63e0] file:0 stream:0 pts:0 pts_time:0 dts:0 dts_time:0 -> pts:0 pts_time:0 dts:0 dts_time:0
[concat @ 0x34e63e0] file:0 stream:0 pts:1 pts_time:0.0333667 dts:1 dts_time:0.0333667 -> pts:1 pts_time:0.0333667 dts:1 dts_time:0.0333667
[concat @ 0x34e63e0] file:0 stream:0 pts:5 pts_time:0.166833 dts:2 dts_time:0.0667333 -> pts:5 pts_time:0.166833 dts:2 dts_time:0.0667333
[concat @ 0x34e63e0] file:0 stream:0 pts:3 pts_time:0.1001 dts:3 dts_time:0.1001 -> pts:3 pts_time:0.1001 dts:3 dts_time:0.1001
[concat @ 0x34e63e0] file:0 stream:0 pts:4 pts_time:0.133467 dts:4 dts_time:0.133467 -> pts:4 pts_time:0.133467 dts:4 dts_time:0.133467
[concat @ 0x34e63e0] file:0 stream:0 pts:8 pts_time:0.266933 dts:5 dts_time:0.166833 -> pts:8 pts_time:0.266933 dts:5 dts_time:0.166833
[concat @ 0x34e63e0] file:0 stream:0 pts:6 pts_time:0.2002 dts:6 dts_time:0.2002 -> pts:6 pts_time:0.2002 dts:6 dts_time:0.2002
[concat @ 0x34e63e0] file:0 stream:0 pts:7 pts_time:0.233567 dts:7 dts_time:0.233567 -> pts:7 pts_time:0.233567 dts:7 dts_time:0.233567
[concat @ 0x34e63e0] file:0 stream:0 pts:11 pts_time:0.367033 dts:8 dts_time:0.266933 -> pts:11 pts_time:0.367033 dts:8 dts_time:0.266933
[concat @ 0x34e63e0] file:0 stream:0 pts:9 pts_time:0.3003 dts:9 dts_time:0.3003 -> pts:9 pts_time:0.3003 dts:9 dts_time:0.3003
[concat @ 0x34e63e0] file:0 stream:0 pts:10 pts_time:0.333667 dts:10 dts_time:0.333667 -> pts:10 pts_time:0.333667 dts:10 dts_time:0.333667
[concat @ 0x34e63e0] file:0 stream:0 pts:14 pts_time:0.467133 dts:11 dts_time:0.367033 -> pts:14 pts_time:0.467133 dts:11 dts_time:0.367033
[concat @ 0x34e63e0] file:0 stream:0 pts:12 pts_time:0.4004 dts:12 dts_time:0.4004 -> pts:12 pts_time:0.4004 dts:12 dts_time:0.4004
[concat @ 0x34e63e0] file:0 stream:0 pts:13 pts_time:0.433767 dts:13 dts_time:0.433767 -> pts:13 pts_time:0.433767 dts:13 dts_time:0.433767
[concat @ 0x34e63e0] file:0 stream:0 pts:17 pts_time:0.567233 dts:14 dts_time:0.467133 -> pts:17 pts_time:0.567233 dts:14 dts_time:0.467133
[concat @ 0x34e63e0] file:0 stream:0 pts:15 pts_time:0.5005 dts:15 dts_time:0.5005 -> pts:15 pts_time:0.5005 dts:15 dts_time:0.5005
[concat @ 0x34e63e0] file:0 stream:0 pts:16 pts_time:0.533867 dts:16 dts_time:0.533867 -> pts:16 pts_time:0.533867 dts:16 dts_time:0.533867
[concat @ 0x34e63e0] file:0 stream:0 pts:20 pts_time:0.667333 dts:17 dts_time:0.567233 -> pts:20 pts_time:0.667333 dts:17 dts_time:0.567233
[concat @ 0x34e63e0] file:0 stream:0 pts:18 pts_time:0.6006 dts:18 dts_time:0.6006 -> pts:18 pts_time:0.6006 dts:18 dts_time:0.6006
[concat @ 0x34e63e0] file:0 stream:0 pts:19 pts_time:0.633967 dts:19 dts_time:0.633967 -> pts:19 pts_time:0.633967 dts:19 dts_time:0.633967
[concat @ 0x34e63e0] file:0 stream:0 pts:23 pts_time:0.767433 dts:20 dts_time:0.667333 -> pts:23 pts_time:0.767433 dts:20 dts_time:0.667333
[concat @ 0x34e63e0] file:0 stream:0 pts:21 pts_time:0.7007 dts:21 dts_time:0.7007 -> pts:21 pts_time:0.7007 dts:21 dts_time:0.7007
[concat @ 0x34e63e0] file:0 stream:0 pts:22 pts_time:0.734067 dts:22 dts_time:0.734067 -> pts:22 pts_time:0.734067 dts:22 dts_time:0.734067
[concat @ 0x34e63e0] file:0 stream:0 pts:26 pts_time:0.867533 dts:23 dts_time:0.767433 -> pts:26 pts_time:0.867533 dts:23 dts_time:0.767433
[concat @ 0x34e63e0] Probe buffer size limit of 5000000 bytes reached
[concat @ 0x34e63e0] After avformat_find_stream_info() pos: 80 bytes read:80 seeks:0 frames:25
Input #0, concat, from 'control.list':
  Duration: N/A, bitrate: 50000 kb/s
    Stream #0:0, 25, 1001/30000: Video: mpeg2video (4:2:2), 1 reference frame, yuv422p(tv, bt470bg, topleft), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn
    Metadata:
      file_package_umid: 0x060A2B34010101050101062013000000CE1D604AF0C2C9B342664F6B57F1DC88
Successfully opened the file.
Parsing a group of options: output file out.mxf.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: out.mxf.
[file @ 0x35fdc20] Setting default whitelist 'file,crypto'
Successfully opened the file.
[mxf @ 0x353eac0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mxf, to 'out.mxf':
  Metadata:
    encoder         : Lavf57.36.100
    Stream #0:0, 0, 1001/30000: Video: mpeg2video, 1 reference frame, yuv422p(tv, bt470bg, topleft), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn
    Metadata:
      file_package_umid: 0x060A2B34010101050101062013000000CE1D604AF0C2C9B342664F6B57F1DC88
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mxf @ 0x353eac0] essence container count:1
    Last message repeated 1 times
[mxf @ 0x353eac0] package type:1
[mxf @ 0x353eac0] package type:2
[mxf @ 0x353eac0] essence container count:1
[mxf @ 0x353eac0] edit units count 0
[concat @ 0x34e63e0] file:0 stream:0 pts:24 pts_time:0.8008 dts:24 dts_time:0.8008 -> pts:24 pts_time:0.8008 dts:24 dts_time:0.8008
[concat @ 0x34e63e0] file:0 stream:0 pts:25 pts_time:0.834167 dts:25 dts_time:0.834167 -> pts:25 pts_time:0.834167 dts:25 dts_time:0.834167
[...]
[concat @ 0x34e63e0] file:0 stream:0 pts:19199 pts_time:640.607 dts:19196 dts_time:640.507 -> pts:19199 pts_time:640.607 dts:19196 dts_time:640.507
[concat @ 0x34e63e0] file:0 stream:0 pts:19197 pts_time:640.54 dts:19197 dts_time:640.54 -> pts:19197 pts_time:640.54 dts:19197 dts_time:640.54
[concat @ 0x34e63e0] file:0 stream:0 pts:19198 pts_time:640.573 dts:19198 dts_time:640.573 -> pts:19198 pts_time:640.573 dts:19198 dts_time:640.573
[AVIOContext @ 0x34f7ee0] Statistics: 4004244402 bytes read, 5 seeks
[mxf @ 0x34f0740] Format mxf probed with size=2048 and score=100
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x34f0740] Before avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5
[mxf @ 0x34f0740] All info found
[mxf @ 0x34f0740] After avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5 frames:0
[AVIOContext @ 0x34e6c40] Statistics: 310100 bytes read, 5 seeks
[mxf @ 0x34f0740] Format mxf probed with size=2048 and score=100
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x34f0740] Before avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5
[mxf @ 0x34f0740] All info found
[mxf @ 0x34f0740] After avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5 frames:0
[AVIOContext @ 0x34f1420] Statistics: 310100 bytes read, 5 seeks
[mxf @ 0x34f0740] Format mxf probed with size=2048 and score=100
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x34f0740] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x34f0740] Before avformat_find_stream_info() pos: 65512 bytes read:119009 seeks:5
[mxf @ 0x34f0740] All info found
[mxf @ 0x34f0740] After avformat_find_stream_info() pos: 65512 bytes read:119009 seeks:5 frames:0
No more output streams to write to, finishing.
[mxf @ 0x353eac0] essence container count:1
[mxf @ 0x353eac0] edit units count 75
[mxf @ 0x353eac0] essence container count:1
    Last message repeated 1 times
[mxf @ 0x353eac0] package type:1
[mxf @ 0x353eac0] package type:2
frame=19200 fps=105 q=-1.0 Lsize= 3925466kB time=00:10:40.60 bitrate=50198.4kbits/s speed=3.52x    
video:3910092kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.393197%
Input file #0 (control.list):
  Input stream #0:0 (video): 19200 packets read (4003934278 bytes); 
  Total: 19200 packets (4003934278 bytes) demuxed
Output file #0 (out.mxf):
  Output stream #0:0 (video): 19200 packets muxed (4003934278 bytes); 
  Total: 19200 packets (4003934278 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x3540180] Statistics: 3 seeks, 132482 writeouts
[AVIOContext @ 0x34e6c40] Statistics: 119009 bytes read, 5 seeks
[AVIOContext @ 0x34eef40] Statistics: 80 bytes read, 0 seeks

Standalone:

$ ffmpeg -i 0001V002.MXF -loglevel debug out2.mxf                                                               [20:07:04]
ffmpeg version N-80023-gd55568d Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-14ubuntu2) 20160413
  configuration: --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 42.100 / 57. 42.100
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 45.100 /  6. 45.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument '0001V002.MXF'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option 'out2.mxf' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file 0001V002.MXF.
Successfully parsed a group of options.
Opening an input file: 0001V002.MXF.
[file @ 0x2597b20] Setting default whitelist 'file,crypto'
[mxf @ 0x2597360] Format mxf probed with size=2048 and score=100
[mxf @ 0x2597360] Dark key 06.0e.2b.34.02.53.01.01.0d.01.01.01.01.01.23.00
[mxf @ 0x2597360] Dark key 06.0e.2b.34.01.01.01.02.03.01.02.10.01.00.00.00
[mxf @ 0x2597360] Before avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5
[mxf @ 0x2597360] All info found
[mxf @ 0x2597360] After avformat_find_stream_info() pos: 65512 bytes read:310100 seeks:5 frames:0
Input #0, mxf, from '0001V002.MXF':
  Metadata:
    uid             : ab50ae15-ef3b-d7d8-59bc-27e12c7eba38
    generation_uid  : 3b544c31-b831-9418-ccb9-874ab1127471
    company_name    : Ikegami
    product_name    : GF
    product_version : 1.0
    product_uid     : 4844532d-5631-3020-4141-363931313645
    modification_date: 2015-01-26 10:54:51
    material_package_umid: 0x060A2B340101010501010D2013000000DC3DD46D5B6B770CA5396FD35CC9F687
    timecode        : 00:00:00:00
  Duration: N/A, bitrate: N/A
Successfully opened the file.
Parsing a group of options: output file out2.mxf.
Successfully parsed a group of options.
Opening an output file: out2.mxf.
Output #0, mxf, to 'out2.mxf':
Output file #0 does not contain any stream
[AVIOContext @ 0x259fec0] Statistics: 310100 bytes read, 5 seeks

comment:4 by Carl Eugen Hoyos, 8 years ago

Do I understand correctly that shorter samples do not allow to reproduce the issue?

comment:5 by Steve Dierker, 8 years ago

That is not what I meant.

These 4 files are generated by a Ikegami Camera and are actually one long take but split into 4 files by the camera. Trying to concatenate the files to one results in only having the video stream of the first file in the resulting file. This is the actual bug.
Additionally FFmpeg is only able to encode the first file of these 4 and complains for the other 3 that there are no streams present even so there are.

Did I make my self clear this time?

comment:6 by Carl Eugen Hoyos, 8 years ago

Which software plays the second file alone?

comment:7 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedavformat
Keywords: mxf added

comment:8 by ahmed, 8 years ago

use -f mpegvideo to join all the rest of the videos.
i am stock to join the audio files of the Ikegami :(

Last edited 8 years ago by ahmed (previous) (diff)
Note: See TracTickets for help on using tickets.