Converting video from HD-PVR
I'm trying to convert these videos again, and while MEncoder can handle them without crashing now, I still have trouble with them. Frame rate is the major problem now. My typical encodes (mostly DVD rips) consist of these lines: mencoder [input] -msglevel all=0:statusline=5 -of avi -oac copy -ovc x264 -x264encopts crf=19:keyint=300:keyint_min=30:level_idc=41:frameref=15:mixed_refs:bframes=4:b_adapt=2:me_range=24:direct_pred=auto:partitions=all:cabac:8x8dct:me=hex:subq=5:threads=auto:nointerlaced:nopsnr:nossim -vf pp=lb,hqdn3d=0:0:6:6,harddup -o output.avi ffmpeg -i output.avi -f wav - 2>nul | neroaacenc -ignorelength -q 0.3 -if - -of output.m4a mp4box -aviraw video output.avi mp4box -add output_video.h264:fps=29.97 -add output.m4a -new output.mp4 I've had some success adding -demuxer lavf and -ofps 30000/1001 to the first line, but sync is off. If I omit -ofps 30000/1001, it behaves as if the input were 60000/1001fps, which I know is not true. I even tried using filmdint as if the video were telecined 60fps, and got jerky playback. I can provide a sample of the video, but it's almost 100MB per minute since I record at the max 13.5Mbps (local ABR). Is there anything I could try?
Output of the HD-PVR at highest bit rate is always telecined. But the input *is* 60000/1001 fps, interlaced. When the recording is clean, I normally get good results with these filters: -vf tfields=0,tinterlace=0,filmdint=fast=0/sad_thres=2048,softskip,scale=720:480 ,harddup -noskip But I always have to clean the input file first with ffmpeg -i [input] -an -vcodec copy -f rawvideo [output].h264 then MP4Box -tmp [temporary items directory] -add [ffmpegoutput].h264 -fps 59.94 -delay 2=500 [output].mp4 I just extract the audio and sample up to 448000 (the 384000 from the HD-PVR doesn't seem to work very well) and remux: ffmpeg -i [input] -vn -f ac3 -acodec ac3 -ab 448000 -ar 48000 -ac 6 -map 0.1:0.0 [output].ac3 then in the encoding: -oac copy -audiofile [input].ac3 Henk Schoneveld helped me figure out that the source is indeed 60000/1001 and how to deal with it. Laine Lee On 1/18/10 11:19 AM, "Andrew Berg" <bahamutzero8825@gmail.com> wrote:
I'm trying to convert these videos again, and while MEncoder can handle them without crashing now, I still have trouble with them. Frame rate is the major problem now. My typical encodes (mostly DVD rips) consist of these lines:
mencoder [input] -msglevel all=0:statusline=5 -of avi -oac copy -ovc x264 -x264encopts crf=19:keyint=300:keyint_min=30:level_idc=41:frameref=15:mixed_refs:bframes=4: b_adapt=2:me_range=24:direct_pred=auto:partitions=all:cabac:8x8dct:me=hex:subq =5:threads=auto:nointerlaced:nopsnr:nossim -vf pp=lb,hqdn3d=0:0:6:6,harddup -o output.avi ffmpeg -i output.avi -f wav - 2>nul | neroaacenc -ignorelength -q 0.3 -if - -of output.m4a mp4box -aviraw video output.avi mp4box -add output_video.h264:fps=29.97 -add output.m4a -new output.mp4
I've had some success adding -demuxer lavf and -ofps 30000/1001 to the first line, but sync is off. If I omit -ofps 30000/1001, it behaves as if the input were 60000/1001fps, which I know is not true. I even tried using filmdint as if the video were telecined 60fps, and got jerky playback. I can provide a sample of the video, but it's almost 100MB per minute since I record at the max 13.5Mbps (local ABR). Is there anything I could try? _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
On 1/19/2010 9:32 PM, Laine Lee wrote:
But I always have to clean the input file first with
ffmpeg -i [input] -an -vcodec copy -f rawvideo [output].h264
then
MP4Box -tmp [temporary items directory] -add [ffmpegoutput].h264 -fps 59.94 -delay 2=500 [output].mp4
The resulting video is very jittery. I think the video is being flagged as progressive even though it is interlaced.
When the recording is clean, I normally get good results with these filters:
-vf tfields=0,tinterlace=0,filmdint=fast=0/sad_thres=2048,softskip,scale=720:480 ,harddup -noskip With tfields and tinterlace in place and the scale option removed (I intend to keep the original resolution), x264 uses SAR=1/2, which is not correct. With tfields and tinterlace gone, x264 uses the correct SAR=1/1, but I get black frames (oddly though, the bitrate is consistent with normal video). It may work to "squish" full-height fields into half-height frames (this seems to be what tfields=0+tinterlace=0 does) if you are scaling down to 720x480 anyway, but I want to keep the full resolution, deinterlace with pp=lb and get as close to the original 30000/1001fps as possible. Of course, this may all be the result of the bad input video.
Update: tsMuxeR GUI identifies the raw AVC stream as 29.97fps. I've had reasons to doubt that 1080i content is 60fps, and this, along with the jittery output I got after muxing the stream with MP4Box, makes me think MP4Box can't handle interlaced video properly. When muxed into an MPEG-TS container with tsMuxeR, video playback is normal. Those black frames are because I used the wrong settings by accident. I will have to do the same tests again with proper x264 settings.
On 1/25/10 9:04 AM, "Andrew Berg" <bahamutzero8825@gmail.com> wrote:
When muxed into an MPEG-TS container with tsMuxeR, video playback is normal.
What method did you use to demux? tsMuxer? Laine Lee
On 1/26/2010 4:26 PM, Laine Lee wrote:
On 1/25/10 9:04 AM, "Andrew Berg" <bahamutzero8825@gmail.com> wrote:
When muxed into an MPEG-TS container with tsMuxeR, video playback is normal.
What method did you use to demux? tsMuxer? FFmpeg. Instead of muxing the raw video stream into an MPEG-4 container with MP4Box, I used tsMuxeR.
It doesn't seem to matter much whether I use the MP4 or TS as input. The main problem is that if I use tinterlace and tfields, the picture is half-width (SAR is 1/2, and I can't or don't know how to force it to use the proper 1/1), and if I don't, I have frame rate problems (either the video plays at double speed or at 15fps, depending on what options I use).
participants (2)
-
Andrew Berg -
Laine Lee