Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After a video is cut, the player (mplayer) cannot jump to a specific time position anymore. Clicking the timeline will usually end the playback. How can this be fixed?

share|improve this question

1 Answer 1

The trimmed video probably has a broken AVI index. The idx1 tag in the AVI file format identifies where the data chunks are, so if the index is missing, the player won't know where to look for data chunks at a given timestamp.

This is somewhat expected since the raw bitstream is cut off somewhere using FFmpeg's -c:v copy option in your linked question.

I'm not aware of any FFmpeg command to fix the index, but mencoder should have it.

-forceidx

Force index rebuilding. Useful for files with broken index (A/V desync, etc). This will enable seeking in files where seeking was not possible.

If you download this unofficial mencoder build from Stef Pause's blog, you can try to fix the AVI.

cd ~/Downloads
unzip mencoder.zip
chmod +x mencoder
mv mencoder /usr/local/bin/

Then, enter:

mencoder -forceidx input.avi -o output.avi -oac copy -ovc copy

This will recreate the index for your AVI file. Good luck — if it's not working, you're probably better of re-encoding the original video after trimming.

share|improve this answer
    
-forceidx output a smaller .avi (146 becomes 119MB) and corrupted the avi. I might need to go for the recode way... –  ohho May 10 '12 at 10:05
1  
AVI is a pesky container. If you re-encode, check out existing answers and this as well as this. –  slhck May 10 '12 at 10:10
    
Thanks very much for the great links! –  ohho May 10 '12 at 10:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.