video speed goes faster after export, audio loses quality

Hello,

I’ m trying for quite a while to export my video edited in blender but i can’t match video with audio speed. Video and audio are recorded to different equipment and i want to maintain the audio quality (Uncompressed 24-bit PCM audio, 192000 Hz) while exporting an HD video.
Video file imported is .MTS 1920x1080, codec H.264, 25 frames per second.
After directly importing the video with it’s own audio in blender’s timeline, and having set in properties tab the settings same as of the video’s, i have the video part presented as around double the size of audio’s in the timeline, and it’s speed being slower than normal when played back in blender’s video preview . The audio is at the normal speed.
Messing around, i found out that after changing the frame rate from 25 to 50, i got the video played at a normal playback speed having the same length as the audio in the timeline. It seemed weird, but i thought that if it works, who cares? Well i did some editing, basically just synchronizing the audio to the video and adding an image in the beginning and one to the end of my video, being dissolved in and out each time. I’m happy with the result and begin to export after checking the properties parameters and choosing codecs for video and audio. The result is a video with sound being played back at normal speed and video running fast forward.
In my first attempt i used render presets as dimensions, with a 1080x720 resolution, 50 fps framerate, MPEG-2 format with 6000 bitrate, GOP 25, mp3 at 320. After not succeeding with my first attempt, i tried several options, but i always have a fast video. By changing dimension, in properties render tab, to HDV 1080, i got automatically a resolution of 1440x1080 and frame rate of 23.98 fps. At this time export to avi with h.264 codec, and PCM with 384 as the highest, able to adjust, bitrate. That time i had the video played back at quite a normal looking speed but completely unsynchronized to the audio. In blender’s timeline i was also able to see the audio’s part length being around half the size of the video. So around the middle of the video, audio is being cutted out… Furthermore, audio comes out at 16-bit PCM audio at 44100 hz, which is quite smaller than my source audio. I’ d like to keep it uncompressed if possible.
I think that the problem is being created from the beginning, when importing the file and not having it in blender in the correct time as shooted (total length of shooted video is 1,42 min and lenght of video in blender is about 3,35 min…). So actually this would make the whole thing an import issue than an export one…
I guess there must be some kind of simple solution for this to work, and i’ d really like it to, but for now, i’ ve been working two days in the program and reading in wikipedia and forums about exporting and video and didn’t manage to find a solution.
Any ideas?

Ok. I downloaded handbrake, from which i exported my .MTS video to .mkv
With .mkv i was able to work in blender with a 25 fps frame rate. I was able to export a 960x540 video, container avi, codec mpeg2.
Then i also succeded exporting 1920x1080 , container .avi, codec ITU H.264. I also tried the ogg with vorbis audio but i get a “broken” sound.
But that’s a relief! At least i have an export working. And i think 1920x1080 is considered HD alright.
Now my task is to create a file with the audio uncompressed. In every attempt (except the ogg vorbis failure), i’ ve been using the PCM audio codec, which is as far as i understand the only uncompressed option i can go with. Below the audio codec’s choice, you got a bitrate option which is adjustable till 384. In any case i got a 16 bit audio at 44100 Hz sample rate. The audio file that i imported in blender was 24bit, 192.000 Hz sample rate. I have quite a loss. Is that blender cannot manage such big files as this?
I’ ll try to find out. Another idea would be to try and import my blender export into some other video editor who can handle big audio files…

Two more places to adjust sound properties and i’ m good with 192khz export. Still trying for the 24bit…
The first is going to user preferences–>system, and there are some options about sound. Changing there to 192000 sample rate and to 24 bit Signed, or even greater audio sample formats didn’t give any difference at the exported file. I use the SDL device choice, cause with the OpenAL i have distortion at playback. There is also the Jack option which is what i’m trying next as it seems. Jack is the advanced option which i never got really into, but seems like i have to, since it will might do the job…
The second place i found, where i was able to adjust sample rate and have a sucessfull export with this setting stored is at the scene tab of the properties window. There you find a choice to adjust sample rate and other properties like mono, stereo or suround. It’s a pity there is not an option for audio sample format. If you go to mixdown you are given the option to have a 24bit format, but this way you have only the audio as an export. So another idea to do my task would be to take the desirable audio output from the mixdown and compile it with the exported video at a different video editor, which will hopefully be able to export it totally uncompressed.
Let’s see what i can find…

So, after not being able to figure out how to export the final video with 192khz and 24 bit audio, i tried my last mentioned suggestion. After searching into several video editing programms i found my reply with ffmpeg. ffmpeg is a command-line tool that basically converts audio or video formats. But it is also able to compile video with audio, and the good thing about it is that it can maintain the input codecs at the output file. It’s funny to use a program with no graphic interface to work with video, but it’s a total respect for ffmpeg since it has been the only program i was able to find to do my job. I used the video output from blender and compiled it with the audio mixdown from blender. So, in terminal, i used the command ffmpeg -i video.avi -i audio.wav -map 0:v -map 1:a -c copy output.avi and here i have my uncompressed result! The parameter -i defines the input files to compile. The parameter -map defines to use the video (v) from the first inputed file (0) and the audio (a) from the second inputed file (1). The parameter -c copy defines to copy the inputed codecs as they are.

It’s been a long run, and so i am relief i managed to overcome it! :yes:

Edit my reply. Not the same issue I’m having

Emo