Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

Howto cut avi specific to the frame?

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
Danuvius
Guru
Guru
Posts: 375
Joined: Sat Sep 18, 2004 6:55 pm
Location: Toronto

Howto cut avi specific to the frame?

  • Quote

Post by Danuvius » Wed Jun 28, 2006 8:03 pm

Is there any way (non-gui, ideally) to cut avi files with accuracy down to the frame?

i.e.: I want to create movie_cut.avi from content somewhere right in the middle of movie.avi
Magyar Reddit
Top
lonex
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Sun Aug 22, 2004 6:13 pm
Location: Karlsruhe, Germany

  • Quote

Post by lonex » Wed Jun 28, 2006 8:27 pm

No, cutting most avi files precisely to the frame most likely won't be possible. Most avi files nowadays are encoded using some sort of mpeg4 video codec, like divx or xvid, and those only have a full frame every few seconds or so, and all other frames in between are derived from that single full frame. So you can only make a cut on each of those full frames, unless you re-encode the part you want to cut out, but that means losing quality.
There are no dumb questions, just dumb answers. So please help users that are new to linux/gentoo by answering unanswered questions.
Top
Danuvius
Guru
Guru
Posts: 375
Joined: Sat Sep 18, 2004 6:55 pm
Location: Toronto

  • Quote

Post by Danuvius » Thu Jun 29, 2006 12:48 am

lonex wrote:No, cutting most avi files precisely to the frame most likely won't be possible. Most avi files nowadays are encoded using some sort of mpeg4 video codec, like divx or xvid, and those only have a full frame every few seconds or so, and all other frames in between are derived from that single full frame. So you can only make a cut on each of those full frames, unless you re-encode the part you want to cut out, but that means losing quality.
Errr... pretty sure avidemux does it. And re-encoding at a high enough quality will produce no visible quality loss.

So my question was "how", not "is it possible". It is, albeit like with the caveats you mention.
Magyar Reddit
Top
moob7
Tux's lil' helper
Tux's lil' helper
Posts: 80
Joined: Sun Jan 22, 2006 4:49 pm

  • Quote

Post by moob7 » Sat Jul 01, 2006 2:09 pm

Danuvius wrote:Errr... pretty sure avidemux does it. And re-encoding at a high enough quality will produce no visible quality loss.
According to the docs avidemux will break on a non i-frame boundary. It is supposed to re-encode the frames from that point up to the next i-frame and then the frames after that are passed though in copy mode. In theory. I have had problems with it for this particualr task but it may work fine for you. The probelm I tend to have with clips cut out with avidemux is what I call "jerking". The video seems to jerk (play faster/slower) for the first second or so until it catches up to (syncs with?) the audio.
Danuvius wrote:So my question was "how", not "is it possible". It is, albeit like with the caveats you mention.
Don't you hate when you phrase a question simply and directly yet someone still mis-reads it and answers it as a different question? The other day I posted a question and clearly phrased it so that the answer could only be "yes" or "no". I even put "(y/n)" as part of the topic/title. Still someone posted an irrelevent answer.

That said, let me give you an answer to your original question. ;)

I use transcode to cut on precise boundaries. As already stated, it has to re-encode the video but with the right settings (bit rate high enough, essentially) it works fine. It also cuts the audio correctly along with the video which is nice. I use avidemux to ascertain the frame numbers. Then I writ ethem down. Then I exit avidemux and then call transcode (command line only, yay!!) to chop that bad boy out.

Extra tip: depending on what are going to use extracted clip for, you may want to have transcode re-encode to a lossless format such as yuv or dv (or even a directory full of tga or png files) with a separate wav file containing the audio part.
Top
argasek
Bodhisattva
Bodhisattva
User avatar
Posts: 1121
Joined: Thu May 06, 2004 2:21 pm
Location: Sol [0,0], Poland, Kraków
Contact:
Contact argasek
Website

Re: Howto cut avi specific to the frame?

  • Quote

Post by argasek » Sat Jul 01, 2006 3:24 pm

Danuvius wrote:Is there any way (non-gui, ideally) to cut avi files with accuracy down to the frame?

i.e.: I want to create movie_cut.avi from content somewhere right in the middle of movie.avi
I think with mencoder from MPlayer you can do this (without re-encoding).
RLU #137109 | http://soundcloud.com/argasek
Top
Danuvius
Guru
Guru
Posts: 375
Joined: Sat Sep 18, 2004 6:55 pm
Location: Toronto

  • Quote

Post by Danuvius » Sun Jul 02, 2006 3:45 am

moob7 wrote:
Danuvius wrote:Errr... pretty sure avidemux does it. And re-encoding at a high enough quality will produce no visible quality loss.
According to the docs avidemux will break on a non i-frame boundary. It is supposed to re-encode the frames from that point up to the next i-frame and then the frames after that are passed though in copy mode. In theory. I have had problems with it for this particualr task but it may work fine for you. The probelm I tend to have with clips cut out with avidemux is what I call "jerking". The video seems to jerk (play faster/slower) for the first second or so until it catches up to (syncs with?) the audio.
I went with the avidemux way... despite my original wish for a non-gui solution, I think it may have saved me some time that I could use the gui to specify thinks. The splicing ended up being far more complicated than I originally suspected.

The jerking prospect does frighten me though... I guess I shall have to wait and see.
moob7 wrote:
Danuvius wrote:So my question was "how", not "is it possible". It is, albeit like with the caveats you mention.
Don't you hate when you phrase a question simply and directly yet someone still mis-reads it and answers it as a different question? The other day I posted a question and clearly phrased it so that the answer could only be "yes" or "no". I even put "(y/n)" as part of the topic/title. Still someone posted an irrelevent answer.

That said, let me give you an answer to your original question. ;)
Kindred souls are we! Thanks. ;-)
moob7 wrote:I use transcode to cut on precise boundaries. As already stated, it has to re-encode the video but with the right settings (bit rate high enough, essentially) it works fine. It also cuts the audio correctly along with the video which is nice. I use avidemux to ascertain the frame numbers. Then I writ ethem down. Then I exit avidemux and then call transcode (command line only, yay!!) to chop that bad boy out.
Unfortunately due to the specifics of what I am doing, the audio cannot be cut correctly... it has to be further manipulated, separately of the video, to achieve something proper. I am sure I am going to suffer like hell with audacity... urgh. ;-(
moob7 wrote:Extra tip: depending on what are going to use extracted clip for, you may want to have transcode re-encode to a lossless format such as yuv or dv (or even a directory full of tga or png files) with a separate wav file containing the audio part.
Not an option... the original (which is encoded as DVD video) is 25 GB (just the video--no audio). I suspect any lossless format may ultimately find the 600+ GB hard drive space I have insufficient.

Thanks for the tips though... for now I am managing ok with avidemux.

If you have any suggestions for how I could go about cutting/fitting/cross-fading multiple 6 channel and 2+ GB .wav files... I would be most grateful. audacity, alas, only supports 2 channel audio .wav files *for exporting/saving*.
Magyar Reddit
Top
Danuvius
Guru
Guru
Posts: 375
Joined: Sat Sep 18, 2004 6:55 pm
Location: Toronto

Re: Howto cut avi specific to the frame?

  • Quote

Post by Danuvius » Sun Jul 02, 2006 3:46 am

argasek wrote:
Danuvius wrote:Is there any way (non-gui, ideally) to cut avi files with accuracy down to the frame?

i.e.: I want to create movie_cut.avi from content somewhere right in the middle of movie.avi
I think with mencoder from MPlayer you can do this (without re-encoding).
I think mencoder would force the cuts to happen at keyframes... which may be the only possibility without reencoding, but are nonetheless unsatisfactory.
Magyar Reddit
Top
richardash1981
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Fri Apr 08, 2005 5:26 pm
Location: England

  • Quote

Post by richardash1981 » Mon Jul 10, 2006 7:35 pm

Support for exporting to multichannel wav files is in current audacity CVS (so will be in 1.3.1).
Top
Danuvius
Guru
Guru
Posts: 375
Joined: Sat Sep 18, 2004 6:55 pm
Location: Toronto

  • Quote

Post by Danuvius » Tue Jul 11, 2006 7:55 pm

richardash1981 wrote:Support for exporting to multichannel wav files is in current audacity CVS (so will be in 1.3.1).
Do you know when 1.3.1 is due out?
Magyar Reddit
Top
richardash1981
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Fri Apr 08, 2005 5:26 pm
Location: England

  • Quote

Post by richardash1981 » Fri Jul 14, 2006 7:45 pm

Depends on developer time to get remaining bugs removed. Probably in the next month or so unless people are very busy. May well be preceded by 1.2.5 (which doesn't change much except some obscure bugs in 1.2.4).
Top
Post Reply

10 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic