View Full Version : x264 in AVI container: Would this be considered a "hack"?
TlatoSMD
16th April 2012, 14:25
@echo off
setlocal
@echo Please enter aspect ratio (16:9 or 4:3)
@set /P aspect=
REM *** process the command line until it's empty:
:loop
set InputFile=%~1
set InputFileFolder=%~dp1
set InputFileName=%~n1
set InputFileExtension=%~x1
set OutputFile=%InputFileFolder%%InputFileName%%OutputFileExtension%
C:\Programme\MPlayer\ffmpeg.exe -i "%InputFile%" -acodec libmp3lame -ab 192k -vcodec libx264 -crf 22 -threads 0 -aspect %aspect% "%OutputFile%-%br%.avi"
shift
if not "%~1"=="" goto loop
echo Done.
pause
Never had any issues with this script. No frame loss, no stuttering on playback, no loss of lip-sync, no artifacts. It even gives me anamorphic support in AVI.
My reasons for this are simple: Just like back in 2005, most of my editing/authoring tools and players still either can't read outlandish formats such as MKV, mp4, or RM altogether, or only with various issues just like those that people here keep accusing x264 in an AVI container of. Using Windows7, I don't need no fancy VBR, and softsubbing AVIs has been taken care of in VLC. If I ever need several audio tracks, I'll only introduce them as late as in my authoring tool, which will output VOBs or ISOs.
LoRd_MuldeR
16th April 2012, 14:30
There have been endless discussions about that topic:
:search:
TlatoSMD
16th April 2012, 14:35
There have been endless discussions about that topic:
:search:
All I found where endless bashing threads where people said it was either impossible, required complicated "hacks", or would have very, very nasty results.
So I'm wondering if I can somehow prove people wrong with this. Especially because so many people are trying and asking for it for years now. If you want AVI to go away, you should work on fixing support for containers such as MKV, mp4, and RM first. I don't know about Apple, but none of my Adobe tools are supporting anything besides MPEG and AVI.
LoRd_MuldeR
16th April 2012, 14:40
First of all: There are limitations of the AVI format itself. And there are limitations of the VFW interface. This often is not clearly separated in discussions, but using an AVI container does not imply using VFW.
Furthermore the choice of the container should not be overrated. You can, at any time, demux the "raw" H.264 stream from an AVI container and re-mux it into MKV or MP4 or... as needed ;)
Last but not least, it is kind of pointless to prove anybody "wrong" here. Everybody can have his or her own opinion on what the "proper" container for H.264 is. Use what works best for you and that's it...
TlatoSMD
16th April 2012, 14:44
First of all:
There are limitations of the AVI format itself.
Of which I've named a number that are irrelevant to me.
Furthermore the choice of the container should not be overrated. You can, at any time, demux the "raw" H.264 stream from an AVI container and re-mux it into MKV or MP4 or... as needed ;)
And create yet more temporary files? Or have all those new container formats my tools can't read?
Last but not least, it is kind of pointless to prove anybody "wrong" here. Use what works best for you and that's it...
I thought it could also be used as a solution for everybody looking for a quick and easy way to do this for years and years now.
LoRd_MuldeR
16th April 2012, 14:52
Of which I've named a number that are irrelevant to me.
Well, if you are aware of the limitations and have come to the conclusion that they are irrelevant for you, why still worry about it?
As long as everything works fine for what you are doing, you don't have to care whether somebody calls that a "hack" or whatever ^^
And create yet more temporary files? Or have all those new container formats my tools can't read?
Who said you should create more temporary files?
I said that you can remux from one container format to another one quite easily (and without loss of quality), if that ever shall become necceasarry.
If, years back, you stored a video in container format A and nowadays you need to use a tool that only accepts container format B, you don't have to throw away your existing video.
Instead, you can simply re-mux from container format A to B, or vice versa. So the decision of the container format generally is not a "final" decision. It's a "reversible" decision.
I thought it could also be used as a solution for everybody looking for a quick and easy way to do this for years and years now.
There is NOT the one solution that works for everybody and for everything!
You maybe have heard about this: "The good thing about standards is that there are so many to choose from" ;)
Trying to convince people that your solution is the "best" one for everything is kind of pointless...
TlatoSMD
16th April 2012, 15:13
Well, if you are aware of the limitations and have come to the conclusion that they are irrelevant for you, why still worry about it?
Because that's what still seems to be the initial reaction in order to tell me why it "shouldn't be done".
Who said you should create more temporary files?
I said that you can remux from one container format to another one quite easily (and without loss of quality), if that ever shall become necceasarry.
If, years back, you stored a video in container format A and nowadays you need to use a tool that only accepts container format B, you don't have to throw away your existing video.
Instead, you can simply re-mux from container format A to B, or vice versa. So the decision of the container format generally is not a "final" decision. It's a "reversible" decision.
The thing is, I still have no use for any containers beside MPEG and AVI. And because people keep asking about this, I don't seem to be the only one.
There is NOT the one solution that works for everybody and for everything!
You maybe have heard about this: "The good thing about standards is that there are so many to choose from" ;)
Trying to convince people that your solution is the "best" one for everything is kind of pointless...
Who said "best"? All that I ever see is people being told "not to do it" instead of being given a viable solution that doesn't involve new, often incompatible and unuseable container formats that are still in development. I start harboring the suspicion that the only reason why so many "experts" keep bashing AVI is because they're not using Windows.
I feel like being told to leave Beta behind just because people are supporting Video2000 without realizing how little technical support is out there catering to their preference.
LoRd_MuldeR
16th April 2012, 15:43
Because that's what still seems to be the initial reaction in order to tell me why it "shouldn't be done".
And that's a problem for what you are doing with your own files, because...?
The thing is, I still have no use for any containers beside MPEG and AVI. And because people keep asking about this, I don't seem to be the only one.
Then, having the option to re-mux from AVI to another container (or vice versa), if your requirements ever shall change, still should be a good thing, even if you don't need it right now. Right?
Who said "best"? All that I ever see is people being told "not to do it" instead of being given a viable solution that doesn't involve new, often incompatible and unuseable container formats that are still in development.
I feel like being told to leave Beta behind just because people are supporting Video2000 without realizing how little technical support is out there catering to their preference.
While AVI was the "de facto" standard for MPEG-4 ASP for both, software and hardware players, this certainly doesn't apply any longer in the H.264 era.
As a matter of fact, H.264 streams are mostly stored in MP4/MOV or MKV containers nowadays. And, not very surprising, that's also what most hardware players support/expect.
"H.264 in AVI" may be fine for most software players, but most hardware players won't play such files (your mileage may vary). That alone is a strong reason for many people to not go with AVI.
Also there are some limitations in AVI (no support for VFR, not suitable for streaming, VBR audio is at least "problematic", etc.) that don't exist in more "modern" container formats.
After all there are not many reasons to recommend AVI as the first choice nowadays, but there are various reasons to prefer MKV or MP4.
Now you can still argue that the limitations of AVI are irrelevant for what you are doing. And that the advantages of MKV or MP4 don't matter for what you are doing.
But that's obviously not a very good argument to recommend AVI over MKV or MP4 for the Average Joe user ;)
Atak_Snajpera
16th April 2012, 16:03
There is only one occasion when I store AVC in AVI. AVC-INTRA 10bit which can be decoded with ffdshow in sony vegas. AVC 10bit in MP4 is not supported by native decoder in vegas.
TlatoSMD
16th April 2012, 16:08
LoRd_MuldeR, you keep acting as if I was telling everybody to be using AVI. What I'm talking about is those areas where MKV and mp4 still ain't compatible. And I'm not talking about hardware players, I'm talking about editing and authoring programs. Just saying, "Oh, who knows, maybe 20 years from now, MKV could be compatible..." just ain't cutting it for those cases.
Atak_Snajpera
16th April 2012, 16:12
@TlatoSMD
just use whatever container suits you. Problem solved. for regular backups I still prefer more versatile mkv (embended subs, chapters, no hack needed for VBR audio,...)
LoRd_MuldeR
16th April 2012, 16:28
No. I just made clear why, for the average user, it is generally recommended to store H.264 streams in MKV or MP4 and not in AVI.
There still may be specific scenarios where you will need to use AVI to reach your goal. And there certainly are many scenarios where AVI works just as good as MKV or MP4.
It is perfectly legitimate to use AVI in these scenarios, as long as it works fine for what you are doing.
What more do you want to hear? What other people tell you to do is only a recommendation and should be taken as such. It's still you who decides what to do. Use what works best for you and be happy...
(This whole thread seems like you want to get some kind of "absolution" for storing H.264 in AVI, because somebody told you that doing so was a mortal sin ^^)
Midzuki
16th April 2012, 16:38
...
I start harboring the suspicion that the only reason why so many "experts" keep bashing AVI is because they're not using Windows.
...
FWIW, Micro$$$oft themselves have been "bashing" the AVI container since they invented the glorified-AVI :D , a.k.a. Active Streaming Format ;)
Regarding "hacks", these are (afaik) the only ones which deserve that label:
--- packed bitstream (ASP w/ B-frames)
--- chapter lists
--- subtitle pictures (not that I've ever met an AVI containing SUP streams, bien entendu)
C ya.
TlatoSMD
16th April 2012, 16:41
FWIW, Micro$$$oft themselves have been "bashing" the AVI container since they invented the glorified-AVI :D , a.k.a. Active Streaming Format ;)
All the ASFs I've ever heard of were empty and upon opening the fake file opened a browser window to a hidden dialer or paysite.
Midzuki
16th April 2012, 16:51
^
Come on, not all ASFs/WMVs are p0rn traps :)
LoRd_MuldeR
16th April 2012, 16:51
--- packed bitstream (ASP w/ B-frames)
That one was invented to workaround a limitation in VFW (Video for Windows), it's not specific to the AVI container format.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.