Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Video editing in Ubuntu

35 views
Skip to first unread message

Davey

unread,
Sep 21, 2012, 7:25:02 AM9/21/12
to
I have succeeded in transferring a load of my NTSC video tapes to the
PC. Now I want to edit out the adverts (being from the USA, that is
about 20% or more of the content), and then put the result onto DVDs.
Creating an .iso file is no problem, but I am not sure of the best
Ubuntu program to do the editing. I have Avidemux, but initial tests
have produced video/audio sync problems.
Is Avidemux a good editing tool, and I just need to persevere to get
it right, or is there a better, simpler editing program?
TIA for any useful help.
--
Davey.

Phil Stovell

unread,
Sep 21, 2012, 8:05:52 AM9/21/12
to
I've done the same as you (except with VHS). I also had sound sync
problems with Avidemux. I used audio shift to re-sync the sound. It needs
a bit of trial and error to get accurate lip sync.

Tony Houghton

unread,
Sep 21, 2012, 9:23:03 AM9/21/12
to
In <k3hiqe$7ck$1...@n102.xanadu-bbs.net>,
If you're converting to DVD your files are presumably MPEG2, or will
need to be converted to that anyway. So you could try gopchop or maybe
project-x followed by mplex. Project-x is designed mainly to handle
recordings of DVB, but it may be flexible enough to handle MPEG-PS
format as input.

--
TH * http://www.realh.co.uk

Davey

unread,
Sep 21, 2012, 12:46:16 PM9/21/12
to
Ah, so it's not just me! My tapes are US NTSC VHS, and they are now on
the PC as mpeg2. I was on the right track, then, with what I was doing,
but I decided to stop and concentrate on getting the tapes transferred
first.
--
Davey.

Davey

unread,
Sep 21, 2012, 12:47:35 PM9/21/12
to
Hmm, I haven't heard of those. Yes, they are in MPEG2 right now.
Thanks.
--
Davey.

Nick Leverton

unread,
Sep 21, 2012, 1:59:21 PM9/21/12
to
In article <k3i5n7$chq$2...@n102.xanadu-bbs.net>,
Kdenlive is supposed to be a good video editor and I've seen another
couple float past recently on the new packages stream, although I've
never had the need to get to grips with any of them yet.

Nick
--
"The Internet, a sort of ersatz counterfeit of real life"
-- Janet Street-Porter, BBC2, 19th March 1996

Davey

unread,
Sep 21, 2012, 2:24:07 PM9/21/12
to
Noted, thanks muchly.
--
Davey.

Dave Farrance

unread,
Sep 21, 2012, 3:05:50 PM9/21/12
to
I'll point out that gopchop's huge advantage is that it doesn't decode and
recode the video, so no hour's wait and no loss in quality. You can only
cut at key frames, which I think are normally every half-second, so that
should be good enough accuracy for snipping out advert breaks.

Pinnerite

unread,
Sep 21, 2012, 3:16:21 PM9/21/12
to
I have been editing out adverts from broadcast downloads during the last
couple of days, except mine are from digital transmissions.

I used avidemux to crop the files and ffmulticonverter to convert them to
DVD. Pretty successful.

I am running a KDE4 system but both programs should be available for Ubuntu
or you could compile from source. You could take a look a tragtor too.

HTH


--
________________________________________________
Magaia 2 for x86_64
Kernel 3.3.8-desktop-2.mga2
KDE version 4.8.4
Running on an AMD 4-core processor

Tony Houghton

unread,
Sep 21, 2012, 3:40:52 PM9/21/12
to
In <rpdp58l6l101n6nif...@4ax.com>,
Project-X does the same. I was about to point out there are usually key
frames at the start and end of ad breaks anyway, but that probably
wouldn't be the case with a DIY VHS rip, unless there's such a big
change in the picture between frames that the encoder decides a key
frame is the most efficient way to handle it.

Davey

unread,
Sep 21, 2012, 5:59:57 PM9/21/12
to
On Fri, 21 Sep 2012 20:16:21 +0100
Pinnerite <pinn...@gmail.com> wrote:

> I have been editing out adverts from broadcast downloads during the
> last couple of days, except mine are from digital transmissions.
>
> I used avidemux to crop the files and ffmulticonverter to convert
> them to DVD. Pretty successful.
>
> I am running a KDE4 system but both programs should be available for
> Ubuntu or you could compile from source. You could take a look a
> tragtor too.
>
> HTH
>
>

Yes, I have Avidemux, as I mentioned in the original post. But I, and
another, found that it gives audio/visual sync. errors. If you would
post what settings you use, that would be much appreciated.
Converting to .iso/DVD is no problem, it's the editing that I am trying
to get working properly.
--
Davey.

Phil Stovell

unread,
Sep 22, 2012, 5:50:16 AM9/22/12
to
On Fri, 21 Sep 2012 20:05:50 +0100, Dave Farrance wrote:

> I'll point out that gopchop's huge advantage is that it doesn't decode and
> recode the video, so no hour's wait and no loss in quality. You can only
> cut at key frames, which I think are normally every half-second, so that
> should be good enough accuracy for snipping out advert breaks.

You can do that with Avidemux too. Just leave the video and audio on "copy".

Davey

unread,
Sep 22, 2012, 6:17:04 AM9/22/12
to
That's what I tried before, but ended up with the afore-mentioned loss
of sync. I'll try Avidemux again, first, though, as I have used it a
bit, and don't have to learn another program.
--
Davey.

Phil Stovell

unread,
Sep 22, 2012, 7:52:31 AM9/22/12
to
That's how I regained sync :-). I was copying home VHS from the 80s and
when I'd digitised a whole tape, I'd chop it into logical sections with
the audio re-synced. The original capture (with Mencoder) sometimes lost
sync. I'd then edit it down and convert to MP4 with yadif=BOB (convert
25fps interlaced to 50fps progressive) for displaying directly on my TV
(via Mediatomb) or to 25i MPEG-PS for creating a DVD with DeVeDe.

Pinnerite

unread,
Sep 22, 2012, 10:37:18 AM9/22/12
to
I am new to this and so mostly used defaults.
My original recordings are in m2t format.
In avidemux I just crop unwanted bits and save to another m2t.

In ffmulticonverter I se audio from mpeg to dvd
and video from m2t to dvd.

I had been testing using Black Book. The opening shots looked
a bit jerky so not knowing what the default frame rate was I
am doing it again with an fps of 25. Not a scientific selection just
empirical or hit and miss as we used to say. I'll comment when I've compared
it.

Pinnerite

unread,
Sep 22, 2012, 12:07:04 PM9/22/12
to
Pinnerite wrote:

//
> I am new to this and so mostly used defaults.
> My original recordings are in m2t format.
> In avidemux I just crop unwanted bits and save to another m2t.
>
> In ffmulticonverter I se audio from mpeg to dvd
> and video from m2t to dvd.
>
> I had been testing using Black Book. The opening shots looked
> a bit jerky so not knowing what the default frame rate was I
> am doing it again with an fps of 25. Not a scientific selection just
> empirical or hit and miss as we used to say. I'll comment when I've
> compared it.
>

I did it at 25 fps and 35 fps and could not detect any difference.
The original recording (from Kaffeine) will have determined things I feel.

Davey

unread,
Oct 1, 2012, 2:27:06 PM10/1/12
to
Update:
Made the time to do some experimenting.
1. Chose a 90-minute long file; played with perfect sync. using MPlayer.
2. Avidemux indexed it; that file when played has loss of sync.(?)
3. Tried different Shift settings, settled on -800 ms as best overall.
4. Made a good copy, no edits, sync. fine.
5. Edited out the ad. breaks, now saving. Will see/hear how good the
result is, and report.
--
Davey.

Davey

unread,
Oct 1, 2012, 6:17:16 PM10/1/12
to
On Mon, 1 Oct 2012 19:27:06 +0100
Davey <da...@example.invalid> wrote:

> On Sat, 22 Sep 2012 15:37:18 +0100
> Pinnerite <pinn...@gmail.com> wrote:
>
> > Davey wrote:
> >
> > > On Fri, 21 Sep 2012 20:16:21 +0100
> > > Pinnerite <pinn...@gmail.com> wrote:
> > >
> > >> I have been editing out adverts from broadcast downloads during
> > >> the last couple of days, except mine are from digital
> > >> transmissions.

snip
>
> Update:
> Made the time to do some experimenting.
> 1. Chose a 90-minute long file; played with perfect sync. using
> MPlayer. 2. Avidemux indexed it; that file when played has loss of
> sync.(?) 3. Tried different Shift settings, settled on -800 ms as
> best overall. 4. Made a good copy, no edits, sync. fine.
> 5. Edited out the ad. breaks, now saving. Will see/hear how good the
> result is, and report.

6. Result is a big shift in the sync. More research ongoing.
--
Davey.

Dave Farrance

unread,
Oct 2, 2012, 7:56:14 AM10/2/12
to
Davey <da...@example.invalid> wrote:

>> Update:
>> Made the time to do some experimenting.
>> 1. Chose a 90-minute long file; played with perfect sync. using
>> MPlayer. 2. Avidemux indexed it; that file when played has loss of
>> sync.(?) 3. Tried different Shift settings, settled on -800 ms as
>> best overall. 4. Made a good copy, no edits, sync. fine.
>> 5. Edited out the ad. breaks, now saving. Will see/hear how good the
>> result is, and report.
>
>6. Result is a big shift in the sync. More research ongoing.

Consider the possibility that the fault lies with the original method that
you used in digitally capturing the videotape player's output. The whole
point of a *broadcast* MPEG2 stream is that you can switch on your
receiver at any point in the stream and listen into it, starting with any
keyframe, and the audio will be in sync. That might not be true of some
budget dvd-recorder (or whatever you used), and the sound and video sync
might wander about as the compressibility of the various scenes change --
but you wouldn't notice that if you start from the beginning, because the
sound and video would each play at their specified bit rate.

Or then again, maybe it *is* that avidemux is buggy and messes up the
selection of a suitable keyframe for a chopping point. So also try
something like gopchop as a quick comparison.

Phil Stovell

unread,
Oct 2, 2012, 8:33:33 AM10/2/12
to
On Mon, 01 Oct 2012 19:27:06 +0100, Davey wrote:

> 2. Avidemux indexed it

I captured thus (PAL):

mencoder tv:// -tv
driver=v4l2:norm=PAL:input=1:amode=0:width=720:height=576:
device=/dev/video0:alsa:forceaudio:amode=0:audiorate=48000:adevice=hw.0,2
-ovc lavc -lavcopts
vcodec=mpeg2video:keyint=25:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=9200:aspect=4/3
-oac copy -mc 0 -noskip -of avi -o output.avi

48000 PCM sound,
MPG2 codec,
AVI container.

Sometimes the capture loses sound sync, if there are any video errors, it
sometimes drops video frames but the sound is OK, which causes sound drift.

Davey

unread,
Oct 2, 2012, 12:37:24 PM10/2/12
to
On Tue, 02 Oct 2012 12:56:14 +0100
Dave Farrance <DaveFa...@OMiTTHiSyahooANDTHiS.co.uk> wrote:

> Davey <da...@example.invalid> wrote:
>
> >> Update:
> >> Made the time to do some experimenting.
> >> 1. Chose a 90-minute long file; played with perfect sync. using
> >> MPlayer. 2. Avidemux indexed it; that file when played has loss of
> >> sync.(?) 3. Tried different Shift settings, settled on -800 ms as
> >> best overall. 4. Made a good copy, no edits, sync. fine.
> >> 5. Edited out the ad. breaks, now saving. Will see/hear how good
> >> the result is, and report.
> >
> >6. Result is a big shift in the sync. More research ongoing.
>
> Consider the possibility that the fault lies with the original method
> that you used in digitally capturing the videotape player's output.
> The whole point of a *broadcast* MPEG2 stream is that you can switch
> on your receiver at any point in the stream and listen into it,
> starting with any keyframe, and the audio will be in sync. That
> might not be true of some budget dvd-recorder (or whatever you used),
> and the sound and video sync might wander about as the
> compressibility of the various scenes change -- but you wouldn't
> notice that if you start from the beginning, because the sound and
> video would each play at their specified bit rate.
>

I am playing beyond my knowledge and expertise here, so I can only
relate what I find.
But:
I can take the file as transferred to the PC, and play it either with,
say, vlc, or MPlayer, or Avidemux, and the sync. is fine, which implies
that that part of the process is ok. Your point is valid, but I don't
believe is the problem.
I then do a load of edits using Avidemux, and save the file.
Playing this new file back using vlc gives a noticeable mis-sync,
playing it back using Avidemux gives a different shift. Adjusting the
shift in Avidemux allows me to re-sync the instant playback, but of
course I can't tell what the final re-recorded time shift will be until
I re-save it and listen. I am hoping to come up with a good value of
Shift during edit/recording, and then if necessary, a corrective Shift
on post-edit processing.

> Or then again, maybe it *is* that avidemux is buggy and messes up the
> selection of a suitable keyframe for a chopping point. So also try
> something like gopchop as a quick comparison.

I might just do that, when the opportunity arises.
--
Davey.

Davey

unread,
Oct 2, 2012, 12:49:54 PM10/2/12
to
A couple of years or so ago, I tried to use a Pinnacle Dazzle with
Linux, and even with lots of help from folks, I could not get it to
work; there was always massive over-run of buffers, and the process
would grind to a halt. This was with a decent-but-not-great PC, with a
P4 CPU. I don't remember how much memory it had.
Now I have a much better PC, and I might just try that mencoder process
again. I need to re-visit the mencoder manual, to find out what all the
options mean, first, and adjust any requiring it. But thanks for the
info.
As I mention in a different message, the problem here does not seem to
be in the transfer to the PC, but in the saving after editing.
For reference, the original tapes are LP NTSC, I am playing them back
on a Sony VCR that outputs NTSC 4.43, and the capture device is an
EZCap. I currently use the Windows capture program that came with it,
to successfully transfer the VCR output to the PC. Hauppauge don't do
NTSC 4.43 any more.

Thanks to all for helpful suggestions.
I shall continue to report progress.
--
Davey.

Phil Stovell

unread,
Oct 2, 2012, 2:17:00 PM10/2/12
to
On Tue, 02 Oct 2012 17:49:54 +0100, Davey wrote:

> As I mention in a different message, the problem here does not seem to
> be in the transfer to the PC

I think it is the problem. What is the container format and codec? I had
several problems when I first started, including buffer over-runs, badly
non syncing sound etc. Basically by trial-and error I arrived at the above
mencoder parameters. The capture device is a KWorld USB2800D (EM28XX
device).

Davey

unread,
Oct 2, 2012, 3:07:40 PM10/2/12
to
Well, the badly non-syncing sound matches, for sure, although that
seems so far to be the only problem, and I am getting that under
control. The reason I think that the original transfer is not the
problem (while agreeing that I may well be wrong, but going on what I
see and hear) is that the first-generation transferred file plays
perfectly using all other players, eg. vlc, MPlayer, etc. with perfect
sync.
I have for one of these files:
Stream 0/Type: Audio/Codec: mpga/Sample Rate:48000Hz/Bitrate:224 kb/s.
Stream 1/Type: Video/Codec:mpgv/Resolution:720x480/DisplayResolution:
720x480/Frame Rate: 29.970030.
The EZCap that I use is also an EM28XX device, EM2817 from memory.

Thanks for thoughts.
--
Davey.

Davey

unread,
Oct 2, 2012, 6:52:11 PM10/2/12
to
On Tue, 02 Oct 2012 12:56:14 +0100
Dave Farrance <DaveFa...@OMiTTHiSyahooANDTHiS.co.uk> wrote:

Very interesting. I tried gopchop on one of the same files that I had
been working with in Avidemux, and the result was a perfectly synced
edited file. I had to get used to the Clip Start/Stop working in the
reverse direction from in Avidemux, but I soon managed that.
I noticed that gopchop was a lot less tolerant of where it would let me
start or stop a clip, compared to Avidemux, presumably being more
accurate with the keyframes.
The result of this seems to be that I have good synced PC files of the
tapes, and using gopchop, I can edit them without worrying about losing
audio sync.
Wowee! Bye, bye Avidemux. I think I will clear out a folder full of
Avidemux files, and start again.
Thanks.
--
Davey.

Davey

unread,
Oct 2, 2012, 6:53:04 PM10/2/12
to
See my other message in this thread of a couple of minutes ago for
update.
--
Davey.

Phil Stovell

unread,
Oct 3, 2012, 6:48:40 AM10/3/12
to
On Tue, 02 Oct 2012 23:53:04 +0100, Davey wrote:

> See my other message in this thread of a couple of minutes ago for update.

Yes, glad to read you've got it working OK.

Davey

unread,
Oct 3, 2012, 7:02:48 AM10/3/12
to
I will try the mencoder route as well, now that I have a working
start-to-finish method. It would be nice to be able to stay using only
Linux, the working transfer uses a Win7 programme.

Thanks for the help.
--
Davey.

Dave Farrance

unread,
Oct 4, 2012, 3:22:52 AM10/4/12
to
Davey <da...@example.invalid> wrote:

>Very interesting. I tried gopchop on one of the same files that I had
>been working with in Avidemux, and the result was a perfectly synced
>edited file. I had to get used to the Clip Start/Stop working in the
>reverse direction from in Avidemux, but I soon managed that.
>I noticed that gopchop was a lot less tolerant of where it would let me
>start or stop a clip, compared to Avidemux, presumably being more
>accurate with the keyframes.
>The result of this seems to be that I have good synced PC files of the
>tapes, and using gopchop, I can edit them without worrying about losing
>audio sync.
>Wowee! Bye, bye Avidemux. I think I will clear out a folder full of
>Avidemux files, and start again.
>Thanks.

Hmmm, so it was that, then. Since it's axiomic that you can't chop media
streams at any old place, I would've thought that making sure the cut was
at the right place would be the very first thing that somebody writing a
video editor would work on. Not get it wrong and leave it wrong in an
editor that's been supported for years. Maybe it's a bug in Avidemux that
only gets invoked with a specific combination of circumstances, and has
not been caught for that reason, but other people seem to report the same
problem.

I'd guess that Avidemux would have no trouble with intraframe-only
compression, so maybe it should be a recommendation that files should be
converted to MJPEG or similar before editing with Avidemux. But A quick
Google search doesn't show up any recommendations for that.

This does seem to be an absolutely fundamental flaw with a popular Linux
video editor, so it'd be nice to figure out where the fault is. Maybe you
could make a short (a few seconds long) MPEG2 test-case file with
de-synced audio, and ask why it's desynced on the Avidemux development
forums (which I assume exist somewhere).

Phil Stovell

unread,
Oct 4, 2012, 4:53:09 AM10/4/12
to
On Thu, 04 Oct 2012 08:22:52 +0100, Dave Farrance wrote:

> Maybe it's a bug in Avidemux that
> only gets invoked with a specific combination of circumstances, and has
> not been caught for that reason, but other people seem to report the same
> problem.

You need to skip to next/prior keyframe to avoid any corruptions. It's the
double arrows at the bottom.

Here's a short clip captured with mencoder and edited with avidemux, from
a VHS taken 25 years ago.

http://www.youtube.com/watch?v=2kMRgnj-MU4

Davey

unread,
Oct 4, 2012, 5:20:35 AM10/4/12
to
On Thu, 04 Oct 2012 09:53:09 +0100
Phil Stovell <ph...@stovell.nospam.org.uk> wrote:

> On Thu, 04 Oct 2012 08:22:52 +0100, Dave Farrance wrote:
>
> > Maybe it's a bug in Avidemux that
> > only gets invoked with a specific combination of circumstances, and
> > has not been caught for that reason, but other people seem to
> > report the same problem.
>
> You need to skip to next/prior keyframe to avoid any corruptions.
> It's the double arrows at the bottom.
>

I thought that I had done so, but I cannot swear it, I might have
drifted away from doing it properly, so I will do another trial being
ultra careful. My own note about gopchop being more picky supports this
theory. I like the interface of Avidemux better then gopchop,
especially the variable speed forward/reverse edge control.
If the problem is with the operator, me, I will admit it with no
hesitation.
Thanks again for all the help and support.
More news later, this will not happen instantly.
--
Davey.


Dave Farrance

unread,
Oct 4, 2012, 6:13:46 AM10/4/12
to
If Avidemux, by design, requires the user to have detailed knowledge of
the internal construction of a video file to enable the user to adjust its
configuration settings so that it doesn't produce a broken output, then
the problem is with the program, not with the user. But it's more likely
that some combination of conditions has invoked a bug that nobody's caught
yet.

Dave Farrance

unread,
Oct 4, 2012, 6:31:42 AM10/4/12
to
Dave Farrance <DaveFa...@OMiTTHiSyahooANDTHiS.co.uk> wrote:

>If Avidemux, by design, requires the user to have detailed knowledge of
>the internal construction of a video file to enable the user to adjust its
>configuration settings so that it doesn't produce a broken output, then
>the problem is with the program, not with the user. But it's more likely
>that some combination of conditions has invoked a bug that nobody's caught
>yet.

Hmmm. A quick Google of "avidemux audio sync problem" turns up the comment
that "2.6 has fixed most of the audio sync issues". Ubuntu 12.04, for
example, has Avidemux 2.5.

Davey

unread,
Oct 4, 2012, 9:58:36 AM10/4/12
to
Very interesting! Thanks for the info.
--
Davey.

Davey

unread,
Oct 4, 2012, 6:02:20 PM10/4/12
to
Looking at the mencoder manual, it doesn't include NTSC 4.43 as an
option, only NTSC (but it does offer PAL60, which I don't have).
But I'll try it with NTSC, when I get around to trying this.
--
Davey.

Davey

unread,
Oct 6, 2012, 7:31:16 AM10/6/12
to
I repeated one of the edit jobs this morning, originally about 90
minutes long, down to about an hour when the unwanted stuff was
removed. I took care to stick to the keyframes at every edit start and
end.
The result is acceptable, not perfect, there is a slowly-increasing
audio delay through the length of the piece. At the beginning, there is
a perfect door-closing, just like a film clapperboard, and although
there is no such precise device at the end, there is clearly a slight
loss of sync.
The next task will be to do this on a longer recording, approx. 4
hours, and see what that sounds like.
Avidemux is definitely easier to use the gopchop, I find, and it does
look as though it is ok, as long as one takes care when using it. I
need a way of blanking out the non-keyframe arrows, so that I do not
stray onto them by mistake.
--
Davey.

Davey

unread,
Oct 8, 2012, 9:15:35 AM10/8/12
to
On Sat, 6 Oct 2012 12:31:16 +0100
Follow-up.
Yesterday, I tried a different, longer recording, and the sync. when I
played the result was hopeless. I tried again today, with the same
miserable result.
The only thing I can see that might cause this is that there are a
couple of spots near the beginning where there was no signal coming out
of the VCR, due to bad tape or weak recording signal. Is it possible
that the mpg file in the PC has no key-frames at these points, and that
this results in a loss of sync? And if so, what would be the best way of
overcoming this? The original file, naturally, plays perfectly with vlc
or Mplayer, there is a blue screen while the bad parts are playing.
Any help welcome.
--
Davey.

Davey

unread,
Oct 12, 2012, 6:27:08 AM10/12/12
to
On Fri, 21 Sep 2012 12:25:02 +0100
Davey <da...@example.invalid> wrote:

> I have succeeded in transferring a load of my NTSC video tapes to the
> PC. Now I want to edit out the adverts (being from the USA, that is
> about 20% or more of the content), and then put the result onto DVDs.
> Creating an .iso file is no problem, but I am not sure of the best
> Ubuntu program to do the editing. I have Avidemux, but initial tests
> have produced video/audio sync problems.
> Is Avidemux a good editing tool, and I just need to persevere to get
> it right, or is there a better, simpler editing program?
> TIA for any useful help.

If anyone is still interested in this, or even if nobody is, my final
conclusions are:
- The non-sync found when eliminating blank sections of recordings with
Avidemux appears to be a problem. Using gopchop, there is no such
problem.
- Using gopchop, I found very very good audio sync throughout the whole
of an edited file, better than with Avidemux.
- Although I prefer the Avidemux interface, especially the ease of
getting back to an exact point, etc, the fact that one has to keep a
finger on a mouse key all the time means that the hand gets numb over
time. With gopchop, the finger can relax until needed.
Conclusion:
For my specific requirements, which are certainly not everyone's
requirements, gopchop is the program of choice. It does what I need.

Thanks for all the help and feedback. If there are any more helpful
ideas, I would welcome them.
--
Davey.
0 new messages