An original FLV was split into multiple pieces. I am trying to reconstitute the original by concatenating the pieces with mencoder. The resulting video and audio seem fine by themselves, but I cannot get them in sync. What is particularly exasperating is that the sync loss is not constant throughout the entire end result, it starts out very bad and gradually gets better. Then it stays almost synchronized for a while, but ultimately get worse again (the boundaries of the pieces seem particularly bad). I experimented with various values for "-audio-delay" and "-delay", but nothing really helps because of the nonconstant delay. As a newbie I'm really baffled by this. In the case of FLVs does the sum of the parts not equal the whole? In other words, don't the individual pieces contain the necessary information to allow a succesful splicing to reconstitute the original? Am I using the wrong tool or missing some critical options? I've searched these forums and googled the web, but can't find a clear answer. If someonce could point me in the right direction I'd greatly appreciate it. Thanks in advance.
+ Reply to Thread
Results 1 to 15 of 15
-
-
That isn't surprising at all. Trying to reconstruct an FLV file is like playing tennis against a set of drapes. You can try to put them together in VirtualDub. There's a guide around here that deals specifically with FLVs. Also, there are many versions of Mencoder, and the similar FFMPEG. Google "Mencoder +Celtic_Druid" for some very recent builds.
-
Originally Posted by Bjs
I created an .avi and .wav, but can't get the avi to load. I get the error "DirectShow failed to render the requested media file".
No FAQ, no troubleshooting guide, nothing. I'm willing to roll up my sleeves and spend the time, but being expected to stumble around in the dark is just unacceptable.
If someone can point me to basic Syncview information I'd greatly appreciate it.
-----------------------------------------------------------------------------------------------------------------------------
Ok, here's what I learned since posting the above:
1. VirtualDub can't open the avi either, but at least it provides useful info. It is telling me that the appropriate VFW codec is not installed and therefore can't decompress FMP4 format.
2. The Windows codec that I need is apparently FFMpeg.
3. But there are no prebuilt Windows FFMpeg codecs anywhere to be found.
4. I don't develop Windoze apps so don't have a Windoze compiler, therefore the source code doesn't help me.
Therefore I appear to be screwed.
Does anyone reading this understand what I am trying to do and what my predicament is? If there are solutions they would most likely consist of:
1. Exclusively linux tools that alleviate the need to run anything under Windoze.
2. Solving the codec problem by locating a prebuilt codec for Windoze.
3. Extracting the video using linux mencoder to a format that can be utilized under Windoze.
If anyone has a suggestion along these lines or something even better please let me know. Before I go completely insane.
Thanks. -
Well I was able to extract mpeg1 video and wav audio using SUPER. I appear to be missing the neccessary codecs on my XP system to allow anything other than mpeg1. Don't know where these codecs can be obtained, thought they might be included in the celtic_druid P4 mplayer builds, but they are not. Syncview seems to happily accept mpeg1 and wav as input. To my amazement it syncs up the AV perfectly during playback. However the corrected wav output will not sync with video during a subsequent mux attempt with VirtualDub. Not only do I have to fiddle around with a delay, but the sync loss is nonconstant in the muxed output.
Just for grins I decided to generated a WMV (which according to SUPER is experimental) and that was synced perfectly during playback with the Windoze Media Player. The available evidence at this point suggests that there is nothing wrong with the source flv and that a format conversion without loss of sync is possible, but that attempting to sync manually using these suggested tools is just not possible.
If anyone has a suggestion before I decide to punt please let me hear from you soon. This has already consumed a huge amount of time and I cannot continue to devote this much time on an ongoing basis. -
Sounds like you should be the one to write the "how" to document
FFDshow is the codec pack that will let you view and re-encode the flv files. You must have a copy of FFDshow dated October 2006 or later - look at the guide below for a link. Great info and a great app here:
http://www.digital-digest.com/articles/FLV_to_AVI_Conversion_Guide_page2.html
Here's the FFdshow versions that will work with flv:
http://sourceforge.net/project/showfiles.php?group_id=173941&package_id=199416&release_id=439904
Convert all three files to AVI with Audio per the guide above, Make sure each AVI has good sync, THEN concatonate together... -
Originally Posted by Soopafresh
Everything was sailing along up to the very last step, joining the AVIs using VirtualDub MP3 Freeze.
When I try to append a segment I get the error:
" Cannot append segment: The video streams have different sampling rates ( 23.97 vs 23.98 ) "
So I tried changing the rate so that they are equal by writing out a new avi after changing the rate via the video menu. That does not work either. I now get the same error, and it identifies the offending rates as being equal!! WTF!?
I don't know what to do at this point. At any rate the guides are wrong as I followed each and every step to the letter and was not able to join the AVIs.
---------------------------------------------------------------------------------------------------------------------------------------
Ok, some progress. VirtualDub is not the right tool for the job. Since I had a minor degree of success in joining the flvs with mencoder I decided to try join the good avis produced in the above steps using mencoder. Success!!
The resulting avi maintains AV sync throughout its entirety!
Only one problem remains: At the join boundaries there are duplicate sequences of frames which produce discernible hiccups. Is there a tool which can automatically detect and remove duplicate sequences within a range of frames? -
Yes, but the only one I know of works with Avisynth. Still, if you can work with Mencoder, Avisynth will be a breeze.
http://akuvian.org/src/avisynth/dedup/ -
Originally Posted by Soopafresh
I do not know what tool was used to split the original video into multiple flvs. Perhaps the problem is an artifact of the tool that was used. The problem is that a sequence of frames at the end of the source avi also appears at the beginning of the avi which I'm trying to append. So when they are joined that sequence is duplicated and its back-to-back position in the stream produces a noticeable glitch during playback. It's not a long glitch, maybe 1-2 seconds at most, but is very annoying. With the plethora of available tools I theorized that there should be an editing tool that lets me set a range of frames to look at and the tool would determine and flag any duplicate sequences. For example, I set the range to 6 seconds to cover 3 seconds of the end and 3 seconds of the beginning of 2 avis joined to produce a single stream. This implies some capability to step through the frames and set markers to identify the range. Once a range is set it performs analysis to determine a duplicated sequence. What I am not after is randomly appearing individual frame duplicates. If it happens to catch those too then that's a bonus, but I'm primarily after the duplicated sequence resulting from joining.
Hopefully it's clear now what I'm trying to do. Is AviSynth still the right tool? -
Originally Posted by Bjs
The problem here is that too many people refuse to read or cannot read.
There is a SyncView website, and if you read the messages and read the product description you will see what the problem is: SyncView was written specifically to do task X, but some people at this website decided years ago that SyncView should do task Y, and now most newbies become frustrated when they find that the software doesn't do task Y very well.
Let me know when this new SyncView guide is ready, because I will have to verify and confirm its accuracy.
Regards (and happy holidays)
- SD -
The VideoHelp guide for cutting AVIs using VirtualDub is invalid because the MP3 Freeze VirtualDub has broken audio direct stream copy. I tried to simply load and save an AVI but that doesn't work either, the resulting AVI has truncated audio. So direct stream copy of audio seems broken in MP3 Freeze. Any workarounds?
-
Note: You may have to reload this site a couple of times
Try Avimaster, a commandline app that might work at cutting the ends/starts off the files.
http://www.thozie.de/dnn/AVIMaster/tabid/53/Default.aspx?PageContentID=35
http://www.thozie.de/dnn/LinkClick.aspx?link=AVIMaster.zip&tabid=53&mid=388
-rs#### Write out.avi, Strip Stream ####
-xs#### Write out.avi, Start with Frame ####
-xe#### Write out.avi, End with Frame ####
-fv##.## Set this speed (frames per second) for Video
-fa Fix Audio Scale for Length mismatch
eg
Avimaster -xs15 Source.avi Target.avi ----> Should trim the 1st 15 frames off of the file. -
Originally Posted by Soopafresh
What I find really strange is that mplayer/mencoder has an option for truncating an avi by using the "-frames" option which works flawlessly. But there is no corresponding option to skip without playing/encoding frames at the beginning of an avi. The closest one can get is to skip bytes or time neither of which can be accurately converted to a frame count. To me it seems intuitive to have a "-skip-frames" option available when using "-aoc copy -voc copy".
To me trimming frames from the beginning of an avi should be conceptually simple and a readily available capability, yet its turning out to be an intractable problem.
----------------------------------------------------------------------------------------------------------------------------------
Baldrick suggested using VirtualDubMod in another post, but that doesn't work either. VirtualDubMod seems to have a bug involving range operations spanning frames preceding the first keyframe.
I'm out of ideas. If there's a way to play an avi in reverse then maybe the mplayer/mencoder -frames option could be used.
Another possibility is to reencode the output of FLVextract to CBR. But if that's what it takes I'll skip it. Doesn't make sense to spend even more time to convert to a format that yields poorer quality. -
Yup, the problem is the keyframe, or more precisely I need to somehow insert a keyframe where I want to make the cut. Actually there is a recent discussion thread covering this topic in which AVIDemux and a manual procedure are mentioned. AVIDemux doesn't seem to have the right codec support under Windows. I'll try it under Linux and if that doesn't work will explore other ways to insert the keyframe.
-
Success at last!!
AVIDemux didn't help, but avimerge did. The pivotal concept was understanding keyframes.
The recipe for success is:
1. Convert the flvs to avis per the excellent conversion guide found here on VideoHelp.
2. Using VirtualDubMod identify the areas of overlap and proposed cut points. The overlap will typically be a small number of frames, so the cut point will fall before the first keyframe of every avi.
3. Cut each avi into 2 pieces, piece A up to the 1st keyframe, and piece B the 1st keyframe to the end.
4. Using mencoder reencode piece A with the lavcopts option "keyint=0". The output will be a copy of A with every frame now being a keyframe (Iframe).
5. The output of step 4 can now be cut with VirtualDubMod at the cut point identified in step 2.
6. The output of step 5 could be reencoded to reduce the number of keyframes, but since this is such a tiny slice of video rencoding to reduce keyframes (thereby producing a smaller file) is entirely optional.
7. Repeat steps 3-6 for each avi produced in step 1.
8. Merge the results into a single avi using avimerge: "avimerge -o out.avi -i p1.avi p2A.avi p2B.avi p3A.avi p3B.avi..."
I'll try to make this available via a mini HOWTO.
Many thanks to Soopafresh and Baldrick for nudging me in the right direction.
Similar Threads
-
Joining MP3 without 'blips' and synch loss at the joins?
By bizzybody in forum AudioReplies: 5Last Post: 8th Feb 2010, 01:45 -
Virtualdub or Avidemux better to cut FLVs with no quality loss?
By gumbygum in forum EditingReplies: 17Last Post: 28th Nov 2009, 10:13 -
Problem joining (concatenating) avi's in virtualdub
By uart in forum EditingReplies: 6Last Post: 21st Nov 2008, 15:44 -
A/V Sync on only some FLVs
By RedPenguin in forum Video ConversionReplies: 13Last Post: 23rd Jun 2008, 18:37 -
Problem Joining AVI files with MEncoder
By RetSpec in forum EditingReplies: 1Last Post: 6th May 2007, 22:00