News:

--

Main Menu

After resampling, sound continues past video

Started by jimmyswimmy, May 01, 2013, 03:12:01 AM

Previous topic - Next topic

jimmyswimmy

I'm running r8650 right now because the crash/no-restart/find and delete crash.py thing got too annoying.  But I believe this was happening with the current release version of 2.6 as well.

What I am seeing is that when I trim and resample a video (mpg, using lavcodec) from 59.94 to 29.97, and subsequently transcode to mp4 using x264 encoder, the resulting mp4 file contains video that ends where the trim stops, but audio that continues to the end of the source file.  In other words, the video gets trimmed but not the audio.

I can achieve the same result if I (rather pointlessly) resample from 29.97 to 29.97, so I'm guessing it's that filter which causes the problem.

Oddly enough when I run mp4info on the output file it shows audio and video the same length.  I suppose that means that the video continues, it's just a black screen.  I haven't bothered to compare expected length to actual length of video/audio so I can't say for sure.

I'd provide a sample file, but I can't - it would be huge, and, for reasons which should be obvious, I can't trim the file to make it shorter.  Any thoughts on how to fix this?  I bet it's a simple fix if you know where the code is.  :)

jimmyswimmy

Any thoughts?  I'm happy to try some tests if anyone has any ideas.  I thought I tried trimming first with a copy and then recoding things, but my recollection is it didn't work.  If someone has a workaround or any other thoughts I'd really appreciate it.

Or am I in the wrong forum?  I figured this might be a windows-centric issue.  Any ideas would be appreciated.  Thanks.

mean

Need to look into it, a bit short handed at the moment


Jan Gruuthuse

When trimming/editing/cutting blocks, you can only do this with up/down arrows or or . Not with left/right  keyboard arrows  or /
trimming/editing/cutting 1st using copy for audio/video Output and save the result as new video, check new video if sound is ok. Then do the other stuff

Jan Gruuthuse

Small real time demo showing:
Trim video at begin. Cut block in between. Chop video end by putting marker [ B] at end and saving.
Duration: 2.04 minutes. Subtitle track giving info.
Download 35 MB: Avidemux263EditCutTrim
Unzip and place these 2: Avidemux263EditCutTrim.mp4 and Avidemux263EditCutTrim.srt in same folder and play with vlc. If subtitle not showing. Select in vlc: Video: Video Subtitles: Track 1

mean

Cant reproduce the problem
Do you have  a short file + what you do , that you could share ?

jimmyswimmy

Quote from: Jan Gruuthuse on May 03, 2013, 07:10:42 AM
When trimming/editing/cutting blocks, you can only do this with up/down arrows or or .

I've actually never used anything BUT these keys.  I'll try to figure out a way to share a short clip.  I've done this 4 times so far with different clips and can't seem to make it work.  Thanks for the note.

jimmyswimmy

Quote from: Jan Gruuthuse on May 03, 2013, 10:50:10 AM
Small real time demo showing:
Trim video at begin. Cut block in between. Chop video end by putting marker [ B] at end and saving.

Great tutorial, thanks for that.  So far the shows I've been using avidemux for are kids' shows with only commercials before and after, so I usually just select 'A' at the beginning of the show and 'B' at the end and then process.  So I tried your technique to see if there was a difference.  And it worked.  So either I've been doing it wrong all the time, or I have a workaround now.  Either way, thanks for that.

How did you make that video? Seems like a good way to demo things.

By the way, any chance you have a video like that on how to use the jobs/queue system?  I tried following the wiki at http://avidemux.org/admWiki/doku.php?id=using:joblist but no luck.

jimmyswimmy

Quote from: mean on May 04, 2013, 07:12:06 AM
Cant reproduce the problem
Do you have  a short file + what you do , that you could share ?

I tried to shorten the file, but it crashes avidemux when I try to go to the end of the file.  Pretty cool.  If you want to look at that it's here:  http://rapidshare.com/files/2956463495/short.mpg  So I guess that didn't work, unless you're interested in a way to generate a crash.py file.  The original file is generated by mythtv and then I used ffmpeg to trim it - and there was a frame sync error coming from the second audio stream when ffmpeg processed it.

I was using the 'A' and 'B' buttons to select the start and end of the show (there are no commercials in the middle), and I selected the frame to start and finish using the double-arrow buttons to find an I-frame.  By using the method Jan suggests (cut the beginning and end off first) it works.  So... worth spending time on?  Maybe not.  Thanks for being interested!

Jan Gruuthuse

Quote from: jimmyswimmy on May 06, 2013, 03:18:59 AM
Quote from: Jan Gruuthuse on May 03, 2013, 10:50:10 AM
Small real time demo showing:
Trim video at begin. Cut block in between. Chop video end by putting marker [ B] at end and saving.

Great tutorial, thanks for that.  So far the shows I've been using avidemux for are kids' shows with only commercials before and after, so I usually just select 'A' at the beginning of the show and 'B' at the end and then process.  So I tried your technique to see if there was a difference.  And it worked.  So either I've been doing it wrong all the time, or I have a workaround now.  Either way, thanks for that.

How did you make that video? Seems like a good way to demo things.

By the way, any chance you have a video like that on how to use the jobs/queue system?  I tried following the wiki at http://avidemux.org/admWiki/doku.php?id=using:joblist but no luck.
Ubuntu kazamscreencaster (desktop recorder)
http://www.twm-kd.com/category/linux/kazam/
think fraps (c/w)ould do the same for windows or any good desktop recorder.
subtitles where done with aegisub
OK will look into doing the same for avidemux jobs/queue. Image says more then some words ;)
http://www.aegisub.org/


jimmyswimmy

Quote from: Jan Gruuthuse on May 06, 2013, 02:49:36 PM
posted demo avidemux jobs/queue in documentation section

Wow!  Thanks a ton... my comment was meant as only a hopeful suggestion.  You, sir, are awesome.  I am downloading it right now!