Log in

View Full Version : transcoding .dv to .mp4 using x264


seandarcy
16th February 2009, 19:32
I've been using ffmpeg to transcode raw .dv files from a camcoder to mp4 files with x264 and libfaac. But I'd like to try to use x264 directly with the psy option, which is not available under ffmpeg.

But I can't figure out how to manage taking the audio and video streams out of the .dv files, trancoding them to h264 and ac3 and sticking them into an mp4.

I imagine something like this under linux:

_demux_video_ input.dv | x264 <options> - tmp.h264
_demux_audio_ input.dv | sox (?) <options to convert pcm to ac3) - tmp.ac3
_mux_to_mp4_ tmp.h264 tmp.ac3 output.mp4

I have no idea what programs I'd actually use to do all this mux'ing. But someone must have done this before.

Any help appreciated.

sean

Dark Shikari
16th February 2009, 19:48
I've been using ffmpeg to transcode raw .dv files from a camcoder to mp4 files with x264 and libfaac. But I'd like to try to use x264 directly with the psy option, which is not available under ffmpeg.All options in ffmpeg use their x264 defaults, so psy is on by default.

Also, x264 doesn't take DV input, only raw YV12.

seandarcy
16th February 2009, 21:41
By psy on by default, do you mean "AQ on, psy-RD on". IOW, best visual quality.

>Also, x264 doesn't take DV input, only raw YV12.

Raw DV, I believe, is YUV411. Is there some clever utility ( yuv411_2_yv12 ? ) that converts it to YV12 ( also referred to as YUV420, just to keep us confused).

sean

Dark Shikari
16th February 2009, 21:49
By psy on by default, do you mean "AQ on, psy-RD on". IOW, best visual quality.Yes.
Raw DV, I believe, is YUV411.No, raw DV is raw DV. It can be decoded to raw YUV411, but natively it's a compressed bitstream.

seandarcy
16th February 2009, 22:41
> No, raw DV is raw DV. It can be decoded to raw YUV411, but natively it's a compressed bitstream.

OK. After dvgrab captures it from the camcorder as "raw" dv, ffmpeg sees the video stream as "dvvideo yuv411p". So I assume dvgrab converts the incoming stream to yuv411.

In any event, that's what I start with: yuv411 in a dv container. Is there any utility that will convert that to yv12 for input into x264?

sean

Dark Shikari
16th February 2009, 22:45
> No, raw DV is raw DV. It can be decoded to raw YUV411, but natively it's a compressed bitstream.

OK. After dvgrab captures it from the camcorder as "raw" dv, ffmpeg sees the video stream as "dvvideo yuv411p". So I assume dvgrab converts the incoming stream to yuv411.No, it sees it as "dvvideo," which is decoded to yuv411 in ffmpeg.
In any event, that's what I start with: yuv411 in a dv container.No, you have dv in a dv container.Is there any utility that will convert that to yv12 for input into x264?

seanffmpeg.

seandarcy
16th February 2009, 23:41
> No, it sees it as "dvvideo," which is decoded to yuv411 in ffmpeg.

But,

ffmpeg -i test.dv
FFmpeg version SVN-r17162, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-libxvid --enable-libx264 --enable-postproc --enable-shared --enable-pthreads --enable-gpl --enable-nonfree --enable-swscale --enable-avfilter --enable-avfilter-lavf --cpu=k8 --disable-debug --enable-libschroedinger --disable-encoder=libschroedinger --enable-libdirac --disable-decoder=libdirac
libavutil 49.14. 0 / 49.14. 0
libavcodec 52.14. 0 / 52.14. 0
libavformat 52.27. 0 / 52.27. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 3. 0 / 0. 3. 0
libswscale 0. 6. 1 / 0. 6. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Feb 11 2009 16:41:43, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
Input #0, dv, from 'test.dv':
Duration: 00:04:51.55, start: 0.000000, bitrate: 28771 kb/s
Stream #0.0: Video: dvvideo, yuv411p, 720x480, 28771 kb/s, PAR 10:11 DAR 15:11, 29.97 tb(r)
Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s

Sorry to be so slow, but to convert the dv file to yv12 with ffmpeg:

ffmpeg -i test.dv -acodec copy -f rawvideo(?) test-yv12.????

sean

Dark Shikari
17th February 2009, 01:18
-pix_fmt yuv420p -f rawvideo