jQuery in Action, 3rd edition
The moose likes I/O and Streams and the fly likes Flvtool2: problem convert videos to flv format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Flvtool2: problem convert videos to flv format" Watch "Flvtool2: problem convert videos to flv format" New topic

Flvtool2: problem convert videos to flv format

Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Hi guys,

Has anyone had success converting a video to flv format using ffmpeg and Flvtool2? I have a java web application that users are going to be uploading their videos and my application will be converting the video to a flash format.

I'm getting the following errors and I don't know why:

C:\temp\TmpToolbox>ffmpeg -i MOV00283.MPG -ar 44100 -s 320x240 -r 12 movie.f
flvtool2 -U stdin movie.flv
FFmpeg version SVN-r11143, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthread
enable-liba52 --enable-avisynth --enable-libamr-nb --enable-libamr-wb --enab
ibfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libnut
able-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --cpu=i6
-enable-memalign-hack --extra-ldflags=-static
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 52.1.0
built on Dec 3 2007 17:42:57, gcc: 4.2.2 (mingw32)
Input #0, mpeg, from 'MOV00283.MPG':
Duration: 00:00:03.8, start: 0.110000, bitrate: 2925 kb/s
Stream #0.0[0x1c0]: Audio: mp2, 32000 Hz, mono, 64 kb/s
Stream #0.1[0x1e0]: Video: mpeg1video, yuv420p, 640x480 [PAR 1:1 DAR 4:3
04857 kb/s, 25.00 tb(r)
File 'movie.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to 'movie.flv':
Stream #0.0: Video: flv, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200
s, 12.00 tb(c)
Stream #0.1: Audio: libmp3lame, 44100 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 49 fps= 0 q=4.3 Lsize= 212kB time=4.0 bitrate= 434.3kbits/s
video:177kB audio:31kB global headers:0kB muxing overhead 1.641348%
ERROR: undefined method `timestamp' for nil:NilClass
ERROR: flv/stream.rb:285:in `lasttimestamp'
ERROR: flv/stream.rb:274:in `duration'
ERROR: flvtool2/base.rb:181:in `add_meta_data_tag'
ERROR: flvtool2/base.rb:137:in `update'
ERROR: flvtool2/base.rb:47:in `send'
ERROR: flvtool2/base.rb:47:in `execute!'
ERROR: flvtool2/base.rb:46:in `each'
ERROR: flvtool2/base.rb:46:in `execute!'
ERROR: flvtool2/base.rb:206:in `process_files'
ERROR: flvtool2/base.rb:44:in `execute!'
ERROR: flvtool2.rb:168:in `execute!'
ERROR: flvtool2.rb:228
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

The first hit in a google search for your error indicates that ffmpeg has poor error handling. Do you have enough disk space for a conversion?

[How To Ask Questions On JavaRanch]
Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
I have 73 GB free space left on my hard disk. THat can't be the problem. The file is just 1388 KB.
selvaraju sellamuthu
Ranch Hand

Joined: Jun 28, 2007
Posts: 53
Hell Nina Anderson,
i am going to develop web application for video sharing. I need your guide how to upload video files into db/disk, and how to play that using flash streaming.Suggest me your experiance.

thanks in advance
I agree. Here's the link: http://aspose.com/file-tools
subject: Flvtool2: problem convert videos to flv format
It's not a secret anymore!