Keep Audio, re-encode Video

Archive of historical feature requests.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
DarkReverser
Posts: 3
Joined: Thu Feb 10, 2011 7:16 pm

Keep Audio, re-encode Video

Post by DarkReverser »

Hello, in the case of DVDs there is denying the need to encode audio. However, in the case of re-encoding an avi, I think it would be quite useful and appreciated if you supported "keep original audio stream" particularly when it was encoded as mp3 since re-encoding will lose quality and use up necessary CPU. This is quite a simple feature to implement; both conceptually and programming--wise.

Similarly and while your at it, you might as well include an audio only output option since we love your audio codec and very few software can compare and we want to use your to program for that.

Another posts mentions, re-encoder audio only. This would useful for those rips that are AC3 encoded to save a bit of space, but frankly it is an unnecessary component to the software. The same cannot be said about the "keep original audio stream" option; that is a perfect marriage with your software. And the Audio-only output is a beautiful extension of your software. You have a great product, keep up the good work.

I have searched the forum for a similar post and have not found a match.
Deleted User 11865

Re: Keep Audio, re-encode Video

Post by Deleted User 11865 »

DarkReverser wrote:This is quite a simple feature to implement; both conceptually and programming--wise.
Then do it yourself, if it's so easy.
Last edited by Deleted User 11865 on Thu Feb 10, 2011 8:37 pm, edited 1 time in total.
mduell
Veteran User
Posts: 8207
Joined: Sat Apr 21, 2007 8:54 pm

Re: Keep Audio, re-encode Video

Post by mduell »

I eagerly await your patch.
DarkReverser
Posts: 3
Joined: Thu Feb 10, 2011 7:16 pm

Re: Keep Audio, re-encode Video

Post by DarkReverser »

I will not be providing a patch.
I will however tell you why it would be easy to program.

Step 1: Get handbrake API to use an existing program to separate the audio from the video aka demux.
Step 2: Handbrake now uses resulting video stream to encode with no audio.
Step 3: Once done encoding, handbrake API uses existing program to remux audio with the new video.

This method is as we say in french "broche a foin", but it would work and only requires a few lines of code specifically not many more than 3 Albeit with a bit of wit you could even get away with a similar method for the audio-only option; since technically and under normal conditions significant new code would have to be introduced since existing API is so tailored to video.

It would work something like this:
Trick handbrake into encoding a dummy video such that the video is demuxable yet because it is a dummy barely requires any CPU; haha.
Well, you would have to be pretty witty to accomplish that, and might be easier to just bite the bullet and just write the additional code needed.

In any case, I am not familiar with the source code and it would be more appropriate for someone who is familiar to introduce the changes.
Last edited by DarkReverser on Fri Feb 11, 2011 1:24 am, edited 1 time in total.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: Keep Audio, re-encode Video

Post by JohnAStebbins »

  1. If you are not interested enough to supply a patch, then why should we be.
  2. HandBrake does not and will not use external programs. There is no "handbrake API" that can call external demux and remux programs.
  3. The simplistic method of demuxing audio, encoding video, then remuxing audio would lead to A/V desync issues.
DarkReverser
Posts: 3
Joined: Thu Feb 10, 2011 7:16 pm

Re: Keep Audio, re-encode Video

Post by DarkReverser »

Funny, last time I checked demuxing and remuxing utilities were quite efficient at avoiding A/V sync issues, but I guess that just me.
The code for calling external programs already exists; it's merely a copy/paste and a few tweaks.
Anyways, do not want to argue further.

It's all good.
thompson
Bright Spark User
Posts: 356
Joined: Sat Dec 12, 2009 8:04 pm

Re: Keep Audio, re-encode Video

Post by thompson »

DarkReverser wrote:The code for calling external programs already exists; it's merely a copy/paste and a few tweaks.
What in the world are you talking about.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: Keep Audio, re-encode Video

Post by JohnAStebbins »

DarkReverser wrote:Funny, last time I checked demuxing and remuxing utilities were quite efficient at avoiding A/V sync issues, but I guess that just me.
You don't spend enough time doing tech support for these kinds of problems. Yes, it's a small percentage of streams that can't be demuxed and successfully remuxed. But 1% of 8 million users is 80000 support headaches. There are concrete technical reasons AV desync can happen when doing this a demux/remux operation like you suggest. It's not only caused by broken streams. Valid transport streams can have timestamp discontinuities due to edits and splices. They can have gaps between one audio/video frame and the next. You need the complete stream in order to resolve these things. When you demux the streams and separate them, you loose the information needed to keep sync.
The code for calling external programs already exists; it's merely a copy/paste and a few tweaks.
Really? I know the handbrake code as well as anyone. I have no idea what you are talking about.
Post Reply