View previous topic :: View next topic |
Author |
Message |
sl70 Guru
Joined: 18 Jun 2002 Posts: 451 Location: Saitama, JP
|
Posted: Sun Apr 18, 2010 9:31 pm Post subject: How to snip a little piece out of a video file |
|
|
Hello, I have an hour video in Matroska format that I want to snip and save a little 9 second clip from. I tried this:
Code: | mencoder -ss 3414 -endpos 9 myvideo.mkv -of mpeg -oac copy -ovc xvid -xvidopts pass -o clip.mgp
|
It seems to process fine, and then I get this:
Code: |
file clip.mpg
clip.mgp: MPEG sequence, v2, program multiplex |
But when I try to play it I get this:
Code: | mplayer clip.mgp
MPlayer SVN-r29796-4.3.4 (C) 2000-2009 MPlayer Team
Playing clip.mgp.
MPEG: Missing video stream!? Contact the author, it may be a bug :(
Seek failed
Exiting... (End of file)
|
I am totally clueless about this kind of thing. I was only able to put together the mencoder command after studying the docs and man files for hours. Could someone give me a little guidance?
TIA. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
sl70 Guru
Joined: 18 Jun 2002 Posts: 451 Location: Saitama, JP
|
Posted: Sun Apr 18, 2010 10:31 pm Post subject: |
|
|
It doesn't look like mkvtoolnix can do it. It appears that it can extract tracks but not snippets.
The first thing I tried was avidemux, but it totally froze up on me. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Sun Apr 18, 2010 11:16 pm Post subject: |
|
|
I've used Avidemux for years. It's a great tool, you better get it working. May it be your file is damaged? Remuxing with mkvtoolnix may fix it for Avidemux. |
|
Back to top |
|
|
Rexilion Veteran
Joined: 17 Mar 2009 Posts: 1044
|
Posted: Tue Apr 20, 2010 6:55 am Post subject: |
|
|
You can also do this with ffmpeg (I did it with another container format) but it might work. |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Tue Apr 20, 2010 9:11 am Post subject: |
|
|
sl70 wrote: | It doesn't look like mkvtoolnix can do it. It appears that it can extract tracks but not snippets. |
It can. Just check the documentation, you'll find how to do it. It may not be easy though, since you have no visual indication of where in the video you are. So I second Jaglover, try to find out why Avidemux is not working for you. |
|
Back to top |
|
|
Clad in Sky l33t
Joined: 04 May 2007 Posts: 888 Location: Germany
|
Posted: Tue Apr 20, 2010 5:01 pm Post subject: |
|
|
If you want something more GUIy, you can try lives (emerge lives).
I dunno if it can open all file formats, though. _________________ Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest |
|
Back to top |
|
|
sl70 Guru
Joined: 18 Jun 2002 Posts: 451 Location: Saitama, JP
|
Posted: Tue Apr 20, 2010 5:16 pm Post subject: |
|
|
I tried remuxing it, as Jaglover suggested, and then ran avidemux but it crashed again. I would really prefer to use mencoder, but I'm still running up against the problem of the resulting file having no video stream. There must be some command line argument I'm missing, but I don't know what it is. |
|
Back to top |
|
|
dwbowyer Apprentice
Joined: 18 Apr 2008 Posts: 155
|
Posted: Wed Apr 21, 2010 10:01 am Post subject: |
|
|
Try posting the commands line that you used -- otherwise we won't know if you are missing something. |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Apr 21, 2010 10:32 am Post subject: Re: How to snip a little piece out of a video file |
|
|
sl70 wrote: | Code: | mencoder -ss 3414 -endpos 9 myvideo.mkv -of mpeg -oac copy -ovc xvid -xvidopts pass -o clip.mgp
|
|
Might just be that an mpeg container isn't a valid container to hold an xvid stream (and some unknow audio stream, but if audio is ogg, again mepg isn't a valid one to hold that too).
xvid and divx are stream that you can use in an avi container
for mpeg1, mpeg4... in mpeg one. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Wed Apr 21, 2010 10:11 pm Post subject: |
|
|
The mpg container is design for mpeg 1 layer 1 or 2 streams.
So copying an mpeg4 stream in an mpg container isn't a good idea.
I understand that it could be confusing because the container and the stream share their names.
Read more here: http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-mpeg.html
It's always better to know what you are doing |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Thu Apr 22, 2010 2:34 pm Post subject: |
|
|
use avidemux _________________ "Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF |
|
Back to top |
|
|
|