IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
timeshift with neroAacEnc
shrek88
post May 31 2013, 07:09
Post #1





Group: Members
Posts: 16
Joined: 8-August 08
Member No.: 56840



i encode a video for my cellphone in mp4 format with x264 and nero(hev2), then muxed with mp4box.
but the audio can't sync up to video.

the audio duration is longer than the video and the orignal audio file.

Go to the top of the page
+Quote Post
shrek88
post May 31 2013, 07:13
Post #2





Group: Members
Posts: 16
Joined: 8-August 08
Member No.: 56840



how to make a time accurate file with nero?
quicktime does it well, but i prefer to nero, better sound, maybe
Go to the top of the page
+Quote Post
db1989
post May 31 2013, 10:17
Post #3





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



QUOTE (shrek88 @ May 31 2013, 07:13) *
quicktime does it well, but i prefer to nero, better sound, maybe
I remind you, again, of TOS #8. Adding “maybe” does not relieve you of your obligation to follow the rules.
Go to the top of the page
+Quote Post
Kohlrabi
post May 31 2013, 12:03
Post #4





Group: Super Moderator
Posts: 1110
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



Either cut the audio using i.e. SoX to have the correct length, or use a video processing tool like Avidemux or VirtualDub to sync audio and video.


--------------------
It's only audiophile if it's inconvenient.
Go to the top of the page
+Quote Post
marc2003
post May 31 2013, 12:57
Post #5





Group: Members
Posts: 4740
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (shrek88 @ May 31 2013, 07:09) *
the audio duration is longer than the video and the orignal audio file.


that would suggest your software is broken. tongue.gif try handbrake.
Go to the top of the page
+Quote Post
Dynamic
post Jun 3 2013, 02:04
Post #6





Group: Members
Posts: 832
Joined: 17-September 06
Member No.: 35307



I've been experimenting along similar lines for opportunistically-taken smartphone gig footage from the group I work with.

I'm using qaac (iTunes/Quicktime encoder) to encode my AAC from a lossless soundboard audio source - blind testing usually indicates it is a little better than neroaacenc and I want to replace the smartphone audio track.

If you have some audio in sync, the method below should allow you to sync your preferred audio to that and then use it to replace it.

I believe I have a reasonably easy way to synchronize my High Quality (HQ) audio with the Low Quality (LQ) audio then remultiplex the MP4 with my HQ audio in sync.

Audio sync:
I open my lossless HQ audio in Audacity (this sets the project rate to 48kHz). I drag the source video file (.3gp) onto Audacity, and it uses ffmpeg routines to decode the AMR Narrowband 8kHz mono (LQ audio) from my phone's .3gp file. It will be resampled to 48kHz on the fly in Audacity.

I SOLO that LQ track and find an obvious sound perhaps near the middle of the LQ audio that will also be audible on the soundboard audio. It might be a handclap or a clapperboard in a well-planned video project or the first note of a song, in my case. I put the selection cursor at the start and add a Label (e.g. 'LQ Song Title first note') on the label track.

I then find that same sound on the HQ track (SOLOed) and add a label for that.

I zoom out and use the <--> Time Shift Tool to roughly drag the LQ track from the LQ label position to the HQ label position. Then I switch to selection tool and zoom in to a 5 to 10 second range, then back to <--> Time Shift Tool. I'm usually within a few seconds of fully aligned. The easiest way to align is usually to switch to Spectral View and vertical zoom to 0-4kHz or so on the HQ track. This makes it easy to visually align and it never seems to need further adjustment when auditioning - I try muting and soloing and adjusting the playback gain on the LQ track to check the simultaneity.



I then use the Selection tool and select in the HQ track from the start position to end position of the LQ track (yellow bars appear as it snaps to the ends). I then Trim to selection then delete the label track and LQ track, then Align with Zero and Export my track. (I can use qaac as external encoder in Audacity e.g. with the following commandline:
CODE
"C:\Program Files\bin\qaac.exe" --cvbr 128 --silent --ignorelength - -o "%f.m4a"

but I often Export as FLAC then use foobar2000 to do the conversion with ReplayGain adjustment applied and Advanced Limiter with QAAC as a commandline encoder.

I then open YAMB and Create/"Click to create MP4 with multiple video, audio, subtitle and chapters streams". I then add the original .3gp file followed by the HQ audio file. I then deselect the LQ audio (track#2) from the .3gp video, choose my output file name then hit Next.

The yamb.log file indicates that the mp4box commandline used (having detected the frame-rate, which tends to vary from around 9.5 to 10.5 fps on my phone) is:
CODE
"c:\program files\yamb\mp4box.exe" -add "C:\Users\Public\Music\VIDEO0165.3gp#1:fps=10.419" -add "C:\Users\Public\Music\HQaligned_cvbr_128k.m4a#1" -itags tool="" -new "C:\Users\Public\Music\VIDEO0165_HQaudio_cvbr_128k.mp4"


I have actually made 2 versions. First, for easy yet high quality transcoding to DVD in Windows 7, I keep the original video stream and audio at about 330 kbps CVBR (--cvbr 1411 setting comes out to around 330 kbps in qaac).

For a small internet/mobile version, I might well choose 96k CVBR LC-AAC and make an intermediate file with original video stream and 96k audio. I then throw that intermediate file into Handbrake and use AAC passthru to preserve the 96k audio, while I set the video to x264 Constant Framerate, Constant Quality (somewhere from 20.0 high quality, to 26.5 modest quality, low bitrate)

A little background to sync issues:
With some recorded digital TV (Windows Media Center recording from a £20 kworld DVB-T USB device, saving the original MPEG-2 video with MP2 audio inside some .wtv file format, I found that using Handbrake x264 at Variable Framerate caused sync issues in most players except sometime Quicktime Player that weren't present with Constant Framerate. For basic TV, I usually make do with the internally supported FAAC at about 128-160 kbps for simplicity.

For the problem of replacing LQ audio with HQ audio, I first tried using mp4box (via the YAMB GUI) to separate the video and Low Quality (LQ) audio streams and remux the same video with the HQ soundboard audio. (It did work fairly well on one previous video, but not this latest one which led me to discover the method above, which is easier and more accurate, so I redid the first video that had worked)

I suspect the video frame timing and audio timing is controlled by the MP4 container, so demuxing the streams perhaps causes loss of that timing. Using the stream from within the mp4/3gp transport seems to work properly.

I'll probably post a post on these forums with full details as a guide in a day or two, and possibly link it to this thread.

The resulting file plays properly synchronized in Windows Media Player, Quicktime Player, VLC, my HTC Wildfire low-end Android phone, my LG TV (via USB drive), so I reckon it's pretty compatible.

This post has been edited by Dynamic: Jun 3 2013, 03:03
Go to the top of the page
+Quote Post
Dynamic
post Jun 4 2013, 18:52
Post #7





Group: Members
Posts: 832
Joined: 17-September 06
Member No.: 35307



If posted my notes on my workflow that I'd summarised above on the A/V subforum, here. It should include enough info for users on Mac or Linux or users of other tools and encoders to adapt the method for themselves.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2014 - 19:57