60i AVCHD -> NTCS DVD encoding results in slow video
FFMPEG Users, I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard. I've tried a variety of options with ffmpeg, including specifying the input rate, but they all get approximately the same result as: ---- ffmpeg -i <avchd-input-file> -target ntsc-dvd output.vob ---- The video plays slowly (just over half speed) and the audio plays at normal speed. When I begin the process, ffmpeg says this: ---- Input #0, mpegts, from '00002.mts': Duration: 00:04:01.2, start: 0.492856, bitrate: 15563 kb/s Program 1 Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 29.97 tb(r) Stream #0.1[0x1100]: Audio: liba52, 48000 Hz, stereo, 256 kb/s Output #0, dvd, to 'output.vob': Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 6000 kb/s, 29.97 tb(c) Stream #0.1: Audio: ac3, 48000 Hz, stereo, 448 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 ---- I set ffmpeg to encode a 10 second section of file with -ss 25 -t 10. When I play the file back in mplayer, I notice the following: ---- A: 10.5 V: 20.4 A-V: -9.820 ct: -0.927 597/597 3% 0% 0.2% 0 0 ---- Just under 20 seconds of real time passes. The audio completes well before the video does. The video is also encoded at a noticeably slow frame rate. My system isn't fast enough to decode AVCHD in real time using ffplay, so this may be a factor. However, I don't mind if the decoding/encoding occurs much slower than real time. Best, Jesse
Jesse Stroik wrote:
FFMPEG Users,
I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard. I've tried a variety of options with ffmpeg, including specifying the input rate, but they all get approximately the same result as:
I can't address your issue exactly, although I find it odd to see you write "60i" in your subject line... the normal thing would be 30i (meaning 30* frames per second, each of which carries two interlaced half-frames, for a total effective rate of 60fps*). However, it sounds like you have a similar problem to me, I have a Sony camcorder which produces HD content. I discovered, thanks to the helpful people here, that FFmpeg can't scale interlaced content. You need to do that, or you will get combing, shadowed moving edges, or a jerky 30fps* result. I switched to MEncoder, and got good results, primarily based on this: http://lists.mplayerhq.hu/pipermail/mencoder-users/2006-March/002956.html I suggest you do the same. * And for the purists, it is of course 30000/1001 and 60000/1001. -- Andy
Andy, Thanks for your response.
I can't address your issue exactly, although I find it odd to see you write "60i" in your subject line... the normal thing would be 30i (meaning 30* frames per second, each of which carries two interlaced half-frames, for a total effective rate of 60fps*).
I'm taking it from kdenlive, which defaults to a 1080 60i project. As you said, I should describe it as 30i.
However, it sounds like you have a similar problem to me, I have a Sony camcorder which produces HD content.
I discovered, thanks to the helpful people here, that FFmpeg can't scale interlaced content. You need to do that, or you will get combing, shadowed moving edges, or a jerky 30fps* result.
What about when you encode in 24p? I set my camera to 24p, and I'm getting the same result.
I switched to MEncoder, and got good results, primarily based on this:
http://lists.mplayerhq.hu/pipermail/mencoder-users/2006-March/002956.html
I suggest you do the same.
I'll give this a try and see if I can't find a good intermediate encode. Best, Jesse
Jesse Stroik wrote:
What about when you encode in 24p? I set my camera to 24p, and I'm getting the same result.
Aaahhhh 24p. Now there's an interesting story. While I was researching HD camcorders, I was torn between the highly recommended Canon, and the Sony with its ability to record 3 seconds at 240fps. I read up about it, and I decided that 24p really wasn't something I wanted! I was able to use FFmpeg's -deinterlace function to make a very nice 30p movie, and it WAS nice and crisp - but I simply didn't like the juddery motion. I just don't like low frame rates. I don't like the movies, and I particularly don't like 2:3 pulldown. I got the Sony. The point is, I can't tell you how to make a nice 24p movie, because as far as I'm concerned it's already s#1t the day you took it ;-) I see Herv? answered your real question... -- Andy
Le 26 f?vr. 08 ? 18:20, Jesse Stroik a ?crit :
FFMPEG Users,
I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard. I've tried a variety of options with ffmpeg, including specifying the input rate, but they all get approximately the same result as:
---- ffmpeg -i <avchd-input-file> -target ntsc-dvd output.vob ----
The video plays slowly (just over half speed) and the audio plays at normal speed. When I begin the process, ffmpeg says this:
[...] try with "-vsync 2" should make the work (if I well understand the comment in the "ffmpeg- cvslog list") I didn't try it yet (but it was a recent commit in SVN) so if you don't have the current version, then make a new build and test it. (and give news ;-)) bye Herv?
Herv?,
[...] try with "-vsync 2" should make the work (if I well understand the comment in the "ffmpeg- cvslog list") I didn't try it yet (but it was a recent commit in SVN) so if you don't have the current version, then make a new build and test it. (and give news ;-))
Yes, this seems much better. The video seems approximately the proper speed, but I'm still seeing a little a/v sync issue. I tried passing -r 60000/1001 and didn't have any better luck with the slight sync issue. I've got a perfect video for testing a/v sync, and it comes out properly with mencoder. If I can't get this working with ffmpeg, it isn't the end of the world because mencoder is working properly. In order to do any reasonable editing, I need to encode these files into something I can play in real time. An intermediate encoded is a necessary evil in this case, I think. Best, Jesse
Le 27 f?vr. 08 ? 01:51, Jesse Stroik a ?crit :
Herv?,
[...] try with "-vsync 2" should make the work (if I well understand the comment in the "ffmpeg- cvslog list") I didn't try it yet (but it was a recent commit in SVN) so if you don't have the current version, then make a new build and test it. (and give news ;-))
Yes, this seems much better. The video seems approximately the proper speed, but I'm still seeing a little a/v sync issue. I tried passing -r 60000/1001
??? like somebody previoulsy told to you: 60i in HD means 30i in SD (30frames per seconds, 2 fields per frames) so your framerate is 30000:1001 (and not the double!)
and didn't have any better luck with the slight sync issue.
try with -async 12345 too
In order to do any reasonable editing, I need to encode these files into something I can play in real time. An intermediate encoded is a necessary evil in this case, I think.
mjpeg codec is cool for fast encoding and realtime decoding at home (but produces hudge files). ffmpeg is very speed (encoding) with mpeg4 (and mpeg4 doesn't need as power as h264 decoding). bye Herv?
Jesse:
I've got a perfect video for testing a/v sync, and it comes out properly with mencoder.
Can you please post the command you used with mencoder to do this? I am having the exact same issue with ffmpeg when trying to transcode 1080i/60 video. The video plays back at half the rate of audio. This would be great if I can get this to work with mencoder. Thanks. -Dinesh ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Dinesh, I ended up using the following mencoder line: ----------- mencoder -of mpeg -oac copy -mpegopts format=dvd:vaspect=16/9:vframerate=30 -fps 60000/1001 -ofps 30000/1001 -ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:keyint=18:vrc_maxrate=9800:vbitrate=6000:aspect=16/9 -vf scale=720:480 00077.mts -o 00077.mpeg2 ----------- Audio/video comes out perfectly doing this. Best, Jesse Dinesh Nadarajah wrote:
Jesse:
I've got a perfect video for testing a/v sync, and it comes out properly with mencoder.
Can you please post the command you used with mencoder to do this? I am having the exact same issue with ffmpeg when trying to transcode 1080i/60 video. The video plays back at half the rate of audio. This would be great if I can get this to work with mencoder.
Thanks.
-Dinesh
____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Thanks. I will give it a try. Hope I can use a modified version for mpeg4/divx coding. -Dinesh --- Jesse Stroik <jnstroik at wisc.edu> wrote:
Dinesh,
I ended up using the following mencoder line:
----------- mencoder -of mpeg -oac copy -mpegopts format=dvd:vaspect=16/9:vframerate=30 -fps 60000/1001 -ofps 30000/1001 -ovc lavc -lavcopts
vcodec=mpeg2video:vrc_buf_size=1835:keyint=18:vrc_maxrate=9800:vbitrate=6000:aspect=16/9
-vf scale=720:480 00077.mts -o 00077.mpeg2 -----------
Audio/video comes out perfectly doing this.
Best, Jesse
Dinesh Nadarajah wrote:
Jesse:
I've got a perfect video for testing a/v sync, and it comes out properly with mencoder.
Can you please post the command you used with mencoder to do this? I am having the exact same issue with ffmpeg when trying to transcode 1080i/60 video. The video plays back at half the rate of audio. This would be great if I can get this to work with mencoder.
Thanks.
-Dinesh
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Dinesh Nadarajah wrote:
Thanks. I will give it a try. Hope I can use a modified version for mpeg4/divx coding.
Try something like this: ----- mencoder -of mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=7000:aspect=16/9 -fps 60000/1001 -ofps 30000/1001 -vf scale=1920x1080 <input> -o <output> ----- I created some mpeg4 stuff before i went to mpeg2, and for DVD resolutions I found the mpeg2 stuff better quality (I don't care about bitrate). It has the possible added advantage that I may be able to copy the video rather than encoding for some parts when I write to DVDs. I know you'd encode from 1440x1080 to 1920x1080 with the above line, but I think it makes sense to do the scaling in the video rather than counting on processing to scale later. This could be a completely naive way to do it -- I'm completely new at processing video and ffmpeg, in particular, is very good at abstracting away the complexity. Best, Jesse
On Thursday 28 February 2008 00:10:20 Jesse Stroik wrote:
Dinesh,
I ended up using the following mencoder line:
----------- mencoder -of mpeg -oac copy -mpegopts format=dvd:vaspect=16/9:vframerate=30 -fps 60000/1001 -ofps 30000/1001 -ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:keyint=18:vrc_maxrate=9800:vbit rate=6000:aspect=16/9 -vf scale=720:480 00077.mts -o 00077.mpeg2 -----------
Audio/video comes out perfectly doing this.
why are telling mencoder that the vframerate is 30 instead of 3000/1001 ? Please, don't top post
hi all I just had an querry how to watermark while encoding on the top rigt corner wkth ffmpeg. While using the -vhook I get the watermark on all the video screen and the video quality is degraded thanks
Neelmani wrote:
hi all
I just had an querry how to watermark while encoding on the top rigt corner wkth ffmpeg. While using the -vhook I get the watermark on all the video screen and the video quality is degraded
thanks
Use a watermark image where you place the watermark in the top right corner and the rest is transparent. I had best results using a .png with black color as transparent color and the -m 1 mode: -vhook "/usr/lib/vhook/watermark.so -m 1 -f /path/to/watermark.png" Best regards /Martin Lindhe
Nico, Nico Sabbi wrote:
On Thursday 28 February 2008 00:10:20 Jesse Stroik wrote:
Dinesh,
I ended up using the following mencoder line:
----------- mencoder -of mpeg -oac copy -mpegopts format=dvd:vaspect=16/9:vframerate=30 -fps 60000/1001 -ofps 30000/1001 -ovc lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:keyint=18:vrc_maxrate=9800:vbit rate=6000:aspect=16/9 -vf scale=720:480 00077.mts -o 00077.mpeg2 -----------
Audio/video comes out perfectly doing this.
why are telling mencoder that the vframerate is 30 instead of 3000/1001 ?
Good catch, thanks. Best, Jesse
Jesse Stroik wrote:
Herv?,
[...] try with "-vsync 2"
Yes, this seems much better. The video seems approximately the proper speed, but I'm still seeing a little a/v sync issue.
Jesse, did you mean to imply that you ARE getting normal speed video (i.e synced audio video) using the -sync arg? I'm using build based on ffmpeg-checkout-2008-02-29 but it seem to have no effect (AVCHD's play slow video from and HDR-SR1). If it IS working for you please post your command-line args so IU can see if I'm mis-ordering them, etc. Thanks.
Ken: I have the same problem. I used the following mencoder command to encode it to somethign playable. I was encoding it to MPEG-4/DivX mencoder -noskip -mc 0 -of mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500:aspect=16/9,vrc_buf_size=1835,mbd=2:trell -fps 60000/1001 -ofps 30000/1001 -vf scale=720:480,harddup input_file.ts -o output_file.avi _Dinesh --- Ken <kensystem at gmail.com> wrote:
Herv?,
[...] try with "-vsync 2"
Yes, this seems much better. The video seems approximately the
Jesse Stroik wrote: proper
speed, but I'm still seeing a little a/v sync issue.
Jesse, did you mean to imply that you ARE getting normal speed video (i.e synced audio video) using the -sync arg? I'm using build based on ffmpeg-checkout-2008-02-29 but it seem to have no effect (AVCHD's play slow video from and HDR-SR1). If it IS working for you please post your command-line args so IU can see if I'm mis-ordering them, etc.
Thanks.
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
On Wednesday 05 March 2008 16:09:08 Dinesh Nadarajah wrote:
Ken:
I have the same problem. I used the following mencoder command to encode it to somethign playable. I was encoding it to MPEG-4/DivX
mencoder -noskip -mc 0 -of mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500:aspect=16/9,vrc_buf_size=1835,mbd=2:trel l -fps 60000/1001 -ofps 30000/1001 -vf scale=720:480,harddup input_file.ts -o output_file.avi
what a mess! -of mpeg implies mpeg1 container, that can't contain mpeg4, and -o output_file.avi will create an mpeg with an .avi extension At least remove -of mpeg
You are correct. I did change it later. -D --- Nico Sabbi <Nicola.Sabbi at poste.it> wrote:
On Wednesday 05 March 2008 16:09:08 Dinesh Nadarajah wrote:
Ken:
I have the same problem. I used the following mencoder command to encode it to somethign playable. I was encoding it to MPEG-4/DivX
mencoder -noskip -mc 0 -of mpeg -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500:aspect=16/9,vrc_buf_size=1835,mbd=2:trel l -fps 60000/1001 -ofps 30000/1001 -vf scale=720:480,harddup input_file.ts -o output_file.avi
what a mess! -of mpeg implies mpeg1 container, that can't contain mpeg4, and -o output_file.avi will create an mpeg with an .avi extension
At least remove -of mpeg _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Herv? wrote:
Le 26 f?vr. 08 ? 18:20, Jesse Stroik a ?crit :
FFMPEG Users,
I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard.
[snip]
The video plays slowly (just over half speed) and the audio plays at normal speed.
Here is a small AVCHD/m2ts and mp4 output in case anyone wants to test this: http://www.onnet.cc/sample.m2ts created by a sony hdr-sr1, and produces (like ffdshow) a video stream that runs at half rate (any -vsync and -r combo I tried would not work): ffmpeg -y -deinterlace -i sample.m2ts -vsync 2 -r 60 -s 480x272 -vcodec libx264 sample.mp4 http://www.onnet.cc/sample.mp4
Try converting video to raw and later encoding back with audo ffmpeg -i test.mpg -f yuv4mpegpipe - | yuvfps -s 2997:100 -r 2997:100 | ffmpeg -f yuv4mpegpipe -i - -b 28800k -i audio.mp3 -y /tmp/output.avi For more info : (http://stream0.org/2008/02/howto-alter-video-speed-with-f.html) Rosh Cherian ________________________________________ From: ffmpeg-user-bounces at mplayerhq.hu [ffmpeg-user-bounces at mplayerhq.hu] On Behalf Of Ken [kensystem at gmail.com] Sent: 05 March 2008 05:51 To: FFmpeg user questions and RTFMs Subject: Re: [Ffmpeg-user] 60i AVCHD -> NTCS DVD encoding results in slow video Herv? wrote:
Le 26 f?vr. 08 ? 18:20, Jesse Stroik a ?crit :
FFMPEG Users,
I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard.
[snip]
The video plays slowly (just over half speed) and the audio plays at normal speed.
Here is a small AVCHD/m2ts and mp4 output in case anyone wants to test this: http://www.onnet.cc/sample.m2ts created by a sony hdr-sr1, and produces (like ffdshow) a video stream that runs at half rate (any -vsync and -r combo I tried would not work): ffmpeg -y -deinterlace -i sample.m2ts -vsync 2 -r 60 -s 480x272 -vcodec libx264 sample.mp4 http://www.onnet.cc/sample.mp4 _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Le 5 mars 08 ? 07:51, Ken a ?crit :
Herv? wrote:
Le 26 f?vr. 08 ? 18:20, Jesse Stroik a ?crit :
FFMPEG Users,
I have a Canon HG10 that creates anamorphic AVCHD files in 1440x1080 and would like to encode to the NTSC DVD standard.
[snip]
The video plays slowly (just over half speed) and the audio plays at normal speed.
Here is a small AVCHD/m2ts and mp4 output in case anyone wants to test this:
http://www.onnet.cc/sample.m2ts created by a sony hdr-sr1, and produces (like ffdshow) a video stream that runs at half rate (any -vsync and -r combo I tried would not work):
ffmpeg -y -deinterlace -i sample.m2ts -vsync 2 -r 60 -s 480x272 - vcodec libx264 sample.mp4
I didn't write it in the previous mail but vsync must be before input ;-) just a notice: you deinterlace (remove one of the 2 fields), but double the output framerate (=duplication), why?!? command line: ffmpeg -vsync 2 -deinterlace -i sample.m2ts -r 30000:1001 -s 480x272 - vcodec libx264 -y sample.mp4 bye Herv?
Herv? wrote:
I didn't write it in the previous mail but vsync must be before input ;-) just a notice: you deinterlace (remove one of the 2 fields), but double the output framerate (=duplication), why?!? command line:
ffmpeg -vsync 2 -deinterlace -i sample.m2ts -r 30000:1001 -s 480x272 - vcodec libx264 -y sample.mp4
Herv?, using this command I get the same result... no change. In fact the video frame rate is reported as 15fps. Did you try this on the source http://www.onnet.cc/sample.m2ts and it worked? I'm using a ffmpeg-checkout-2008-02-29 build, by the way..
Ken wrote:
Herv? wrote:
I didn't write it in the previous mail but vsync must be before input ;-) just a notice: you deinterlace (remove one of the 2 fields), but double the output framerate (=duplication), why?!? command line:
ffmpeg -vsync 2 -deinterlace -i sample.m2ts -r 30000:1001 -s 480x272 - vcodec libx264 -y sample.mp4
Herv?, using this command I get the same result... no change. In fact the video frame rate is reported as 15fps. Did you try this on the source http://www.onnet.cc/sample.m2ts and it worked? I'm using a ffmpeg-checkout-2008-02-29 build, by the way..
I believe vsync serves to synchronize to the video as a timebase/reference... but the problem with AVCHD (or H264 +interlace in general) is that the h264 decoder is reporting the wrong frame rate, probably related to the interface timebase (needing support for mixed progressive& interlace modes, PAFF MBAFF etc). So vsync cannot correct for that, inherently.
Jesse Stroik wrote:
FFMPEG Users, [snip]
The video plays slowly (just over half speed) and the audio plays at normal speed. When I begin the process, ffmpeg says this:
Its noteworthy I think that this behavior of the video running approx 1/2 real time, occurs in the windows/ffdhow decoder's playback, too. Although I kind of like being able to watch in slow motion, the glorious, stunning video quality of it all, esp. with the deinterlacer turned on :-)
participants (9)
-
andycivil@gmail.com -
herve.flores@free.fr -
jnstroik@wisc.edu -
kensystem@gmail.com -
martin@startwars.org -
n_dinesh@yahoo.com -
neelmani.shankar@techmastiff.com -
Nicola.Sabbi@poste.it -
rosh@tid.es