[FFmpeg-user] Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

RITESH MEHANDIRATTA riteshmehandiratta at gmail.com
Wed Jun 5 05:39:50 CEST 2013


Detailed description of the problem


i am a beginner in ffmpeg .i read the ffmpeg tool documentation
http://ffmpeg.org/ffmpeg.html .i i read encoder guideline
http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide i have to rtp stream a
mp4 file.i write a command

ffmpeg -re -i sample.mp4 -c:v libx264 -c:a libfdk_aac -f rtp rtp://
127.0.0.1:1234 > 100011.sdp

what i am trying to accomplish is first encode audio and vidoe stream of
the file then stream using rtp protocol then generating corresponsing sdp
file and use this sdp file for receiving end (wowza media server).when i
use above command.i am getting error

Could not write header for output file #0 (incorrect codec parameters ?):
Invalid argument what should be the argument we have to provide for
encoding this mp4 file ?? please guideline !!

i read about vcodec they are used frequently without using parameters

an example in documentation is

ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT

where INPUT and OUTPUT are file names .please guide line and full response
by the command is

root at ritesh-desktop:/usr/local/WowzaMediaServer/content# ffmpeg -re -i
sample.mp4 -c:v libx264 -c:a libfdk_aac -f rtp rtp://127.0.0.1:1234 >
100011.sdp
ffmpeg version git-2013-06-03-c8faa47 Copyright (c) 2000-2013 the
FFmpeg developers
  built on Jun  3 2013 23:34:11 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --extra-libs=-ldl --enable-gpl --enable-libass
--enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libspeex --enable-libtheora
--enable-libvorbis --enable-libopus --enable-libvpx --enable-x11grab
--enable-libfaac --enable-libx264 --enable-nonfree --enable-version3
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 15.100 / 55. 15.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 74.101 /  3. 74.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf52.73.0
  Duration: 00:09:56.46, start: 0.000000, bitrate: 524 kb/s
    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 424x240, 420 kb/s, 24 fps, 24 tbr, 24 tbn, 48
tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 99 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : DataHandler
[libx264 @ 0x9b15560] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x9b15560] profile High, level 2.1
[rtp @ 0x9b15060] Only one stream supported in the RTP muxer
Output #0, rtp, to 'rtp://127.0.0.1:1234':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf55.8.102
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 424x240,
q=-1--1, 90k tbn, 24 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : DataHandler
    Stream #0:1(eng): Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 139 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (aac -> libfdk_aac)
Could not write header for output file #0 (incorrect codec parameters
?): Invalid argument

please guideline about parameters of different encoders and decoders ??



On Wed, Jun 5, 2013 at 8:27 AM, RITESH MEHANDIRATTA <
riteshmehandiratta at gmail.com> wrote:

> i am a beginner in ffmpeg tool . i am trying to encode a video and audio
> stream of a sample.mp4 file .i am using this command
>
> ffmpeg -re -i sample.mp4 -c:v libx264 -c:a libfdk_aac -f rtp rtp://
> 127.0.0.1:1234 > 100011.sdp
>
> what i am trying to accomplish is i am first streaming thes both streams
> then generating corresponsinf sdp file and use this sdp file for receiving
> end (wowza media server).when i use above command.i am getting error
>
> Could not write header for output file #0 (incorrect codec parameters ?):
> Invalid argument what should be the argument we have to provide for
> encoding this mp4 file ?? please guideline !!
>


More information about the ffmpeg-user mailing list