Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: timeshift with neroAacEnc (Read 11597 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

timeshift with neroAacEnc

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.


timeshift with neroAacEnc

Reply #1
how to make a time accurate file with nero?
quicktime does it well, but i prefer to nero, better sound, maybe


timeshift with neroAacEnc

Reply #3
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.


timeshift with neroAacEnc

Reply #5
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: [Select]
"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: [Select]
"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.
Dynamic – the artist formerly known as DickD

 

timeshift with neroAacEnc

Reply #6
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.
Dynamic – the artist formerly known as DickD