Opened 12 years ago

Closed 12 years ago

#2034 closed defect (invalid)

-f segment fails with "Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument"

Reported by: Ivan Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: segment
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description

I'm trying to split this file into multiple mpegts.

Fails only if -f segment. Works fine with -f mp4 out.mp4.. but i need to split into multiple outputs.

ffmpeg.exe -v 9 -loglevel 99 -i arrow.mp4 -c copy -map 0 -vbsf h264_mp4toannexb -f segment -segment_time 10 out%03d.ts

ffmpeg version N-47062-g26c531c Copyright (c) 2000-2012 the FFmpeg developers

built on Nov 25 2012 12:21:26 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runt

ime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass -
-enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enab
le-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-libo
pus --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheo
ra --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --ena
ble-zlib

libavutil 52. 9.100 / 52. 9.100
libavcodec 54. 77.100 / 54. 77.100
libavformat 54. 37.100 / 54. 37.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 23.102 / 3. 23.102
libswscale 2. 1.102 / 2. 1.102
libswresample 0. 17.101 / 0. 17.101
libpostproc 52. 2.100 / 52. 2.100

[mov,mp4,m4a,3gp,3g2,mj2 @ 0201b200] Format mov,mp4,m4a,3gp,3g2,mj2 probed with
size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0201b200] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0201b200] File position before avformat_find_stream_i
nfo() is 158935682
[h264 @ 04420900] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 0201b200] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0201b200] File position after avformat_find_stream_in
fo() is 713490
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'arrow.mp4':

Metadata:

major_brand : isom
minor_version : 1
compatible_brands: isom
creation_time : 2012-12-13 18:38:51

Duration: 00:21:18.19, start: 0.000000, bitrate: 994 kb/s

Stream #0:0(und), 12, 1/24000: Video: h264 (High) (avc1 / 0x31637661), yuv42

0p, 720x404, 1001/48000, 885 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc

Metadata:

creation_time : 2012-12-13 17:01:17
handler_name : GPAC ISO Video Handler

Stream #0:1(und), 1, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, ster

eo, s16, 104 kb/s

Metadata:

creation_time : 2012-12-13 18:38:51
handler_name : GPAC ISO Audio Handler

Output #0, segment, to 'outC:\Users\User\Desktop\ffmpeg segmeter.bat3d.ts':

Metadata:

major_brand : isom
minor_version : 1
compatible_brands: isom
encoder : Lavf54.37.100
Stream #0:0(und), 0, 1/90000: Video: h264 (avc1 / 0x31637661), yuv420p, 720x

404, 1001/24000, q=2-31, 885 kb/s, 23.98 fps, 90k tbn, 23.98 tbc

Metadata:

creation_time : 2012-12-13 17:01:17
handler_name : GPAC ISO Video Handler

Stream #0:1(und), 0, 1/90000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, ster

eo, 104 kb/s

Metadata:

creation_time : 2012-12-13 18:38:51
handler_name : GPAC ISO Audio Handler

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)

Could not write header for output file #0 (incorrect codec parameters ?): Invali
d argument
[AVIOContext @ 0201b820] Statistics: 750406 bytes read, 2 seeks

Change History (3)

comment:1 by Stefano Sabatini, 12 years ago

Unreproducible here, please attach the failing input file.

Also you may try with the latest version (current is around N-47330).

comment:2 by burek, 12 years ago

I don't know if this is relevant, but did you notice:

Output #0, segment, to 'outC:\Users\User\Desktop\ffmpeg segmeter.bat3d.ts':

It doesn't seem like a valid output to me.

If you are using the BAT file to start your ffmpeg, please take note that %0 represents a variable for BAT file (containing the file name of the running batch file), so it might be the cause of your issue.

Also the error returned by the ffmpeg could have been a little bit more precise, like "Cannot open file %s for writting", which would immediately show what's the issue.

Last edited 12 years ago by burek (previous) (diff)

in reply to:  2 comment:3 by Stefano Sabatini, 12 years ago

Analyzed by developer: set
Resolution: invalid
Status: newclosed

Replying to burek:

I don't know if this is relevant, but did you notice:

Output #0, segment, to 'outC:\Users\User\Desktop\ffmpeg segmeter.bat3d.ts':

It doesn't seem like a valid output to me.

If you are using the BAT file to start your ffmpeg, please take note that %0 represents a variable for BAT file (containing the file name of the running batch file), so it might be the cause of your issue.

Definitively this is not a segment-related bug, closing as invalid, please reopen if you think it is not.

Also the error returned by the ffmpeg could have been a little bit more precise, like "Cannot open file %s for writting", which would immediately show what's the issue.

Yes. This is historically due to the protocols not having a log context, this should be improved but it is clearly a separate issue.

Note: See TracTickets for help on using tickets.