That's a lot of work and hassle.Originally Posted by Chris KWhat's your objection to simply selecting the desired channels in AviSynth (as I've suggested)?
![]()
~John
+ Reply to Thread
Results 151 to 180 of 1190
-
-
Originally Posted by JNavas
Here it is...
1. Make your video settings including the subtitle option.
2. make your audio settings (probably ac3, bitrate 448, 2 channels for Kevin).
3. Set the Avisynth mode to USER and go to the editor.
4. Copy the Avanti AUTO script to the editor (choose with variables).
5. Add the Avisynth audio mapping to the script (test it with preview).
6. Disable the subtitle option at the subtitle page.
7. Go to the main page and start process.
8. (optional) save the setup in a template for later reference.
The script including additions would look like:
V=DirectShowSource("@source1_path")
A=V
V=TextSub(V, "path to your subtitle", 0 )
A=GetChannel(A, 1, 3) # gets front left and right ac3 channels.
V=AudioDub(V,A)
@preview V=ConvertToRGB(V)
V # output
Note that Avanti uses the A and V variables where the Avisynth examples use Audio and Video.
Also note that... V=TextSub(V, "path to your subtitle", 0 ) in the next Avanti version can be
given as... V=TextSub(V, "@subtitle_path", 0 ) which will refer to the path at the subtitle page.
This will make the script "template proof". -
Originally Posted by Chris K
FYI, Avanti requirements aside, AudioDub is not necessary (likewise variables) -- just GetChannel; i.e.,
Code:DirectShowSource("@source1_path") GetChannel(1, 3) # gets front left and right ac3 channels TextSub("path to your subtitle")
-
Originally Posted by JNavas
My example then would become...
4. Copy the Avanti AUTO script to the editor (choose without variables).
Code:DirectShowSource("@source1_path") TextSub("path to your subtitle", 0 ) GetChannels(1, 3) @preview ConvertToRGB()
Chris. -
Hey, Chris and John.
I was finally able to get my video converted with burned in subs, maintaining the proper 5.1 sound. In case you're curious how I did it, here's the method I used:
1. Used MKVExtractGUI to extract the AC3 sound and SRT subtitles. [7m]
2. Used Avanti to convert the video to mpeg2 M2V with burned in subtitles. [62m]
3. Because the TiVo HD can only handle AC3 sound up to 448kbps, I used BeSweet to transcode the 640kbps 5.1 AC3 sound to 448kbps 5.1 AC3 sound. [15m]
4. Finally, I used Avanti's mux template to join the M2V and AC3 files into an MPG container. [6m]
I ran steps two and three at the same time, so it took about an hour and fifteen minutes to convert a two-hour MKV with soft subs to an MPG with hard subs for playback on my TiVo HD. Not bad!
Thanks again for the help guys, I never would have figured out the more subtle features of Avati without it! It really is a useful bit of programming! -
Originally Posted by KevinSartori
Would take me at least 4-5 hours on my old single core Athlon.
Cheers,
Chris. -
Suggestions:
* If user clear the checkbox "Enable" in audio & video settings group, the fields inside group should be disabled(grayed) and vice versa.
* Almost same as above, If user choose choose "Copy Audio/Video" from combobox "Codec", the some fields should be disabled. If you don't understand what I mean, you can look at SUPER by checking "Stream Copy" and "Disable Audio/Video".
* Add hint tooltips.
* Add support for MEncoder.
In "Audio Settings" group, why there is no value "Source" in the combobox "Bitrate", "Sample Frequency", and "Channels"?
KUTGW (Keep up the good work). -
Hi ohboy888,
Thanks for your suggestions.
* If user clear the checkbox "Enable" in audio & video settings group, the fields inside group should be disabled(grayed) and vice versa.
* Almost same as above, If user choose choose "Copy Audio/Video" from combobox "Codec", the some fields should be disabled. If you don't understand what I mean, you can look at SUPER by checking "Stream Copy" and "Disable Audio/Video".
* Add hint tooltips.
Add support for MEncoder.
In "Audio Settings" group, why there is no value "Source" in the combobox "Bitrate", "Sample Frequency", and "Channels"?
For audio bitrate, FFmpeg always uses a default of 64 kbit/sec which is not what you expect when you set it to "Source" (tried it on mp3, ac3 and aac).
Audio sample frequency and channels would work but it would give a FFmpeg error when your source is ac3/aac 5.1 and you set the audio codec e.g. to mp2/mp3 which only support two channels. I can add it but it would have limited use.
Chris. -
Originally Posted by ohboy888
-
Hey, I just wanted to mention that the method I posted above to convert MKV to MPG with burned-in subs does have one small annoying problem. And it's a deal breaker. By the end of the encode, the audio goes out of sync by about a second. I have no idea why this is. I understand that with modern encoders, the framerate is actually slightly variable. I believe that FFMPEG is the culprit here and not BeSweet, but I can't be sure. Although the quality is a bit lower, I've gone back to using Nic's WMEnc w/Avisynth to convert movies with subs to WMV. I'll just have to go back to watching subtitled movies on my Xbox 360, instead of my TiVo HD. I've spent a lot of time on this and I just can't get it to work. No matter what I do, I either end up with audio that runs out of sync or has its channels swapped.
Thanks again for the help, guys! -
Originally Posted by KevinSartori
About the swapping of ac3 channnels. I tested this after you mentioned it in your earlier post. I took a clip with ac3 5.1 and converted to ac3 (6 channels) with a lower bitrate. Then I extracted both original and converted streams to 6 separate wave files. Then I loaded the source and converted wave files "channel by channel" in Audacity to compare them both audibly and visibly, and I saw no difference. I have no surround system to check it out so perhaps I overlook something.
EDIT:
After "extensive research", I found that it's not the FFmpeg ac3 codec that swaps the center and right channel but the FFmpeg/Avisynth interface. IMO you don't need Avisynth to do your conversions. Set codec to ac3 and bitrate to 448 and let FFmpeg do the bitrate conversion.
I used this script in the Avanti/Avisynth user mode to check things out;
Code:Audio=DirectShowSource("@source1_path") fl = getChannel(Audio,1) fc = getChannel(Audio,2) fr = getChannel(Audio,3) rl = getChannel(Audio,4) rr = getChannel(Audio,5) lfe = getChannel(Audio,6) # mergeChannels(fl,fc,fr,rl,rr,lfe) # same order, FFmpeg swaps mergeChannels(fl,fr,fc,rl,rr,lfe) # swapped to correct order
-
That makes sense, Chris K. What I've discovered is that the audio channels stay mapped correctly if you do the audio separately. As soon as you try to convert audio and video together, the channels go screwy. It's weird that Avisynth causes problems with FFmpeg because the channels are fine if I use Avisynth to convert the same files to WMV with Nic's WMEnc...
Good news, though. I've solved the problem with the audio slowly going slightly out of sync. Believe it or not, the problem was converting the video to M2V format instead of direct to MPG!
I can't tell you how much time I've spent trying to solve this problem, so I just kept trying different things. I understand that the "correct" way to mux video and audio into an MPG container is to start with M2V video and AC3 audio, but this was causing the audio drift problem. So I tried converting the video direct to MPG without audio and then using the MUX template (which I was using before) to put the transcoded AC3 and MPG together.
I'm still using BeSweet to convert the 5.1 AC3 audio from 640kbps to 448kbps because it uses AZID to normalize the audio level first before it transcodes it. I tried using Avanti to convert just the AC3 audio and it seems to work fine. So here's the slightly revised workflow:
1. Used MKVExtractGUI to extract the AC3 sound and SRT subtitles.
2. Used Avanti to convert the video to mpeg2 MPG with burned in subtitles.
3. Because the TiVo HD can only handle AC3 sound up to 448kbps, I used BeSweet to transcode the 640kbps 5.1 AC3 sound to 448kbps 5.1 AC3 sound.
4. Finally, I used Avanti's MUX template to join the MPG and AC3 files into an MPG container.
The audio stays perfectly synced this way and plays just fine on the TiVo HD!
If you're curious to check out BeSweet, it's pretty simple to use. Here's a sample command line that I use to convert an AC3 file to 448kbps and normalize it so that it peaks at 0db, this way you're not taking any chances with possibly creating a clipped audio file:
Code:BeSweet.exe -core( -input "D:\TiVo\movie.ac3" -output "D:\TiVo\movie-448.ac3" ) -azid( -L -3db --maximize ) -ac3enc( -b 448 -6ch )
-
Originally Posted by dark_guard
The best to me no doubt but the downside is it give to me a non standard frame rate for a given vid.*** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE -
Originally Posted by KevinSartori
Good news, though. I've solved the problem with the audio slowly going slightly out of sync. Believe it or not, the problem was converting the video to M2V format instead of direct to MPG!
I'm still using BeSweet to convert the 5.1 AC3 audio from 640kbps to 448kbps because it uses AZID to normalize the audio level first before it transcodes it.
Aside from the normalize BeSweet does, it still would be nice to do it all in one go with Avanti and I tested the following setup with success.
1. Select the Avisynth AUTO mode.
2. Do the video and subtitle setup (same like you already do to mpg).
3. Set audio to ac3, 448 kbps, 6 channels.
4. Load the source clip on both "Source 1" and "Source 2".
5. Set the "TS offset" field to 0.0001 (a trick to fool Avanti a bit).
6. Press the "Start Process" button.
Now when you look at the graph on the log window you'll see that Avanti inserted Avisynth between "Source 1" and FFmpeg to do the subtitling but sends the audio taken from "Source 2" directly to FFmpeg (so no channel swapping).
If the audio needs some amplification, click on the [ User VIDEO option > ] button to call up the "Audio" command line. You there can add the "-vol xxx" command (values somewhere between 500-1500). This is not the same as normalize so you have to take care not to clip the audio with too high values. Avisynth can also normalize audio but then we're back at the same swapping problem.
Currently Avanti only allows to load the same file on "Source 1" and "Source 2" when the "TS offset" option is activated and the 0.0001 setting suggests it is, while the value practically has no effect.
Note that with this setup, Avanti expects the video in your source file at stream 0 and the audio at stream 1. If your source file contains more streams, you may need to add some user mapping to the command line. You can check this by calling up the "Source properties" on the main menu.
If the BeSweet normalize isn't a big deal, you could give this setup a try. -
Chris K, you're the man.
Your "TS offset" trick to get Avanti to feed the audio directly to FFmpeg while the video is routed through Avisynth first is genius. Plus, it even works! What's nice about this method versus mine, aside from less steps and being much easier, is that this also works with MKV files that have DTS instead of AC3 audio. Totally excellent!
Honestly, the benefits of normalizing the audio are so slight that they're not even worth the extra steps/effort. I mean, heck, I can just turn my receiver up...
That's a good tip about stream 0 and stream 1. I have seen an MKV file before where the audio was the first stream, so it can happen. MKVMerge GUI is a good tool to rearrange and/or remove streams in an MKV container.
I really appreciate the time you've put into helping me out here and I plan to use this information to post a tutorial over at the pyTivo forums!
Thanks again! -
I meant to mention in my last post that I got thirteen of the following error messages using your new method during the encode. The new file seems to play back fine.
[vob @ 06FB2010]buffer underflow i=1 bufi=1639 size=1792
Is this important? -
Originally Posted by KevinSartori
I think you need to increase the VBV buffer size somewhat untill these messages don't show up anymore. -
Currently, I keep the VBV buffer size at 4096. Is there any disadvantage to going overboard here, like, say, 16384? Are there negative side effects to having the VBV buffer size too high? Is there such a thing as too high with VBV buffer?
-
Originally Posted by KevinSartori
Bitrate: 16384
Max rate: 30000
VBV buffer size: 4096
Did you get these settings from somewhere (Tivo perhaps)?. I have no experience with HD but for DVD players there are specs that say how much the firmware has to reserve for the VBV buffer (1835 kbit, I believe). If the given buffer size exceeds this, you'll get playback problems or the player will give an error.
I think it's better to keep the buffer size "as is" and to lower the "Max rate" a bit. It should also work and it's probably more safe where it concerns the Tivo VBV buffer size requirements.
EDIT: I found this at a doom9 forum thread...
"HDTV in the US is limited to an overall bitrate (audio and video) to 20000 kbps, so I would suggest a maximum video bitrate of 20000 - (audio bitrate)."
http://forum.doom9.org/archive/index.php/t-121998.html
https://forum.videohelp.com/topic356432.html
I don't think you need to lower "Max rate" that much because the Tivo seems to be quite tolerant. -
30000kbps is the max bitrate that the TiVo HD can handle. I went with 16384 as a bitrate only because that's the default setting with pyTivo. Although, as I'm sure you know, bitrate with FFmpeg is more of a suggestion than anything else. Most movies I convert seem to end up anywhere from 5000-12000kbps. FFmpeg seems to do a pretty good job on its own deciding how much data it should devote. One time, as a test, I had a movie that encoded with an average of 5500kbps. That was with the bitrate set to 8500. I tried two more encodes, one at 16384 and one at 30000. As I suspected, the resulting average bitrate/file size was nearly identical on all three encodes. That's when I realized that FFmpeg is gonna do what's it's gonna do, just as long as you don't limit it with too low a bitrate setting. That's why I'm not so sure that the new bitrate calculator in Avanti is terribly useful, unless FFmpeg's bitrate control acts differently with MPEG4 or the other formats it can encode with.
This is what the pyTivo guys have to say about -bufsize (default is 4096k):
Allows you to set the buffer size used by ffmpeg. Increasing this setting will allow higher bitrates during transcoding (see video_br setting), especially when transcoding to HD resolutions. But it may result in pixelation or audio sync issues with some sources. 1024k is fine for the resolutions used by S2 tivos. But 2048k or 4096k is preferred for HD tivos. Leave this setting blank unless you are experiencing audio/video sync issues and wish to test a different value.
What I've done is noted at what point these errors occur and then checked these spots after the encode is complete, but there don't seem to be any actual problems with playback on my PC or the TiVo HD. In the end, I don't like seeing these errors and I don't doubt that there are errors, but fortunately these errors don't seem to translate to actual playback problems.. I can't come up with a VBV buffer adjustment that doesn't either lower the quality of the image (2048) or cause a lot more buffer underflow errors (8192), so I guess I'll follow your advice and leave it where it is (4096) and call it a day.
Again, I appreciate your assistance and certainly enjoy the ongoing dialogue! -
Originally Posted by KevinSartori
That's why I'm not so sure that the new bitrate calculator in Avanti is terribly useful, unless FFmpeg's bitrate control acts differently with MPEG4 or the other formats it can encode with.
What I've done is noted at what point these errors occur and then checked these spots after the encode is complete, but there don't seem to be any actual problems with playback on my PC or the TiVo HD. In the end, I don't like seeing these errors and I don't doubt that there are errors, but fortunately these errors don't seem to translate to actual playback problems..
certainly enjoy the ongoing dialogue! -
Latest FFmpeg builds seems to revert the syntax change -b to -vb for video bitrate.
Because it's still in the docs and Avanti can only check it there, it now assumes the version
supports -vb which it doesn't.
Result; when using the latest FFmpeg builds with Avanti, FFmpeg will throw an error but continues.
Code:[NULL @ 0x3f4de0]Unknown option 'vb' [swscaler @ 0x3f5d70]Unknown option 'vb'
that the change -b to -vb which seems quite logical to me considering that audio bitrate
for a long time already is expressed by the -ab command, would be reverted.
For now you can still use new builds if you change a stored setting in the "AVANTI.ini" file.
You can edit the file in e.g. notepad or wordpad.
At the group [SYSTEM] settings, change ffmp_b=-vb back to ffmp_b=-b
EDIT:
Code:Unknown encoder 'libfaac'
latest FFmpeg builds because of a license issue.
Chris K -
Hello,
How can I change/configure properties for "XviD (Lib)" codec in AVANTI
The entry in the "Bitrate" boxes seem to have no effect while encoding using
"XviD (Lib)" codec.
The video is always encoded at 800-850 kbps bitrate, no matter what is entered
in the bitrate boxes, regardless of the type of video being encoded
The bitrate boxes only matter during MPEG1/MPEG2 conversions, as observed.
Is it possible to link the actual "Xvid" encoder properties dialog (with Profile Level,
Encoding Type etc.) with AVANTI
BTW, while using the "XviD" (NOT "XviD (Lib)") encoder, AVANTI always says
"Unknown encoder 'xvid'" as error message and encoding does not occur.
Latest Xvid is installed and is otherwise working fine.
Please help as soon as possible ... ... many thanks -
Originally Posted by The Black
http://ffmpeg.arrozcru.com/autobuilds (download the static build).
Read my previous post about the "Unknown option 'vb'" error message. It's a temporary bug in the current FFmpeg builds which is already reported and can be ignored. It has no effect on the encode results.
Is it possible to link the actual "Xvid" encoder properties dialog (with Profile Level,
Encoding Type etc.) with AVANTI
BTW, while using the "XviD" (NOT "XviD (Lib)") encoder, AVANTI always says
"Unknown encoder 'xvid'" as error message and encoding does not occur.
Latest Xvid is installed and is otherwise working fine. -
Hello Chris K,
Thank you for your prompt and helpful response.
To further clarify my situation, please take a look at some screenshots.
To answer your query regarding the FFmpeg build I use, here is a screenshot-1 :
http://img206.imagevenue.com/img.php?image=38296_Screenshot_1_122_82lo.jpg
of the FFmpeg version as detected by AVANTI during startup
Does the loaded template, "PAL_DIVX_2_PASS_HQ" have anything to do with the problem ?
What exactly does the template do ?
Other relevant details during file encoding (like bitrate, actual encoding bitrate etc.) are
indicated in this screenshot-2 :
http://img7.imagevenue.com/img.php?image=38510_Screenshot_2_122_827lo.jpg
One simple question: To encode at constant bitrate using AVANTI, one has to
enter the same bitrate in all the fields - Bitrate (kbit/s), Min rate & Max rate.
Is it correct ?
If so, then the encoding bitrate should be 1200 kbit/s as seen from the screenshot-2,
but it clearly isn't (see actual encoding status bar in screenshot-2).
For AVANTI status report after encoding, click below :
http://img264.imagevenue.com/img.php?image=38607_Screenshot_3_122_105lo.jpg [screenshot-3].
For bitrate and other properties of the encoded file click below :
http://img206.imagevenue.com/img.php?image=38642_Screenshot_4_122_556lo.jpg [screenshot-4].
According to your suggestion :
------------------------------------------
I downloaded and used the FFmpeg static build from the link:
http://ffmpeg.arrozcru.com/autobuilds/
FFmpeg version detected at startup
http://img180.imagevenue.com/img.php?image=38696_Screenshot_5_122_1192lo.jpg [screenshot-5].
But the same problem persists when encoding with the above version of FFmpeg.
Find the relevant screenshot here :
http://img167.imagevenue.com/img.php?image=38739_Screenshot_6_122_955lo.jpg [screenshot-6].
For AVANTI status report after encoding, click below :
http://img165.imagevenue.com/img.php?image=38790_Screenshot_7_122_806lo.jpg [[screenshot-7]
For bitrate and other properties of the encoded file click below :
http://img165.imagevenue.com/img.php?image=38790_Screenshot_7_122_806lo.jpg [screenshot-8].
Notice that the file has exact bitrate properties as the file encoded with the original version of FFmpeg
[compare screenshots 4 & 8].
Is it then an FFmpeg issue ? Is there any way to solve it ?
Any thoughts guys ?? ... ... thanks in advance. -
I'm afraid you (and me) are dealing with the FFmpeg limitations where it concerns the XviD encoder.
Although it uses the same source code of the separate XviD, it's a much stripped down version.
I copied the exact settings from your screenshots and did a number of tests. Even when I set bitrate to 1700 kbps, i'll get this result;
Code:17:27:51 - bitrate: min 928, max 1023, avg 1001 kbit/s 17:27:51 - Q-scale: min 2.0, max 2.0, avg 2.0 17:27:51 - FourCC set to Default, frame rate to Source fps.
You can see this FFmpeg behaviour more clearly when you do 2-pass mpeg2 encoding with a high bitrate. Then at the start of the second pass FFmpeg may display;
Code:[mpeg2video @ 0x15d5210] ... [lavc rc] Using all of requested bitrate is not necessary for this video with these parameters.
One simple question: To encode at constant bitrate using AVANTI, one has to
enter the same bitrate in all the fields - Bitrate (kbit/s), Min rate & Max rate.
Is it correct ?
Does the loaded template, "PAL_DIVX_2_PASS_HQ" have anything to do with the problem ?
What exactly does the template do ?
I'm afraid, simply setting a high enough bitrate and let FFmpeg decide is the only way you can use the XviD encoder.
2-pass can give improvement but with a constant q of 2.0, this will hardly have any effect. -
Hi, Chris K,
Thanks a lot for shining some much needed light on my queries.
Your comments were very helpful and are much appreciated.
Since it is an FFmpeg limitation, nothing can be done about it, I guess.
Pity, since AVANTI is an otherwise excellent and easy-to-use FREE A/V
converter, muxer, demuxer and so much more, especially with the well
laid-out GUI.
(happened to notice that you yourself are a GUI developer. Kudos on a
great job if you had anything (or everything) to do with the AVANTI GUI).
A simple tool that actually works very well (most of the time), much better
than other similar utilities that claim a bunch but deliver little.
Perhaps in future releases, shortcomings and limitations such as the one
realized here can be ironed out (although it is an FFmpeg issue).
It would have been perfect to be able to link the actual "Xvid" encoder
properties to AVANTI, since the codec is very popular and is available for
free. -
Originally Posted by The BlackDonadagohvi (Cherokee for "Until we meet again")
-
Just as I thought ... ...
Excellent job Chris K and many thanks for all your topic support.
Similar Threads
-
TEncoder 4.0.0 - Multithreaded GUI for FFMpeg and Mencoder (Support thread)
By ozok in forum Video ConversionReplies: 104Last Post: 4th Jun 2014, 10:10 -
GUI Encoders with Avisynth support?
By shagratt71 in forum Video ConversionReplies: 4Last Post: 13th Dec 2011, 05:27 -
AVANTI (FFMPEG) Question
By erichollis in forum Video ConversionReplies: 1Last Post: 18th Aug 2011, 15:54 -
Avanti - FFmpeg verison
By ABBrittain in forum Newbie / General discussionsReplies: 2Last Post: 22nd Jun 2011, 04:01 -
I need a supported build of ffmpeg for Avanti 0.4.8
By flashandpan007 in forum Video ConversionReplies: 1Last Post: 23rd Jun 2010, 09:28