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-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th July 2008, 04:36   #1  |  Link
Mr. Vage
Registered User
 
Join Date: Apr 2008
Posts: 1
AVCHD to MPEG2

I've spent months trying to solve what I thought would be a simple problem. I have a Sony HDR-SR1 which records to AVCHD as an MPEG2 Transport Stream. I want to convert these files to play on my Roku HD1000 Photobridges. The HD1000 can only play MPEG2 files, so that is my only option to encode the files as.

What I've come up with so far is as follows:
  • Use xport to demux the m2ts into an avc file and an ac3 file
  • Use DGAVCIndex on the avc file to create a dga file (I have no idea what this step is for, but it seems to be necessary)
  • Create an avisynth file to put the video and audio back together as well as deinterlace the video and give it the proper widescreen resolution (see below for avisynth script)
  • Use ffmpeg to create mpeg2 video file (this is the part that's giving me trouble)

Avisyth script:
Code:
loadplugin("dgavcdecode.dll") 
load_stdcall_plugin("yadif.dll") 
video=AVCSource("myvid.dga") 
audio=DirectShowSource("myvid.ac3")
AudioDub(video, audio)
yadif() 
Lanczos4Resize(1920, 1080)
What options do I need to set for ffmpeg to output an mpeg2 video correctly?

If i use:
Code:
ffmpeg -i myvid.avs -target ntsc-dvd -s hd1080 myvid-dvd.mpg
, I get a working mpeg2 video at 1920x1080 with ac3 audio. The problem with that setting is the low bitrate of the dvd option causes the video to look terrible.

I've tried
Code:
ffmpeg -i myvid.avs -vcodec mpeg2video -b 15000k -acodec ac3 -ab 224000 myvid-hd.mpg
and various other variations of this, but if i don't get errors, I end up with a black video (that gspot and MPC say is mpeg1) and no audio.

I am so confused as to what I could be doing wrong!

Mr. Vage is offline   Reply With Quote
Old 6th July 2008, 05:46   #2  |  Link
45tripp
Dolphin Blue
 
45tripp's Avatar
 
Join Date: Mar 2007
Posts: 336
first kill audio import into avisynth,
just use the original audio

Code:
loadplugin("dgavcdecode.dll") 
load_stdcall_plugin("yadif.dll") 
AVCSource("myvid.dga") 
yadif() 
Lanczos4Resize(1920, 1080)
then you might try this:

Code:
ffmpeg -i myvid.avs -i myvid.ac3 -vcodec mpeg2video -acodec copy -qscale 3 -g 14 -mbd 2 \
-flags trell -maxrate 20000k -bufsize 9781k -f vob myvid-hd.mpg
another good idea is to try HCenc to do the encoding.
then mux video, audio.


tripp
__________________
injected with feelings; with no final fading
45tripp is offline   Reply With Quote
Old 17th July 2008, 03:38   #3  |  Link
florinandrei
Registered User
 
Join Date: Jul 2006
Posts: 120
There's a thread concerning exactly this topic in the AviSynth forum:

http://forum.doom9.org/showthread.php?t=139102

Basically, scale the image with AviSynth, convert to MPEG2 with HCenc. It's easy to do it quickly and wrong. It's hard to do it right, at a high quality.
__________________
Florin Andrei

http://florin.myip.org/
florinandrei 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 19:06.


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