LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mencoder and the lost icons (https://www.linuxquestions.org/questions/linux-software-2/mencoder-and-the-lost-icons-810199/)

Steve W 05-26-2010 07:09 AM

mencoder and the lost icons
 
I edited some mpeg videos using Mencoder to crop unwanted footage from the beginning and the end. It worked, but now the file does not have a "visual" icon, i.e. a still from the video. The properties of the new file also reveal that it thinks it's an audio file! The file still plays (as a video) okay though.

A typical command I used to extract just the first 14 seconds of the video was:

mencoder "e03.mpg" -o ee03a.mpg -ss 0:0:0 -endpos 0:0:14 -oac copy -ovc copy

I did try to make up a new icon by making a snapshot of the movie playing, then using the image to replace the icon in the properties window. (I am using Nautilus file manager in Ubuntu). The icon it now gives me looks like a small sheet of paper with one end curled up.

I can appreciate that editing the video length might have "lost" the icon information, but is there any way I can put it back again?

Thanks for any help you can give.

Steve

tredegar 05-26-2010 10:43 AM

Maybe you have broken the file in some way. Whatever is generating the preview is probably looking at the first frame it sees, which might be broken.

You might try avidemux - it is good at mending broken files.

Install it. Open your file. Tools -> Rebuild I & B frames. Wait.
File.. Save.. Save_Video

Give it a new filename ending with .mpg

Save it.
Any better?

Steve W 05-26-2010 10:54 AM

Well, I installed that package and followed your instructions. The new file was reduced to 245Kb (from 1.1Mb). I didn't need to tell it to rebuild frames - as soon as I opened the file, the program suggested it. It even brought up on the screen a "suggested" frame. No effect on the icon though. And it still thought it was a sound file - albeit a 245Kb one.

I feel I am on the right track - is there anything else with that Avidemux program I can try?

Steve

tredegar 05-26-2010 12:14 PM

Quote:

The new file was reduced to 245Kb
Well, that's a start :) If it still works.
Quote:

is there anything else with that Avidemux program I can try?
To be honest, I haven't used it very much, and I am not at all sure what all its options do ( a bit like man mencoder - it just gives me a headache, with way too much information that I do not understand! )

avidemux will make mpgs -> other formats by re-encoding them, perhaps try this? Maybe some magical combination of options will eventually be applied. (avidemux probably uses mencoder to do this, but perhaps has a better idea of the correct mencoder options than I do).

I think my original suspicion might be right - the thumbnailing program looks at just the first frame in the file. In encoded video, there are generally whole-frames, and then difference-encodings for the next few frames, then another whole-frame etc. How all this is managed depends on all the different (da?ned) codecs. If your editor just makes a "cut" at a certain frame, then maybe your output file is starting with a "difference" frame, which is unrenderable without knowing about the preceeding frames, which you have cut.
The video will still play, because the player will discard the first few frames it cannot render.

Maybe try mplayer yourbadfilename.mpg in a terminal, perhaps some useful error information will be seen (Discarding ... because ....)

Otherwise, maybe start with your unedited file, and use something else to edit it.

I don't generally "do" video, unless it is point, click, play, on the BBC's website, so you have reached the limit of my (very limited) video knowledge.

Please post a follow-up if you manage to fix it, others will appreciate it.

HTH.

Steve W 05-27-2010 01:32 AM

Quote:

The new file was reduced to 245Kb
Well, that's a start If it still works.
No, it didn't even play that one. Although, as you say, error messages from a Shell-invoked running might have revealed why.

It isn't just this file, it is every mpeg I do this kind of cropping on, using Mencoder. I think I need to do "man mencoder" and look through the options - maybe there is an "index rebuilding" option somewhere. As you say, looking at the man pages for something like this can be quite a trawl. Maybe a Google search for some relevant web pages will reveal more.

But thanks for your advice.

Steve


All times are GMT -5. The time now is 08:38 PM.