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

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th August 2009, 12:25   #1  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
AVCHD and opensource tools

Hi,

recently I tried to convert a AVCHD video from Panasonic camcorder. I tried many different tools but most of them fail in transcoding the video in different ways.

Avidemux opens the video, but seeking doesn't work. If you convert the video, it duplicates frames and the final output is slowed down twice (I didn't use any deinterlace filters).

The same happens with FFmpegSource AviSynth filter.

DgAVCDec causes some blocking artifacts.

CLI ffmpeg transcoder produces 2x faster video then original.

Do you know any simple and working process to convert AVCHD video to SD AVI/MPEG-4?

It seems that FFmpeg can't handle the 50i H.264 correctly for some reason. And since most opensource tools are based on FFmpeg, they have the same bug.

Last edited by Guest; 25th August 2009 at 03:53. Reason: fix title typo
vlada is offline   Reply With Quote
Old 19th August 2009, 16:36   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,520
I suggest you report it on the FFmpeg bug tracker then. If you do, all your favorite tools will begin to work. I don't know of any other good options.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 19th August 2009, 16:51   #3  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,025
Did you try DirectShowSource() + Divx h.264 decoder or ffdshow in avisynth ? (or coreavc pro, but not opensource) . It works for both interlaced PAL & NTSC AVCHD from other cameras

Maybe something peculiar about your camera? What model?
poisondeathray is offline   Reply With Quote
Old 19th August 2009, 16:52   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Quote:
Originally Posted by Myrsloik View Post
I don't know of any other good options.
DGAVCDecNV.
Guest is offline   Reply With Quote
Old 19th August 2009, 17:56   #5  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
Quote:
Originally Posted by vlada View Post
It seems that FFmpeg can't handle the 50i H.264 correctly for some reason.
Generally it can, but perhaps your stream is somehow special. A sample clip would be nice, and report to FFmpeg if you'd like to get things fixed.
nm is offline   Reply With Quote
Old 20th August 2009, 08:03   #6  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
neuron2> Thanks for your suggestion and for your tools, but unfortunately I don't have a nVidia graphics.

poisondeathray> DirectShowSource (with Haali's splitter). This solution seems to work. Unfortunately I don't know the exact model which was used to take the video.

nm> I'm not 100% sure if the problem is directly in FFmpeg. But the problems can be seen in many FFmpeg based programs. I will provide a sample later when I get home.
vlada is offline   Reply With Quote
Old 25th August 2009, 03:07   #7  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Are you sure it's 50i?!? Panasonic cameras can play "tricks" in AVCHD by duplicating frames ...

I get the exact same problem with AVCHDlite's fake 50p

The only way I get a duplicate of the exact stream is to use DSS2 (DirectShowSource2 from a Haali Splitter install directory, it reports the 50 fps right, and it also shows the duplicate frames) ...

FFMpegSource2 only shows 25fps, DGTools (DGAVCIndex, DGAVCIndexNV, DGTools) reports 50fps but only shows the moving frames (not the duplicate statics, no matter what it's indexed with, no matter if the "honor pulldown" flag is set or not!), DirectShowSource isn't frame accurate (so any non linear functions tend to produce jumpy frames) ...

Example clips that stuff all these filters up (MTS file with AVC video and AC3 audio, straight from a Panasonic AVCHDlite device):
00000.MTS, 00001.MTS, 00002.MTS

For now, I am using DSS2() if I need a duplicate of the stream transcoded or processed, but even DSS2 is reporting too many frames in the stream (so it can crash at the end of an encode unless I also use Trim(0,reported frames - 4), if I am manipulating the stream I will use FFmpegSource2 + AssumeFPS(25) + MSU_FRC(2) ...

They are funny streams, no doubt, because if you play the streams you will notice frame 0, and frame 1 are actually different images, then frame 2 is a duplicate of frame 1, then frame 3 is different again with that pattern repeated throughout ...

7ek

Last edited by 7ekno; 25th August 2009 at 03:15.
7ekno is offline   Reply With Quote
Old 25th August 2009, 03:52   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Do you know what syntax element is used to signal these duplicates?
Guest is offline   Reply With Quote
Old 25th August 2009, 07:26   #9  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Quote:
Originally Posted by neuron2 View Post
Do you know what syntax element is used to signal these duplicates?
Nah, I can't work it out ... I can't even tell if the duplicates frames are actually encoded, signaled or referenced ...

7ek
7ekno is offline   Reply With Quote
Old 26th August 2009, 15:10   #10  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
7ekno> I'm pretty sure my video is 50i. It was taken by a camcorder (not a camera) and all Panasonic camcorders record to 50i only AFAIK. I'm sorry I haven't provided the sample yet, but I hope to do it tonight.
vlada is offline   Reply With Quote
Old 27th August 2009, 11:33   #11  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
Hi,

a sample is at http://www.sendspace.com/file/ypcop0. I cut and remuxed it to TS container. But the results are the same as with the original MTS file.
vlada is offline   Reply With Quote
Old 29th August 2009, 08:54   #12  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Quote:
Originally Posted by vlada View Post
Hi,

a sample is at http://www.sendspace.com/file/ypcop0. I cut and remuxed it to TS container. But the results are the same as with the original MTS file.
MeGUI handled it right with the standard DGAVC tools using the "NVidia De-interlacer" in the DGx Source tab (in the MeGUI "tools" menu you will have to index it to DGA first, then use the MeGUI Avisynth script creator with appropriate de-interlace filters) ... the source is 1440x1080 @ 50i, so your choice of de-interlacer and resizer (although I would do the resizing via DAR signaling in the stream) will be important

7ek

Last edited by 7ekno; 29th August 2009 at 08:57.
7ekno is offline   Reply With Quote
Old 30th August 2009, 19:09   #13  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
7ekno> Did you use HW or SW decoder (DGAVCDec vs. DGAVCDecNV)?
vlada is offline   Reply With Quote
Old 30th August 2009, 21:00   #14  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Has to be the NV version to use PureVideo (NVidia De-interlacer).
Guest is offline   Reply With Quote
Old 7th September 2009, 13:32   #15  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Quote:
Originally Posted by vlada View Post
7ekno> Did you use HW or SW decoder (DGAVCDec vs. DGAVCDecNV)?
NV, It's completely worth it for PureVideo's de-interlacing quality and speed

7ek
7ekno is offline   Reply With Quote
Old 9th September 2009, 14:02   #16  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
I did some more tests with my AVCHD samples. The results are really strange.

DirectShowSource with Haali's splitter and ffdshow decodes the video OK.

I tried to convert the video to AVI/MPEG-4 ASP using ffmpeg CLI SVN-r19159. The final video had doubled frames. Each frame is interlaced a followed by it's duplicate.

The latest version of FFMS2 has the same output as I mentioned earlier. It has doubled frames, but all of them are unique. I can see combing artifacts on the frames, which is strange. Also the frames are not exactly doubled, frame 400 of source video is not the same as frame 800 from FFMS2. I can elaborate this further if it helps anything.

DGAVCDec reports the correct count of frames, but there is a lot of blocking artifacts and I have a feeling the frame order is sometimes incorrect too.

Myrsloik> Could you please have a look at my AVCHD sample if there is anything you can do to support it? Since it works correctly in DirectShow, Haali's splitter and libavcodec should be able to decode the video.

neuron2> Could you please try to update libavcodec.dll? The version in latest DGAVCDec is quite old. Since other FFmpeg based tools don't have the blocking artifacts, I hope an updated libavcodec might fix it.
vlada is offline   Reply With Quote
Old 9th September 2009, 14:10   #17  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Quote:
Originally Posted by vlada View Post
neuron2> Could you please try to update libavcodec.dll? The version in latest DGAVCDec is quite old. Since other FFmpeg based tools don't have the blocking artifacts, I hope an updated libavcodec might fix it.
No. It's been discussed many times. Use search.

You can use DGAVCDecNV. It decodes these streams with no problems. That has also been discussed.
Guest is offline   Reply With Quote
Old 9th September 2009, 14:32   #18  |  Link
vlada
Registered User
 
Join Date: Apr 2003
Location: Czech Republic
Posts: 752
Quote:
Originally Posted by neuron2 View Post
No. It's been discussed many times. Use search.
Quote:
Originally Posted by neuron2
It's not possible because I check that it is the DLL that I supply. I cannot use the newer versions because they are broken for accurate frame random access.
Is this the reason? Is it still broken in libavcodec (FFmpeg)? Is there any chance of fixing it or should I simply forget about DGAVCDec for my purpose.

Quote:
Originally Posted by neuron2 View Post
You can use DGAVCDecNV. It decodes these streams with no problems. That has also been discussed.
Yes I know, but I don't own a nVidia graphics, furthermore I search for a solution that would work for all people.
vlada is offline   Reply With Quote
Old 9th September 2009, 14:45   #19  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
Quote:
Originally Posted by vlada View Post
Is this the reason? Is it still broken in libavcodec (FFmpeg)? Is there any chance of fixing it or should I simply forget about DGAVCDec for my purpose.
Yes, it is the reason. Yes, it is still broken. The only chance for fixing it is if the libavcodec developers decide that the bug is worth fixing. Since there is no indication that they care about it I consider DGAVCDec to be dead-ended at this time.

Quote:
Yes I know, but I don't own a nVidia graphics, furthermore I search for a solution that would work for all people.
Keep searching then.

You can get a usable Nvidia card for less than $50.
Guest is offline   Reply With Quote
Old 9th September 2009, 15:56   #20  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,025
Quote:
Originally Posted by vlada View Post
I search for a solution that would work for all people.
DirectShowSource() or DSS2() + Haali + FFDShow works fine when fed to vdub to encode xvid for example
poisondeathray is offline   Reply With Quote
Reply

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 22:58.


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