Opened 4 years ago

Closed 3 years ago

#2187 closed defect (fixed)

Cannot create a raw DV file out of an AVI/DVSD file

Reported by: TeeAlk Owned by:
Priority: important Component: avformat
Version: git-master Keywords: regression dvvideo avi
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I cannot create a raw DV file out of an AVI file created with Lightworks. I get the message "Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument" and there is a strange setting 1/90000 in both the output's video and audio stream instead of 1/25 (video, PAL) & 1/48000 (audio). It worked with an older version of ffmpeg but I cannot tell you since when this problem exists. I tried both commands:

ffmpeg -input.avi target pal-dv output.dv
ffmpeg -i input.avi -map 0 -f dv -pix_fmt yuv420p -r 25 -ar 48000 -ac 2 output.dv

Here's what I have for you

ffmpeg version N-49166-g205b2d2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 23 2013 13:40:58 with gcc 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5.1)
  configuration: --enable-gpl --enable-ffplay --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
  libavutil      52. 15.100 / 52. 15.100
  libavcodec     54. 90.100 / 54. 90.100
  libavformat    54. 61.103 / 54. 61.103
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 33.100 /  3. 33.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'input.avi'.
Reading option '-target' ... matched as option 'target' (specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)) with argument 'pal-dv'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument 'debug'.
Reading option 'output.dv' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file input.avi.
Successfully parsed a group of options.
Opening an input file: input.avi.
[avi @ 0xb15d2e0] Format avi probed with size=2048 and score=100
[avi @ 0xb15d840] use odml:1
[avi @ 0xb15d2e0] non-interleaved AVI
[avi @ 0xb15d2e0] File position before avformat_find_stream_info() is 33804
[avi @ 0xb15d2e0] parser not found for codec dvvideo, packets or times may be invalid.
[avi @ 0xb15d2e0] parser not found for codec pcm_s16le, packets or times may be invalid.
[avi @ 0xb15d2e0] parser not found for codec dvvideo, packets or times may be invalid.
[avi @ 0xb15d2e0] parser not found for codec pcm_s16le, packets or times may be invalid.
[avi @ 0xb15d2e0] All info found
[avi @ 0xb15d2e0] File position after avformat_find_stream_info() is 324616
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : EditShare AVI v3.0.0.0 
    timecode        : 00:00:00.00
  Duration: 00:03:34.00, start: 0.000000, bitrate: 30528 kb/s
    Stream #0:0, 1, 1/25: Video: dvvideo (dvsd / 0x64737664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 1/25, 25 tbr, 25 tbn, 25 tbc
    Stream #0:1, 1, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Successfully openened the file.
Parsing a group of options: output file output.dv.
Applying option target (specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)) with argument pal-dv.
Successfully parsed a group of options.
Opening an output file: output.dv.
Successfully openened the file.
[buffer @ 0xb164f20] Setting entry with key 'video_size' to value '720x576'
[buffer @ 0xb164f20] Setting entry with key 'pix_fmt' to value '0'
[buffer @ 0xb164f20] Setting entry with key 'time_base' to value '1/25'
[buffer @ 0xb164f20] Setting entry with key 'pixel_aspect' to value '16/15'
[buffer @ 0xb164f20] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 0xb164f20] Setting entry with key 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0xb146140] w:720 h:576 pixfmt:yuv420p tb:1/25 fr:25/1 sar:16/15 sws_param:flags=2
[scale @ 0xb1462e0] Setting 'w' to value '720'
[scale @ 0xb1462e0] Setting 'h' to value '576'
[scale @ 0xb1462e0] Setting 'flags' to value '0x4'
[scaler for output stream 0:0 @ 0xb145c40] w:720 h:576 flags:'0x4' interl:0
[scaler for output stream 0:0 @ 0xb145c40] w:720 h:576 fmt:yuv420p sar:16/15 -> w:720 h:576 fmt:yuv420p sar:16/15 flags:0x4
[abuffer @ 0xb146ce0] Setting entry with key 'time_base' to value '1/48000'
[abuffer @ 0xb146ce0] Setting entry with key 'sample_rate' to value '48000'
[abuffer @ 0xb146ce0] Setting entry with key 'sample_fmt' to value 's16'
[abuffer @ 0xb146ce0] Setting entry with key 'channel_layout' to value '0x3'
[graph 1 input from stream 0:1 @ 0xb147040] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3
[aformat @ 0xb147940] Setting entry with key 'sample_fmts' to value 's16'
[aformat @ 0xb147940] Setting entry with key 'sample_rates' to value '48000'
[aformat @ 0xb147940] Setting entry with key 'channel_layouts' to value '0x3'
[dvvideo @ 0xb15dc80] detected 2 logical cores
[dvvideo @ 0xb1635c0] detected 2 logical cores
[dv @ 0xb1651c0] Drop frame is only allowed with 30000/1001 FPS
Output #0, dv, to 'output.dv':
  Metadata:
    timecode        : 00:00:00.00
    encoder         : Lavf54.61.103
    Stream #0:0, 0, 1/90000: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3], 1/25, q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1, 0, 1/90000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo -> dvvideo)
  Stream #0:1 -> #0:1 (pcm_s16le -> pcm_s16le)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Statistics: 471680 bytes read, 10 seeks

I don't know where that number 1/90000 comes from and why my settings in the second command are ignored.

Attachments (2)

ticket2187.avi (2.5 MB) - added by cehoyos 3 years ago.
workaround.diff (396 bytes) - added by cehoyos 3 years ago.

Change History (8)

comment:1 Changed 4 years ago by cehoyos

  • Component changed from FFmpeg to undetermined
  • Keywords regression dvvideo added
  • Version changed from unspecified to git-master

Please provide an input sample that allows to reproduce the problem and command line including complete uncut console output of a working version if this is a regression.

comment:2 Changed 3 years ago by TeeAlk

I found an old working version of ffmpeg (64bit, static) somewhere on my Windows 7 HDD. This is it:

% ffmpeg -loglevel debug -i input.avi -target pal-dv output.dv

ffmpeg version N-32138-g312645e, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 28 2011 21:15:09 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51. 14. 0 / 51. 14. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53. 10. 0 / 53. 10. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 35. 0 /  2. 35. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[avi @ 00000000003FEFA0] Format avi probed with size=2048 and score=100
[AVI demuxer @ 00000000003FF680] use odml:1
[avi @ 00000000003FEFA0] non-interleaved AVI
[dvvideo @ 00000000003FF940] Unsupported bit depth: 0
[avi @ 00000000003FEFA0] parser not found for codec dvvideo, packets or times may be invalid.
[avi @ 00000000003FEFA0] parser not found for codec pcm_s16le, packets or times may be invalid.
[avi @ 00000000003FEFA0] All info found
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : EditShare AVI v3.0.0.0
    ISMP            : 00:00:00.00
  Duration: 00:03:34.00, start: 0.000000, bitrate: 30528 kb/s
    Stream #0.0, 1, 1/25: Video: dvvideo (dvsd / 0x64737664), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 1/25, 25 tbr, 25 tbn, 25 tbc
    Stream #0.1, 1, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s
[buffer @ 00000000002F0500] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:16/15 sws_param:
[dvvideo @ 0000000003AEDA80] Unsupported bit depth: 0
[dvvideo @ 00000000003FF940] Unsupported bit depth: 0
Output #0, dv, to 'output.dv':
  Metadata:
    ISMP            : 00:00:00.00
    encoder         : Lavf53.10.0
    Stream #0.0, 0, 1/90000: Video: dvvideo, yuv420p, 720x576 [SAR 16:15 DAR 4:3], 1/25, q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1, 0, 1/90000: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
  Stream #0.0 -> #0.0: dvvideo -> dvvideo
  Stream #0.1 -> #0.1: pcm_s16le -> pcm_s16le
Press [q] to stop, [?] for help
frame=   64 fps=  0 q=0.0 size=    8859kB time=00:00:02.52 bitrate=28800.0kbits/
frame=  125 fps=121 q=0.0 size=   17438kB time=00:00:04.98 bitrate=28676.7kbits/
frame=  182 fps=118 q=0.0 size=   25453kB time=00:00:07.24 bitrate=28800.0kbits/
frame=  241 fps=117 q=0.0 size=   33750kB time=00:00:09.60 bitrate=28800.0kbits/
frame=  300 fps=117 q=0.0 size=   42047kB time=00:00:11.96 bitrate=28800.0kbits/
frame=  360 fps=117 q=0.0 size=   50484kB time=00:00:14.36 bitrate=28800.0kbits/
frame=  422 fps=117 q=0.0 size=   59203kB time=00:00:16.84 bitrate=28800.0kbits/
frame=  478 fps=116 q=0.0 size=   67078kB time=00:00:19.08 bitrate=28800.0kbits/
frame=  535 fps=115 q=0.0 size=   75094kB time=00:00:21.36 bitrate=28800.0kbits/
frame=  593 fps=115 q=0.0 size=   83250kB time=00:00:23.68 bitrate=28800.0kbits/
frame=  652 fps=115 q=0.0 size=   91547kB time=00:00:26.04 bitrate=28800.0kbits/
frame=  711 fps=115 q=0.0 size=   99844kB time=00:00:28.40 bitrate=28800.0kbits/
frame=  769 fps=115 q=0.0 size=  108000kB time=00:00:30.72 bitrate=28800.0kbits/
frame=  829 fps=115 q=0.0 size=  116438kB time=00:00:33.12 bitrate=28800.0kbits/
frame=  888 fps=115 q=0.0 size=  124734kB time=00:00:35.48 bitrate=28800.0kbits/
frame=  949 fps=115 q=0.0 size=  133313kB time=00:00:37.92 bitrate=28800.0kbits/
frame= 1010 fps=115 q=0.0 size=  141891kB time=00:00:40.36 bitrate=28800.0kbits/
frame= 1074 fps=116 q=0.0 size=  150891kB time=00:00:42.92 bitrate=28800.0kbits/
frame= 1134 fps=116 q=0.0 size=  159328kB time=00:00:45.32 bitrate=28800.0kbits/
frame= 1196 fps=116 q=0.0 size=  168047kB time=00:00:47.80 bitrate=28800.0kbits/
frame= 1260 fps=117 q=0.0 size=  177047kB time=00:00:50.36 bitrate=28800.0kbits/
frame= 1323 fps=117 q=0.0 size=  185906kB time=00:00:52.88 bitrate=28800.0kbits/
frame= 1382 fps=117 q=0.0 size=  194203kB time=00:00:55.24 bitrate=28800.0kbits/
frame= 1442 fps=117 q=0.0 size=  202641kB time=00:00:57.64 bitrate=28800.0kbits/
frame= 1502 fps=117 q=0.0 size=  211078kB time=00:01:00.04 bitrate=28800.0kbits/
frame= 1562 fps=117 q=0.0 size=  219516kB time=00:01:02.44 bitrate=28800.0kbits/
frame= 1622 fps=117 q=0.0 size=  227953kB time=00:01:04.84 bitrate=28800.0kbits/
frame= 1687 fps=117 q=0.0 size=  237094kB time=00:01:07.44 bitrate=28800.0kbits/
frame= 1752 fps=117 q=0.0 size=  246234kB time=00:01:10.04 bitrate=28800.0kbits/
frame= 1816 fps=118 q=0.0 size=  255234kB time=00:01:12.60 bitrate=28800.0kbits/
frame= 1877 fps=118 q=0.0 size=  263813kB time=00:01:15.04 bitrate=28800.0kbits/
frame= 1942 fps=118 q=0.0 size=  272953kB time=00:01:17.64 bitrate=28800.0kbits/
frame= 2007 fps=118 q=0.0 size=  282094kB time=00:01:20.24 bitrate=28800.0kbits/
frame= 2078 fps=119 q=0.0 size=  292078kB time=00:01:23.08 bitrate=28800.0kbits/
frame= 2142 fps=119 q=0.0 size=  301078kB time=00:01:25.64 bitrate=28800.0kbits/
frame= 2207 fps=119 q=0.0 size=  310219kB time=00:01:28.24 bitrate=28800.0kbits/
frame= 2272 fps=119 q=0.0 size=  319359kB time=00:01:30.84 bitrate=28800.0kbits/
frame= 2338 fps=120 q=0.0 size=  328641kB time=00:01:33.48 bitrate=28800.0kbits/
frame= 2405 fps=120 q=0.0 size=  338063kB time=00:01:36.16 bitrate=28800.0kbits/
frame= 2475 fps=120 q=0.0 size=  347906kB time=00:01:38.96 bitrate=28800.0kbits/
frame= 2532 fps=120 q=0.0 size=  355922kB time=00:01:41.24 bitrate=28800.0kbits/
frame= 2590 fps=120 q=0.0 size=  364078kB time=00:01:43.56 bitrate=28800.0kbits/
frame= 2646 fps=120 q=0.0 size=  371953kB time=00:01:45.80 bitrate=28800.0kbits/
frame= 2704 fps=119 q=0.0 size=  380109kB time=00:01:48.12 bitrate=28800.0kbits/
frame= 2763 fps=119 q=0.0 size=  388406kB time=00:01:50.48 bitrate=28800.0kbits/
frame= 2823 fps=119 q=0.0 size=  396844kB time=00:01:52.88 bitrate=28800.0kbits/
frame= 2884 fps=119 q=0.0 size=  405422kB time=00:01:55.32 bitrate=28800.0kbits/
frame= 2945 fps=119 q=0.0 size=  414000kB time=00:01:57.76 bitrate=28800.0kbits/
frame= 3007 fps=119 q=0.0 size=  422719kB time=00:02:00.24 bitrate=28800.0kbits/
frame= 3070 fps=119 q=0.0 size=  431578kB time=00:02:02.76 bitrate=28800.0kbits/
frame= 3133 fps=119 q=0.0 size=  440438kB time=00:02:05.28 bitrate=28800.0kbits/
frame= 3195 fps=119 q=0.0 size=  449156kB time=00:02:07.76 bitrate=28800.0kbits/
frame= 3256 fps=119 q=0.0 size=  457734kB time=00:02:10.20 bitrate=28800.0kbits/
frame= 3318 fps=119 q=0.0 size=  466453kB time=00:02:12.68 bitrate=28800.0kbits/
frame= 3377 fps=119 q=0.0 size=  474750kB time=00:02:15.04 bitrate=28800.0kbits/
frame= 3434 fps=119 q=0.0 size=  482766kB time=00:02:17.32 bitrate=28800.0kbits/
frame= 3492 fps=119 q=0.0 size=  490922kB time=00:02:19.64 bitrate=28800.0kbits/
frame= 3549 fps=119 q=0.0 size=  498938kB time=00:02:21.92 bitrate=28800.0kbits/
frame= 3610 fps=119 q=0.0 size=  507516kB time=00:02:24.36 bitrate=28800.0kbits/
frame= 3671 fps=119 q=0.0 size=  516094kB time=00:02:26.80 bitrate=28800.0kbits/
frame= 3730 fps=119 q=0.0 size=  524391kB time=00:02:29.16 bitrate=28800.0kbits/
frame= 3788 fps=119 q=0.0 size=  532547kB time=00:02:31.48 bitrate=28800.0kbits/
frame= 3846 fps=119 q=0.0 size=  540703kB time=00:02:33.80 bitrate=28800.0kbits/
frame= 3903 fps=118 q=0.0 size=  548719kB time=00:02:36.08 bitrate=28800.0kbits/
frame= 3965 fps=118 q=0.0 size=  557438kB time=00:02:38.56 bitrate=28800.0kbits/
frame= 4024 fps=118 q=0.0 size=  565734kB time=00:02:40.92 bitrate=28800.0kbits/
frame= 4085 fps=118 q=0.0 size=  574313kB time=00:02:43.36 bitrate=28800.0kbits/
frame= 4145 fps=118 q=0.0 size=  582750kB time=00:02:45.76 bitrate=28800.0kbits/
frame= 4204 fps=118 q=0.0 size=  591047kB time=00:02:48.12 bitrate=28800.0kbits/
frame= 4263 fps=118 q=0.0 size=  599344kB time=00:02:50.48 bitrate=28800.0kbits/
frame= 4323 fps=118 q=0.0 size=  607781kB time=00:02:52.88 bitrate=28800.0kbits/
frame= 4382 fps=118 q=0.0 size=  616078kB time=00:02:55.24 bitrate=28800.0kbits/
frame= 4442 fps=118 q=0.0 size=  624516kB time=00:02:57.64 bitrate=28800.0kbits/
frame= 4502 fps=118 q=0.0 size=  632953kB time=00:03:00.04 bitrate=28800.0kbits/
frame= 4563 fps=118 q=0.0 size=  641531kB time=00:03:02.48 bitrate=28800.0kbits/
frame= 4626 fps=118 q=0.0 size=  650391kB time=00:03:05.00 bitrate=28800.0kbits/
frame= 4693 fps=118 q=0.0 size=  659813kB time=00:03:07.68 bitrate=28800.0kbits/
frame= 4761 fps=119 q=0.0 size=  669375kB time=00:03:10.40 bitrate=28800.0kbits/
frame= 4827 fps=119 q=0.0 size=  678656kB time=00:03:13.04 bitrate=28800.0kbits/
frame= 4893 fps=119 q=0.0 size=  687938kB time=00:03:15.68 bitrate=28800.0kbits/
frame= 4966 fps=119 q=0.0 size=  698203kB time=00:03:18.60 bitrate=28800.0kbits/
frame= 5040 fps=119 q=0.0 size=  708609kB time=00:03:21.56 bitrate=28800.0kbits/
frame= 5099 fps=119 q=0.0 size=  716906kB time=00:03:23.92 bitrate=28800.0kbits/
frame= 5161 fps=119 q=0.0 size=  725625kB time=00:03:26.40 bitrate=28800.0kbits/
frame= 5222 fps=119 q=0.0 size=  734203kB time=00:03:28.84 bitrate=28800.0kbits/
frame= 5280 fps=119 q=0.0 size=  742359kB time=00:03:31.16 bitrate=28800.0kbits/
frame= 5338 fps=119 q=0.0 size=  750516kB time=00:03:33.50 bitrate=28797.1kbits/
frame= 5350 fps=119 q=0.0 Lsize=  752344kB time=00:03:34.00 bitrate=28800.0kbits/s
video:752344kB audio:40125kB global headers:0kB muxing overhead -5.063291%

I guess I was wrong with my idea about the bug because there is that 1/90000 number too. I still think this is a wrong setting but at least it works.

About a sample: This could be difficult because of the private character of all films. Let me see what I can do. Maybe there is something neutral, a blue sky or whatever, without any person. Could take some time. Sorry. But there is nothing special about. It's old Hi8 or Digital8 material (recorded with a JVC Hi8 camcorder and a SONY D8 camcorder, PAL, some films in 4:3 some in 16:9) put together in Lightworks and exported as AVI with DV/DVCAM compression.

Version 0, edited 3 years ago by TeeAlk (next)

comment:4 Changed 3 years ago by TeeAlk

Uploaded the sample to your "incoming" folder as "ticket#2187-error-while-creating-raw-dv.avi" (with a very short description in "ticket#2187-error-while-creating-raw-dv.txt").

comment:5 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords avi added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

Regression since 9846a9c, works fine with 0.11.2

(Previously broken in 7b2dba1)

Changed 3 years ago by cehoyos

Changed 3 years ago by cehoyos

comment:6 Changed 3 years ago by michael

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.