Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 18th July 2008, 01:45   #1161  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
Quote:
Originally Posted by neuron2 View Post
Does it support accurate random access?
I don't know for sure, but the best seek method (seekmode=0) is alot more accurate than DirectShow.

Unfortunately, the method that is done is much slower than DGAVCDec. It's also full of other codecs and stuff that have nothing to do with H264.

I would prefer MP4 support from DGAVCDec over FFMPEGsource.

EDIT

Here are the seekmodes as described in the FFMPEGSource manual
Code:
seekmode: Force how seeking is handled, has no effect on matroska files which always use the equivalent of seekmode=1
-1: linear access without rewind, will throw an error if each successive requested frame number isn't bigger than the last one, only intended for opening images but might work on well with some obscure video format
0: linear access, the definition of slow but should make some formats "usable"
1: safe normal, bases seeking decisions on the reported keyframe positions
2: unsafe normal, same as 1 but no error will be thrown if the exact destination has to be guessed
3: aggressive, seek in the forward direction even if no closer keyframe is known to exist, only useful for testing and containers where avformat doesn't report keyframes properly
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 18th July 2008 at 02:01.
Revgen is offline  
Old 20th July 2008, 09:11   #1162  |  Link
lchiu7
Registered User
 
Join Date: Apr 2002
Posts: 279
Quote:
Originally Posted by neuron2 View Post
That audio is AAC LATM/LOAS. I don't support that yet, and I can't predict when I may get to it.
Any idea how hard it would be to at least be able to output that audio stream as wav? This audio format is now being used by some DVB-T broadcasters and it would be great to be able to convert the audio to something that is more generally playable. Would this help?

http://blog.monogram.sk/janos/2008/0...-decoder-0930/

Thanks

Update: When priorities permit just being able to output AAC-HE LATM/LOAS in its native stream would be good. We can find tools to process it after it comes out. Thanks

Last edited by lchiu7; 22nd July 2008 at 11:36.
lchiu7 is offline  
Old 20th July 2008, 09:22   #1163  |  Link
lchiu7
Registered User
 
Join Date: Apr 2002
Posts: 279
Quote:
Originally Posted by Schmendrick View Post
@Mboufleur: You can demux all the streams with TSRemux. The "MPEGaudio"-files you have to rename *.aac. Winamp is able to play these files and also to convert them to Wav-files. Thus you could e.g. reencode them either to real MPEG-audio or to AC3 and then remux these audiofiles back with TSMuxer.

In the meantime I have downloaded one full sample video. Using TSRemux I demuxed the video- and the audio-stream as avc- and aac-file resepctively. The aac-file I converted into a stereo-wav-file using Winamp with its file-output-plugin. Then I encoded this wav-file with Belight using the AC3enc-encoder into a stereo AC3-256kbit-file. Opening the original "mpg"-ts-file with a hex editor I searched for the first PTS-value of the video stream which can be found if you search for the first occurence of the video flag string "00 00 01 E0" and then the five bytes of the PTS value which is located with a 5 bytes offset after the video flag. In the first sample it is "31 00 CD 33 9D". Then you have to search for the first PTS-value of the audio stream which can be found if you search for the first occurence of the MPEG-audio flag string "00 00 01 C0" and then the five byted of the PTS value which is located with a 5 bytes offset after the MPEG-audio flag. Here it is "21 00 C7 F1 91". As these values are different you have to calculate the time offset so how many seconds the audio is playing too early in this case as the audio-PTS is smaler than the video-PTS, as the least significant bit of the first byte of the PTS values can be ignored so that the "31"-value is equal to the "21"-value of the different PTS-values. As the calculation of the PTS values which is documented in the MPEG ISO standards is quite complicated I have written a simple VideoPTS-Calculator programme:
http://www.alice-dsl.net/schmendrick/VideoPTSCalc.exe
which uses .NET-2.0. You can enter the video PTS-value as the ASCII-string of the hex values of the first five bytes "21 00 CD 33 9D" in the left input box, then guess the time offset value (shift(sec)) in seconds e.g. "-0.82211" which is -822.11 milliseconds, then click on "compute" and obtain the audio PTS value in the right box "new VideoPTS". If you experiment a little with the "shift(sec)"-value you are able to find the exact offset value.

Then using TSMuxer you can remux the avc-video file with your new AC3-audio file using the time offset value in this case -822 milliseconds to obtain a perfectly synchronous ts-file which can be properly displayed e.g. using PowerDVDUltra.

I hope this method works for you. You can contact me if you have problems.

Schmendrick
Hi I got quite excited when I read this post since it seemed to be a way to convert the DVB-T broadcasts in NZ which use H.264 video and AAC-HE LATM audio to something more accessible. I used tsmuxer to separate the streams but I cannot even play the AAC files in winamp, let alone output them as wav files. This is winamp 5.54

Winamp reports the right length in time but as soon as I press play it stops.

Are you able to try your process on files on this page and report your experiences?

http://www.geekzone.co.nz/Fossie/4877

Thanks
lchiu7 is offline  
Old 20th July 2008, 11:26   #1164  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
I used Alpha 26 with success on many DVB S2-TS streams.

Since Alpha 28 I have always a audio delay after muxing the new encoded video. If I save a project, the audio delay on the demuxed ac3/mp2-file is the same with both versions (listed in the file name, for example "DELAY -1152"), but only the demuxed audio file from Alpha 26 is in synch with the new encoded video.
amango is offline  
Old 20th July 2008, 19:20   #1165  |  Link
canTsTop
Registered User
 
canTsTop's Avatar
 
Join Date: Apr 2007
Location: Lithuania
Posts: 120
Quote:
Originally Posted by neuron2 View Post
My immediate plans are:

1. Cutting (multiple ranges, not just one).

2. Address libavcodec deficiencies.

3. MP4 support.

What would you like to see?
is this cutting will be frame accurate (like Trim command in Avisyth)? is it include audio cutting to? it would be incredible!

Address libavcodec deficiencies would be most important for me.

Also Audio delay support in avs template

One more future i would like to see: is possibility to specify location of libavcodec.dll in dga file for portability reasons. i like to keep my all avisynth plugins and other tools in tools directory:
Code:
loadplugin("tools\DGAVCDecode.dll")
loadplugin("tools\NicAudio.dll")
or mybe DGAVCDecode.dll should also look for libavcodec.dll in same directory from where DGAVCDecode.dll was loaded.

thank you
canTsTop is offline  
Old 20th July 2008, 19:34   #1166  |  Link
SeeMoreDigital
Registered User
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,833
Quote:
Originally Posted by Revgen View Post
I would prefer MP4 support from DGAVCDec over FFMPEGsource.
Me too...

Especially as MPEG-4 AVC video and the .MP4 container derive from the ISO/IEC 14496 specification.
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is online now  
Old 20th July 2008, 21:42   #1167  |  Link
audyovydeo
Registered User
 
audyovydeo's Avatar
 
Join Date: Apr 2007
Posts: 464
Quote:
Originally Posted by Revgen & SeekMoreDigital
I would prefer MP4 support from DGAVCDec over FFMPEGsource.
Adding one more vote to this motion.

cheers
a/v
audyovydeo is offline  
Old 20th July 2008, 23:45   #1168  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by amango View Post
I used Alpha 26 with success on many DVB S2-TS streams.

Since Alpha 28 I have always a audio delay after muxing the new encoded video. If I save a project, the audio delay on the demuxed ac3/mp2-file is the same with both versions (listed in the file name, for example "DELAY -1152"), but only the demuxed audio file from Alpha 26 is in synch with the new encoded video.
Please post a link to a source stream fragment that I can use to duplicate the issue.
Guest is offline  
Old 21st July 2008, 15:08   #1169  |  Link
Schmendrick
Registered User
 
Join Date: Oct 2003
Location: Germany
Posts: 91
Quote:
Originally Posted by lchiu7 View Post
Hi I got quite excited when I read this post since it seemed to be a way to convert the DVB-T broadcasts in NZ which use H.264 video and AAC-HE LATM audio to something more accessible. I used tsmuxer to separate the streams but I cannot even play the AAC files in winamp, let alone output them as wav files. This is winamp 5.54

Winamp reports the right length in time but as soon as I press play it stops.

Are you able to try your process on files on this page and report your experiences?

http://www.geekzone.co.nz/Fossie/4877

Thanks

@Ichiu7:
I am using Tsremux to demux the aac-stream which is indicated as "MPEG audio stream" by Tsremux even though it is an AAC-HE-stream. Using Winamp version 5.5 I am able to decode all but one of the indicated HD-sample streams.
The sample-clip called "Freeview HD sample" is corrupt an cannot be remuxed or played by any programme I have tried.
Looking at the hex code of this ts-file also no recognizable stream flags can be found.

May be you just attempted to open this file.
Nevertheless the only programme which is able to play
these AAC-files is Winamp.

Schmendrick
Schmendrick is offline  
Old 21st July 2008, 16:36   #1170  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Guys, please stay on topic. Use of TSREMUX belongs elsewhere. Thank you.
Guest is offline  
Old 21st July 2008, 22:30   #1171  |  Link
lchiu7
Registered User
 
Join Date: Apr 2002
Posts: 279
Quote:
Originally Posted by Schmendrick View Post
@Ichiu7:
I am using Tsremux to demux the aac-stream which is indicated as "MPEG audio stream" by Tsremux even though it is an AAC-HE-stream. Using Winamp version 5.5 I am able to decode all but one of the indicated HD-sample streams.
The sample-clip called "Freeview HD sample" is corrupt an cannot be remuxed or played by any programme I have tried.
Looking at the hex code of this ts-file also no recognizable stream flags can be found.

May be you just attempted to open this file.
Nevertheless the only programme which is able to play
these AAC-files is Winamp.

Schmendrick
Getting back OT. I was able to use dgavcindex (not sure which version - possibly Alpha 26) to extract the audio from a DVB-T stream captured recently, so production broadcast. The output file created has a suffix of mpa. One filename also had delay -335ms in it so I assumed that dgavcindex thought that this was delay in the audio.

But after renaming the file to aac suffix, playing it in winamp to get a wav file and converting it to AC-3 when muxed back with the video dgavcindex created in the first step, there was a 1s delay in the audio. When I inserted 1s as the delay in the mux back step the resultant file played fine.

Need to do further testing to see if this is a consistent delay or variable based on the file. It certainly wasn't related to the delay as noted in the filename.

Happy to provide or link to samples for testing
lchiu7 is offline  
Old 22nd July 2008, 04:43   #1172  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
I'm voting for addressing issues with libavcodec. Lots of AVCHD owners out there unable to send their newborn's first burp video to the in-laws because of the more recent file formats. (Not completely the case - they can use DirectShowSource instead)

Last edited by Pookie; 22nd July 2008 at 04:47.
Pookie is offline  
Old 22nd July 2008, 10:25   #1173  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
Quote:
Originally Posted by neuron2 View Post
Please post a link to a source stream fragment that I can use to duplicate the issue.
http://rapidshare.de/files/40050488/Sample.ts.html

There are 3 audio streams - use "40". I demuxed it with Alpha 26 and Alpha 28 and made an Xvid video out of both.

The video from Alpha 26 is in synch.
The video from Alpha 28 is out of synch (+400 ms ?).

I know this is a bad sample (a dancing scene) - but watch at 00:43 between a scene change. The last word of the woman ends before the scene changes (encoded Alpha 26-video). In the Alpha 28-video the last word can be heard over the next scene.

Both versions are reporting the same delay but only Alpha 26 is in synch.

Last edited by amango; 22nd July 2008 at 10:30.
amango is offline  
Old 22nd July 2008, 13:37   #1174  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by amango View Post
Both versions are reporting the same delay but only Alpha 26 is in synch.
Are you sure about that?

I tried both versions on audio ID 40. They both served 3220 frames starting with the same frame via the Avisynth script, and the demuxed audio files were bit-for-bit identical. Are you sure you used the same script and encoding for both cases? If so, give me your script. I'm thinking you must have forgot to adjust for the audio delay when using alpha 28.
Guest is offline  
Old 22nd July 2008, 14:56   #1175  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
This is my script:

Code:
avcsource("%source_file%",deblock=true)
LanczosResize(720,576)
Assumetff().SeparateFields().SelectEvery(4, 0, 3).Weave()
tdeint()
degrainmedian()
undot()
Limiter()
I encode the audio with Besweet (128 KB VBR) and mux audio and video together with VirtualDubMod.

Every video I tried gives me a delay with Alpha 28, but not with Alpha 26. Don't know why.
amango is offline  
Old 22nd July 2008, 15:00   #1176  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Where are you adjusting for the audio delay?

Do what I did: Make the project with both versions. Then serve the AVS script into VirtualDub and check that the starting frame and number of frames is the same for both. Then compare the audio files to see if they are identical. You'll see that the video and audio are identical coming out of both versions. Therefore, it must be something in your subsequent process that is going wrong.
Guest is offline  
Old 22nd July 2008, 15:07   #1177  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Regarding your script:

The sample is progressive with every frame duplicated. So you can just do:

SelectEven()

I don't understand the point of your script. You're resizing before deinterlacing and the Assumetff().SeparateFields().SelectEvery(4, 0, 3).Weave() line makes no sense to me for this sample. That's generally used when reinterlacing after bobbing.
Guest is offline  
Old 22nd July 2008, 15:12   #1178  |  Link
amango
Registered User
 
Join Date: Oct 2002
Posts: 92
I just copied this script from one user from videohelp.com who wanted to convert 720p50 to SD.

I really don't know why. I am using "DVX" (from Stax) for years now.

Usually I do this all the time to encode videos:
I start DGIndex or DGAVCDec - Save a project. Then I drop the index file from your programs to DVX. DVX recognites the delay from the audio file name. I cut the video and start the encoding process. DVX uses Besweet and starts VirtualDubMod to mux the video.

Soon after I updated to Alpha 28, I got this delays in my files. Reverting back to Alpha 26, they were all in synch again.

I will try it again manually as you said.

Last edited by amango; 22nd July 2008 at 15:16.
amango is offline  
Old 22nd July 2008, 15:30   #1179  |  Link
G_M_C
Registered User
 
Join Date: Feb 2006
Posts: 1,076
Quote:
Originally Posted by amango View Post
I just copied this script from one user from videohelp.com who wanted to convert 720p50 to SD.

I really don't know why. I am using "DVX" (from Stax) for years now.

Usually I do this all the time to encode videos:
I start DGIndex or DGAVCDec - Save a project. Then I drop the index file from your programs to DVX. DVX recognites the delay from the audio file name. I cut the video and start the encoding process. DVX uses Besweet and starts VirtualDubMod to mux the video.

Soon after I updated to Alpha 28, I got this delays in my files. Reverting back to Alpha 26, they were all in synch again.

I will try it again manually as you said.
The strange thing with your script is that you interlace first, and than try to de-interlace again. That makes no sence.

720p50, are you shure it is 720p50 ? If so, try to load the clip plainly (only with the AVCSource-line) into VDub. Slowly walk through a reasonable portion of the clip, and find out it there a frame-duplicates (and)or frame-blends.

If the original (unblended/unduplicated) frames occur on the even frames use "SelectEven()" use SelectOdd() when those frames occur on the odd-ones. Then put the line "AssumeFPS (25,1,True)" and see if the whole clip still syncs with your audio.
G_M_C is offline  
Old 24th July 2008, 03:23   #1180  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Version 1.0.0 alpha 29

1. Implemented project range selection, i.e., the [ and ] buttons are now functional.

2. Revised popup error/warning handling so that individual error types can be selectively suppressed.

http://neuron2.net/dgavcdec/dgavcdec.html

Currently, only a single range is supported, as in DGIndex. I want to get feedback on that before attempting to support multiple ranges, which is very difficult.

Note there are bugs in the Windows trackbar for themed desktops. To work around it, I enabled the ticks bar as well. Either the ticks bar or the main trackbar will show your selection range, depending on your OS and desktop settings. I haven't yet found a clean solution, short of implementing my own trackbar (as Avery does in VirtualDub; I'm not that masochistic ).

Last edited by Guest; 24th July 2008 at 03:32.
Guest is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:06.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.