Hi,
I am new to the forum. I purchased a helmet camera kit which is recording in H.264 format. I did not know much about video conversion back then and as the website stated there is a free software that can be used to convert these I bought it. I discovered that the free software (SUPER) isn't doing the job. Far from it. So I was recommended Xilisoft by the seller. Xilisoft is able to convert it into DV but after that I must recompress it again.
This seams a little awkward to me because it's a helmet cam and I am filming pretty fast moving objects. So after recompressing them I will lose quality. Not much when you look at ducks, but with fast moving objects, it's very noticeable.
So what i really need is to just cut and join these H.264 MPG files without recompressing them. I have tried numerous software but nothing seams to do the trick.
Is there are software that can do it?? And as the clips are mostly my weekend rides on motorbike, it does not have to be cut on exact frame.
Here's a sample file: http://dogcamsport.co.uk/vids/dvx-raw-file.mpg
+ Reply to Thread
Results 1 to 18 of 18
-
-
It's quite difficult to process because 1) it's interlaced h.264, and 2) it's in a MPEG-PS container
Even if you re-wrap the container, most programs won't be able to preview it properly because it's interlaced. (I tried using tsmuxer and tsremux, and h264ts_cutter - because at least then you would get a visual preview, but it doesn't work properly, the video is distorted even before cutting)
The only way I can think of doing this losslessly is by mkvmerge, and cutting using the split function (you won't have a preview, you will have to jot down the split times while previewing in a media player)
You can demux the raw video & audio streams using ffmpeg commandline:
ffmpeg -i input.mpg -vn -acodec copy output.aac
ffmpeg -i input.mpg -vcodec copy -an output.h264
This will give you 2 raw streams output.aac, and output.h264
You can use mkvmergegui to make a new mkv, highlight the video track and in the format specific options tab, specify 50fps , press merge
If you want to cut up a mkv file, just use the global tab, and enable splitting. In this example, I split at 10secs, so there is a 0-10sec segment, and a 10-17sec segment
In this zip file there is the full mkv (out.mkv), and the 2 split segments (cut-001.mkv, cut-002.mkv)
http://www.megaupload.com/?d=L83K2UAF
Now if your camera has a progressive mode, avidemux should be able to handle it in the .mkv container or .mp4 container with a preview (ie. you would only have to re-wrap the video) -
I tried from Start/Run/cmd and total commander's command line.
Can it be a codec problem? I have recently reinstalled XP. Maybe I've missed to install something? -
ffmpeg has many different builds, there are new branches and active develpment with new releases every week. Some releases fix things, some break things. I used r16596 successfully from here http://sourceforge.net/project/showfiles.php?group_id=205275&package_id=248632
I tested and you can also use the front end avanti, but it's a bit buggy (it almost looks like its crashing), but that's probably because of your atypical file combination of interlaced h.264 in mpeg. It does work, you have to enable the audio to demux, then enable the video to demux (2 steps), the end result is bit-identical to the results using the command line -
Yup. It was the newest build that crashed. Previous one works!
Now another problem
The audio is progressively going out of sync. By the tenth minute it's out of sync about a second. It's not something that has occured now. It happened with any editor (players play fine) I have tried. I found a way to fix it in Virtualdub when I converted files to DV-AVI but can I fix it in H264 too? -
How are you determining the sync issues? Did you set the fps in mkvmerge? or are you playing the raw files?
You can strech/shrink the audio, or play different fps in mkvmerge (this doesn't really alter the raw video, audio, it just sets it in the container to playback differently) - also if you are editing/cutting, you may get even worse sync issues
Another approach might be to shrink/strech the audio and re-encode the audio, but leave the video intact -
Raw files play correclty in players. The sync issue only occures in editors.
I noticed the sync problem already when converting the mpg files to DV-AVI with Xilisoft. It also happens in Premiere.
In MKVmerge I set the fps to 50 and muxed the MKV. The mkv file starts OK, but audio stops about a second before the video stops.
The recorder is set to save files in 200MB clips, so I can compare the and and the beginning of clips. -
I have found other posts with the similar issue as well, seams it has something to do with interlaced video: http://forum.doom9.org/archive/index.php/t-130825.html
Anyway. Thanks a bunch! I get what I want now even if I must stretch the audio. But one more question, what can I use to demux audio from MKV? Avanti seams not working.
I want to convert the sound from stereo to mono, normalize it and use a noise reduction, so I'd prefer to do it after I have cut the entire video instead of going over every clip. -
I have run into another problem with audio sync.
First, I want to edit audio because I am using an external mic, which is mono, but the input of the recorder is stereo, so the signal get recorded only on one channel. I want to convert it to mono. And, Although the mic has a battery, which is is powering it, the signal is still very weak so I need to boost it a bit.
So I have cut and joined the files using MKVmerge so that I had two ~20 min files. As I said before, the audio was progressively going out of sync so during the process I stretched it for every clip and these two final files were in sync and all good.
I then did following:
1. Joined these two files into one MKV using MKVmerge - audio was still in sync
2. Demuxed both audio and video using MKVextract
3. Converted AAC to WAV using Adobe Media encoder
4. Edited audio in Adobe Audition - converted to mono, amplified. There was also 4 sec silence in the end which I cut. Saved into MP3.
5. Muxed audio and video again in MKVmerge - set aspect ratio 4/3 and FPS to 50.
6. Looked at the new clip and saw that audio stops about 36 seconds before video, so I calulated how many seconds are in 35:22 (2122) and muxed again and stretching audio by 2158/2122.
Now the audio is synced in the beginning and in the end of the clip but totally out of sync in the middle.
I also noticed that the length of the clip is changing. So that the first time the one big file's length was 40 minutes, but the second time it was 35:58.
What am I doing wrong? -
Not sure what caused the new sync issues.
Did the original .mpg files have sync issues for longer clips? You said the raw files played fine (did you mean the .h264 video and .aac audio as elementary strems)? Were sync issues introduced only on editing and re-muxing?
Try leaving both the video in the in sync .mkv container, but swap the audio in after (i.e. 2 audio tracks), you can remove one later with mkvmergegui just uncheckmark it (don't use mkvextract)
Maybe you can try swapping/fixing the audio at an earlier stage, as 2 seperate mkv's, or even as .mpg (i.e. swap the external audio at the earliest stage) - because you manipulated the original audio, but didn't do the same processing with the external audio.
I think the last resort would be not do this losslessly, but there would be less chance of sync issues. At least you could crop, denoise, filter, process and deinterlace/bob it. How are you going to be viewing the final product? (i.e. pc, standalone player, etc...)? -
I found the cause. I am not sure what is actually happening and how to fix it other than do it again from scratch. But this is what I think is causing it:
When I split the first clip after timecodes with MKVmerge, I checked the "link files" box. I then used the second small clip as a first one in the big merged file. So that the first timecode of the merged file was 05:01 instead of 00:00. So I split a couple of seconds from the beginning of the big clip. The first timecode is now 00:00, but it didn't fix the sync thing. I did this only with the first clip and the first of two bigger MKV files. I was able to sync the audio in the second bigger MKV with ease.
I don't want to process it any more because it already saves at bitrate of 2970. Compressing it again will cause noticeable quality loss. I get the best result when watching the video with VLC player using real time deinterlace.
Similar Threads
-
convert .flv to .mkv losslessly
By lovelove in forum Video ConversionReplies: 8Last Post: 19th Jul 2011, 03:04 -
Edit AC3 tracks losslessly?
By digitalfreaknyc in forum AudioReplies: 7Last Post: 17th Feb 2011, 09:20 -
Losslessly convert AAC file to MP3?
By sldvd in forum AudioReplies: 16Last Post: 17th Nov 2010, 06:04 -
How do I losslessly join 2 DV-AVI files?
By sasuweh in forum Authoring (DVD)Replies: 3Last Post: 14th Nov 2010, 11:07 -
Best way to losslessly compress LPCM?
By dimtim in forum AudioReplies: 5Last Post: 13th Nov 2008, 11:56