I am using mencoder to clip avi files, and I have had success in the past, so I think it must have something to do with this particular avi file that I'm trying to clip.
I have an avi file called Movie.avi and I want to clip from starting position 30 and make it 30 seconds long and call it output.avi. So I run this command:
mencoder -ni -ss 30 -endpos 30 Movie.avi -oac copy -ovc copy -o output.avi
And the video that it generates has an issue with the video and the audio being out of sync. The output of the mencoder includes this warning:
Too many video packets in the buffer: (280 in 33600000 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
The output also, many times, includes stuff like this:
Skipping frame!
Pos: 29.8s 991f (15%) 128.15fps Trem: 0min 693mb A-V:0.067 [28803:0]
And at the very end, the output includes
Video stream: 28771.229 kbit/s (3596403 B/s) size: 108000000 bytes 30.030 secs 998 frames
Audio stream: 4373418.000 kbit/s (546677276 B/s) size: 4791968 bytes 0.009 secs
Any ideas about why the audio and video are not in sync. It seems it is off by like a second or so. I ran this commmand to get some details about the file (not sure if this would help).
mplayer "Movie.avi" -identify -frames 0
Here is the output
MPlayer SVN-r35910-4.2.1 (C) 2000-2013 MPlayer Team
Playing Movie.avi.
libavformat version 54.61.104 (internal)
AVI file format detected.
AVI: ODML: Building ODML index (1 superindexchunks).
AVI_NI: No video stream found.
ID_VIDEO_ID=0
libavformat file format detected.
ID_VIDEO_ID=0
[lavf] stream 0: video (dvvideo), -vid 0
ID_AUDIO_ID=0
[lavf] stream 1: audio (pcm_s16le), -aid 0
ID_AUDIO_ID=1
[lavf] stream 2: audio (pcm_s16le), -aid 1
VIDEO: [dvsd] 720x480 0bpp 29.970 fps 28771.2 kbps (3512.1 kbyte/s)
Load subtitles in ./
ID_FILENAME=Movie.avi
ID_DEMUXER=lavf
ID_VIDEO_FORMAT=dvsd
ID_VIDEO_BITRATE=28771224
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=1024000
ID_AUDIO_RATE=32000
ID_AUDIO_NCH=2
ID_START_TIME=0.00
ID_LENGTH=3556.92
ID_SEEKABLE=1
ID_CHAPTERS=0
================================================== =======================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.91.102 (internal)
Selected video codec: [ffdv] vfm: ffmpeg (FFmpeg DV)
================================================== =======================
ID_VIDEO_CODEC=ffdv
================================================== =======================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 32000 Hz, 2 ch, s16le, 1024.0 kbit/100.00% (ratio: 128000->128000)
ID_AUDIO_BITRATE=1024000
ID_AUDIO_RATE=32000
ID_AUDIO_NCH=2
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
================================================== =======================
AO: [coreaudio] 32000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Starting playback...
Exiting... (End of file)
ID_EXIT=EOF
I have an avi file called Movie.avi and I want to clip from starting position 30 and make it 30 seconds long and call it output.avi. So I run this command:
mencoder -ni -ss 30 -endpos 30 Movie.avi -oac copy -ovc copy -o output.avi
And the video that it generates has an issue with the video and the audio being out of sync. The output of the mencoder includes this warning:
Too many video packets in the buffer: (280 in 33600000 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
The output also, many times, includes stuff like this:
Skipping frame!
Pos: 29.8s 991f (15%) 128.15fps Trem: 0min 693mb A-V:0.067 [28803:0]
And at the very end, the output includes
Video stream: 28771.229 kbit/s (3596403 B/s) size: 108000000 bytes 30.030 secs 998 frames
Audio stream: 4373418.000 kbit/s (546677276 B/s) size: 4791968 bytes 0.009 secs
Any ideas about why the audio and video are not in sync. It seems it is off by like a second or so. I ran this commmand to get some details about the file (not sure if this would help).
mplayer "Movie.avi" -identify -frames 0
Here is the output
MPlayer SVN-r35910-4.2.1 (C) 2000-2013 MPlayer Team
Playing Movie.avi.
libavformat version 54.61.104 (internal)
AVI file format detected.
AVI: ODML: Building ODML index (1 superindexchunks).
AVI_NI: No video stream found.
ID_VIDEO_ID=0
libavformat file format detected.
ID_VIDEO_ID=0
[lavf] stream 0: video (dvvideo), -vid 0
ID_AUDIO_ID=0
[lavf] stream 1: audio (pcm_s16le), -aid 0
ID_AUDIO_ID=1
[lavf] stream 2: audio (pcm_s16le), -aid 1
VIDEO: [dvsd] 720x480 0bpp 29.970 fps 28771.2 kbps (3512.1 kbyte/s)
Load subtitles in ./
ID_FILENAME=Movie.avi
ID_DEMUXER=lavf
ID_VIDEO_FORMAT=dvsd
ID_VIDEO_BITRATE=28771224
ID_VIDEO_WIDTH=720
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=1
ID_AUDIO_BITRATE=1024000
ID_AUDIO_RATE=32000
ID_AUDIO_NCH=2
ID_START_TIME=0.00
ID_LENGTH=3556.92
ID_SEEKABLE=1
ID_CHAPTERS=0
================================================== =======================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.91.102 (internal)
Selected video codec: [ffdv] vfm: ffmpeg (FFmpeg DV)
================================================== =======================
ID_VIDEO_CODEC=ffdv
================================================== =======================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 32000 Hz, 2 ch, s16le, 1024.0 kbit/100.00% (ratio: 128000->128000)
ID_AUDIO_BITRATE=1024000
ID_AUDIO_RATE=32000
ID_AUDIO_NCH=2
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
================================================== =======================
AO: [coreaudio] 32000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=pcm
Starting playback...
Exiting... (End of file)
ID_EXIT=EOF