Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation while i converting my video to FLV using ffmpeg-php,i am getting these errors,Help!!

    while i converting my video to FLV using ffmpeg-php,i am getting these below errors as well as with 0kb of file size,help is greatly appreciated!!

    Actually my code is::::

    $srcFile = "raj.mpeg";
    $destFile = "clock.flv";
    $ffmpegPath = "/usr/bin/ffmpeg";
    $flvtool2Path = "/usr/bin/flvtool2";

    // Create our FFMPEG-PHP class
    $ffmpegObj = new ffmpeg_movie($srcFile);

    // Save our needed variables
    $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
    $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
    $srcFPS = $ffmpegObj->getFrameRate();
    $srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
    $srcAR = $ffmpegObj->getAudioSampleRate();

    // Call our convert using exec()
    system($ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile);


    //echo $command;

    //system($command);
    function makeMultipleTwo ($value) {
    if ($value % 2)
    return $value - 1;
    else
    return $value;
    }


    the Output is:::

    ERROR: undefined method `timestamp' for nil:NilClass ERROR: /usr/local/lib/site_ruby/1.8/flv/stream.rb:285:in `lasttimestamp' ERROR: /usr/local/lib/site_ruby/1.8/flv/stream.rb:274:in `duration' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:181:in `add_meta_data_tag' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:137:in `update' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:47:in `send' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:47:in `execute!' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:46:in `each' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:46:in `execute!' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:206:in `process_files' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:44:in `execute!' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2.rb:168:in `execute!' ERROR: /usr/local/lib/site_ruby/1.8/flvtool2.rb:228 ERROR: /usr/bin/flvtool2:2:in `require' ERROR: /usr/bin/flvtool2:2

    But my ffmpeg is loaded without any errors..while i place this

    extension_loaded('ffmpeg') or die('Error in loading ffmpeg');

    Shall anybody know how to fix this Code or anything wrongly given in the ffmpeg-php system command parameter..please help

    while i execute manually in server :::


    [ps63591]$ /usr/bin/ffmpeg -i raj.mpeg -f flv -s 720x576 clock.flv |
    /usr/bin/flvtool2 -U stdin clock.flv
    ffmpeg version 0.7.6, Copyright (c) 2000-2011 the FFmpeg developers
    built on Oct 13 2011 06:32:34 with gcc 4.4.5
    configuration: --prefix=/usr --enable-pthreads --enable-libx264
    --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-gpl
    --enable-nonfree --enable-shared
    libavutil 50. 43. 0 / 50. 43. 0
    libavcodec 52.122. 0 / 52.122. 0
    libavformat 52.110. 0 / 52.110. 0
    libavdevice 52. 5. 0 / 52. 5. 0
    libavfilter 1. 80. 0 / 1. 80. 0
    libswscale 0. 14. 1 / 0. 14. 1
    libpostproc 51. 2. 0 / 51. 2. 0
    [mpeg @ 0x12120a0] max_analyze_duration 5000000 reached at 5000000
    Input #0, mpeg, from 'raj.mpeg':
    Duration: 00:00:22.91, start: 0.500000, bitrate: 2113 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR
    64:45 DAR 16:9], 9000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, mono, s16, 448 kb/s
    File 'clock.flv' already exists. Overwrite ? [y/N] y
    [buffer @ 0x121ae80] w:720 h:576 pixfmt:yuv420p tb:1/1000000 sar:64/45
    sws_param:
    [libmp3lame @ 0x121a220] flv does not support that sample rate, choose
    from (44100, 22050, 11025).
    Output #0, flv, to 'clock.flv':
    Metadata:
    encoder : Lavf52.110.0
    Stream #0.0: Video: flv, yuv420p, 720x576 [PAR 64:45 DAR 16:9],
    q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1: Audio: libmp3lame, 48000 Hz, mono, s16, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    Could not write header for output file #0 (incorrect codec parameters ?)
    ERROR: undefined method `timestamp' for nil:NilClass
    ERROR: /usr/local/lib/site_ruby/1.8/flv/stream.rb:285:in `lasttimestamp'
    ERROR: /usr/local/lib/site_ruby/1.8/flv/stream.rb:274:in `duration'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:181:in
    `add_meta_data_tag'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:137:in `update'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:47:in `send'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:47:in `execute!'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:46:in `each'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:46:in `execute!'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:206:in
    `process_files'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2/base.rb:44:in `execute!'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2.rb:168:in `execute!'
    ERROR: /usr/local/lib/site_ruby/1.8/flvtool2.rb:228
    ERROR: /usr/bin/flvtool2:2:in `require'
    ERROR: /usr/bin/flvtool2:2
    Last edited by rajamsc1984; 10-20-2011 at 08:09 AM.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •