Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I want to do

I'm trying to cut a video for a science project under Ubuntu 11.10 with latest ffmpeg, I also tried Kino and avidemux where the video failed to even open properly although it plays well in both VLC and mplayer.

The closest I have come so far is with these parameters:

ffmpeg -ss 01:58 -t 21 -i row.avi -vcodec copy row_cut.avi

Also tried

ffmpeg -ss 1 -i row.avi -vcodec copy -t 3 row_cut.avi

and still have the same error :(

Where I get at least a 21s video as output and no apparent errors but the video won't play in VLC (ticker rolls but only displays VLC-logo) nor mplayer ("Internal data stream error").


FFmpeg output when encoding

ffmpeg version git-2012-02-02-c853124 Copyright (c) 2000-2012 the FFmpeg developers
built on Feb  2 2012 23:17:50 with gcc 4.6.1
configuration: --enable-gpl --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      51. 37.100 / 51. 37.100
 libavcodec     54.  0.102 / 54.  0.102
 libavformat    54.  0.100 / 54.  0.100
 libavdevice    53.  4.100 / 53.  4.100
 libavfilter     2. 61.100 /  2. 61.100
 libswscale      2.  1.100 /  2.  1.100
 libswresample   0.  6.100 /  0.  6.100
 libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'row.avi':
 Duration: 00:03:13.93, start: 0.000000, bitrate: 46210 kb/s
  Stream #0:0: Video: rawvideo, pal8, 640x300, 30 tbr, 30 tbn, 30 tbc
File 'row_cut.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'row_cut.avi':
 Metadata:
  ISFT            : Lavf54.0.100
  Stream #0:0: Video: rawvideo, pal8, 640x300, q=2-31, 30 tbn, 30 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  631 fps=125 q=-1.0 Lsize=  118334kB time=00:00:21.03 bitrate=46088.4kbits/s    
video:118312kB audio:0kB global headers:0kB muxing overhead 0.018043%

FFmpeg output when loading the videos

My guess is that the video has some type of weird format, misunderstood the ffmpeg's parameters or perhaps the Metada:encoder:Lavf53.3.0 part in the output?

user@computer:/somewhere$ ffmpeg -i row.avi
Input #0, avi, from 'row.avi':
 Duration: 00:03:13.93, start: 0.000000, bitrate: 46210 kb/s
  Stream #0.0: Video: rawvideo, pal8, 640x300, 30 tbr, 30 tbn, 30 tbc

and

user@computer:/somewhere$ ffmpeg -i row_cut.avi
Input #0, avi, from 'row_cut.avi':
 Metadata:
  encoder         : Lavf54.0.100
Duration: 00:00:21.03, start: 0.000000, bitrate: 46088 kb/s
 Stream #0.0: Video: rawvideo, bgr24, 640x300, 30 tbr, 30 tbn, 30 tbc

Mediainfo output

General
Complete name                            : row.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
Format profile                           : OpenDML
File size                                : 1.04 GiB
Duration                                 : 3mn 13s
Overall bit rate                         : 46.2 Mbps

Video
ID                                       : 0
Format                                   : RGB
Codec ID                                 : 0x00000000
Codec ID/Info                            : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples
Duration                                 : 3mn 13s
Bit rate                                 : 46.1 Mbps
Width                                    : 640 pixels
Height                                   : 300 pixels
Display aspect ratio                     : 2.2:1
Frame rate                               : 30.000 fps
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 8.000
Stream size                              : 1.04 GiB (100%)

and

General
Complete name                            : row_cut.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 116 MiB
Duration                                 : 21s 33ms
Overall bit rate                         : 46.1 Mbps
Writing application                      : Lavf54.0.100

Video
ID                                       : 0
Format                                   : RGB
Codec ID                                 : 0x00000000
Codec ID/Info                            : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples
Duration                                 : 21s 33ms
Bit rate                                 : 46.1 Mbps
Width                                    : 640 pixels
Height                                   : 4294966 996 pixels
Display aspect ratio                     : 0.000
Frame rate                               : 30.000 fps
Bit depth                                : 8 bits
Stream size                              : 116 MiB (100%)
share|improve this question
    
Tip: You're using ffmpeg version 0.7.3. It's really old. Get the latest version, they're at 0.10 now. You're on Ubuntu, so follow this tutorial, it's quite easy and step-by-step with everything necessary. Try with the newest version and report back ;) – slhck Feb 2 '12 at 21:30
    
Interestingly, it seems that the color space is not written correctly to the AVI container. While when encoding, you still get pal8, reading the file back gives you bgr24 – something must be wrong there. – slhck Feb 2 '12 at 21:32
    
updated x264 and ffmpeg following the link provided, still have the same problem :( – SlimJim Feb 2 '12 at 23:08
    
Can you edit your post and update the output? Can you maybe post the sample file somewhere for me to check? I'll look into it. – slhck Feb 2 '12 at 23:21
    
use mediainfo to see what's inside it. – barlop Feb 2 '12 at 23:30
up vote 3 down vote accepted

Answer from the ffmpeg mailing list:

You cannot use -vcodec copy on pal8 rawvideo (this may be a bug), but you can use -vcodec rawvideo as a work-around.

It kinda works plays in VLC but not mplayer so it will do for now. The final working command would be

ffmpeg -ss 1 -i row.avi -vcodec rawvideo -t 3 row_cut.avi
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .