VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Try avidemux. But I'm not sure if it supports h264 in mpg container.
    Quote Quote  
  3. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    Nope. Does not.
    Quote Quote  
  4. 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)
    Quote Quote  
  5. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    WOW. Thanks.

    Sounds awful lot of work

    Also, FFMPEG is crashing right after pushing enter. No errors to read.
    Quote Quote  
  6. VH Wanderer Ai Haibara's Avatar
    Join Date
    Jan 2006
    Location
    Somewhere on VideoHelp...
    Search Comp PM
    Are you running ffmpeg from the command line, or from Explorer?
    If cameras add ten pounds, why would people want to eat them?
    Quote Quote  
  7. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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?
    Quote Quote  
  8. 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
    Quote Quote  
  9. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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?
    Quote Quote  
  10. 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
    Quote Quote  
  11. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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.
    Quote Quote  
  12. Just curious what editors are you using?
    Quote Quote  
  13. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    Premiere CS4 and Xilisoft converter... OK it's not an editor
    Quote Quote  
  14. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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.
    Quote Quote  
  15. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    I am guessing this is MKVExtract... sorry
    Quote Quote  
  16. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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?
    Quote Quote  
  17. 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...)?
    Quote Quote  
  18. Member
    Join Date
    Feb 2009
    Location
    Estonia
    Search Comp PM
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!