.MTS (AVCHD/H.264) conversion?
Posted: 01 Oct 2008 03:14
I'm looking to buy an HD camcorder. The Canon HG20 specifically. I went to best buy and made some samples on an SDHC flash drive (transcend 16GB class 6). I'm having trouble converting the largest clip (1GB / 5 minutes). I am able to convert the smaller clips just fine.
ffmpeg -i 00000.mts -sameq -target ntsc-dvd 00000_dvd.mpg
ffmpeg -i 00001.mts -sameq -target ntsc-dvd 00001_dvd.mpg
But on the larger clip I get severe artifacts after about the two or three minute mark with ffmpeg. I am able to play the entire media without too many artifacts with vlc. If I disable frame dropping and slow the playback down the 0.25x, I can see all of the frames recorded with minimal artifacts and about 90% cpu usage. My current laptop is too slow to play them at speed. I've learned that vlc can convert the media, so I've been trying to do that. However doing so yields an audio only output file for me. Any tips for converting my mts file to a playable / 720p or DVD version? The media appears to be Mpeg 2 TS aka 24Mbps AVCHD / H.264. Mplayer does not play them without specifying the frame rate -fps 5. Xine or Totem cannot play them. Debian stable / etch, with a lot of the x264, ffmpeg, xvid, vlc, mplayer, and others from source. In addition to debian-multimedia.org in the apt sources (recent addition).
I recorded the first two at 60i. I may have switched the 3rd to 30p, or 24p, but I'm not entirely sure. It appears to be 60i just like the others for the most part. 60fps interlaced, I assume. Actually I need to use the following mencoder line to convert to DVD 29.97 fps quality. Because of the frame rate.
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 00001.mts -o hg20_dvd1.mpeg
With VLC attempts like this one.
cvlc 00002.mts --sout '#transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=224,channels=2,deinterlace,hq}:std{access=file,mux=mp4,dst=vlc_test.mp4}'
And this one, but some complaint on video encoder.
cvlc -vvv 00002.mts --sout '#transcode{vcodec=mp2v,vb=800,scale=1,acodec=mpga,ab=128,channels=2}:duplicate{dst=std{access=file,mux=mpeg,dst=vlc_test.mpg}}'
As I've said, these result in an audio only stream. As mplayer doesn't see a video stream. Even when vlc doesn't complain much. One other quirk, when I start vlc ($ vlc 00001.mts) it plays the video. But if I stop and start playback a second time, it doesn't show the video and just plays the audio.
My current goal is to make DVDs of my recordings. While hanging on to the HD / blueray originals. And possibly editing with 720p content on the laptop. I'm needing to record 15 minute minimums and if I can't get over the 3 minute-ish glitch, then obviously I wont be able to use this cam with it's video format. Any insight to get around this? Blatant syntax errors above? Missing libs / software? VLC 0.9.3 and 0.9.1. x264 snapshot(s) from source 9/01/2008 & 9/28/2008.
ffmpeg -i 00000.mts -sameq -target ntsc-dvd 00000_dvd.mpg
ffmpeg -i 00001.mts -sameq -target ntsc-dvd 00001_dvd.mpg
But on the larger clip I get severe artifacts after about the two or three minute mark with ffmpeg. I am able to play the entire media without too many artifacts with vlc. If I disable frame dropping and slow the playback down the 0.25x, I can see all of the frames recorded with minimal artifacts and about 90% cpu usage. My current laptop is too slow to play them at speed. I've learned that vlc can convert the media, so I've been trying to do that. However doing so yields an audio only output file for me. Any tips for converting my mts file to a playable / 720p or DVD version? The media appears to be Mpeg 2 TS aka 24Mbps AVCHD / H.264. Mplayer does not play them without specifying the frame rate -fps 5. Xine or Totem cannot play them. Debian stable / etch, with a lot of the x264, ffmpeg, xvid, vlc, mplayer, and others from source. In addition to debian-multimedia.org in the apt sources (recent addition).
I recorded the first two at 60i. I may have switched the 3rd to 30p, or 24p, but I'm not entirely sure. It appears to be 60i just like the others for the most part. 60fps interlaced, I assume. Actually I need to use the following mencoder line to convert to DVD 29.97 fps quality. Because of the frame rate.
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 00001.mts -o hg20_dvd1.mpeg
With VLC attempts like this one.
cvlc 00002.mts --sout '#transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=224,channels=2,deinterlace,hq}:std{access=file,mux=mp4,dst=vlc_test.mp4}'
And this one, but some complaint on video encoder.
cvlc -vvv 00002.mts --sout '#transcode{vcodec=mp2v,vb=800,scale=1,acodec=mpga,ab=128,channels=2}:duplicate{dst=std{access=file,mux=mpeg,dst=vlc_test.mpg}}'
As I've said, these result in an audio only stream. As mplayer doesn't see a video stream. Even when vlc doesn't complain much. One other quirk, when I start vlc ($ vlc 00001.mts) it plays the video. But if I stop and start playback a second time, it doesn't show the video and just plays the audio.
My current goal is to make DVDs of my recordings. While hanging on to the HD / blueray originals. And possibly editing with 720p content on the laptop. I'm needing to record 15 minute minimums and if I can't get over the 3 minute-ish glitch, then obviously I wont be able to use this cam with it's video format. Any insight to get around this? Blatant syntax errors above? Missing libs / software? VLC 0.9.3 and 0.9.1. x264 snapshot(s) from source 9/01/2008 & 9/28/2008.