Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to snip a little piece out of a video file
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 451
Location: Saitama, JP

PostPosted: Sun Apr 18, 2010 9:31 pm    Post subject: How to snip a little piece out of a video file Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Apr 18, 2010 10:07 pm    Post subject: Reply with quote

I think MKVToolnix can split files. http://www.bunkus.org/videotools/mkvtoolnix/index.html

Avidemux2 can do it for sure.
Back to top
View user's profile Send private message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 451
Location: Saitama, JP

PostPosted: Sun Apr 18, 2010 10:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Apr 18, 2010 11:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Rexilion
Veteran
Veteran


Joined: 17 Mar 2009
Posts: 1044

PostPosted: Tue Apr 20, 2010 6:55 am    Post subject: Reply with quote

You can also do this with ffmpeg (I did it with another container format) but it might work.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Tue Apr 20, 2010 9:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Clad in Sky
l33t
l33t


Joined: 04 May 2007
Posts: 888
Location: Germany

PostPosted: Tue Apr 20, 2010 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
sl70
Guru
Guru


Joined: 18 Jun 2002
Posts: 451
Location: Saitama, JP

PostPosted: Tue Apr 20, 2010 5:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
dwbowyer
Apprentice
Apprentice


Joined: 18 Apr 2008
Posts: 155

PostPosted: Wed Apr 21, 2010 10:01 am    Post subject: Reply with quote

Try posting the commands line that you used -- otherwise we won't know if you are missing something.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Wed Apr 21, 2010 10:32 am    Post subject: Re: How to snip a little piece out of a video file Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Wed Apr 21, 2010 12:11 pm    Post subject: Reply with quote

Well, Xvid and DivX are both MPEG-4.

Read more here: http://www.avidemux.org/admWiki/doku.php?id=general:common_myths

It's always better to know what you are doing. ;)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Wed Apr 21, 2010 10:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Wed Apr 21, 2010 10:19 pm    Post subject: Reply with quote

krinn wrote:
It's always better to know what you are doing ;)

++ :D
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Thu Apr 22, 2010 2:34 pm    Post subject: Reply with quote

use avidemux
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum