I've done a lot of experimenting with using files rendered by Cinelerra, then encoding them into a h264 file that Quicktime 7 on Mac or Windows can play. Since the video iPod is becoming a major new outlet for movies I wanted to figure out what settings worked.

My goal was to render from Cinelerra into a master format, like quicktime container with mjpeg-encoding, or raw yuv file, or a sequence of images like tga then use the master to encode (outside of Cinelerra) into various formats for distribution, like H264 or DVD.

For H264, here's what worked for me (thanks in great part to the MPEG-4 AVC forums at http://doom9.net). I hope it's helpful to other Cinelerra users.

=== creating a QT7 Player compatible H264 file from a raw YUV file ===

requires ffmpeg, x264 (http://developers.videolan.org/x264.html) and MP4Box (http://gpac.sourceforge.net/auth_mp4box.php)

Video:
using a file created by rendering from Cinelerra to a "YUV4MPEG Stream" file format, type the following commands at a bash prompt:

> ffmpeg -s $size -r $fps -i $video_input_file -f rawvideo -pix_fmt
yuv420p - |x264  --bitrate 770 --bframe 1 --no-b-adapt --ref 1
--filter 0:0 --no-cabac --subme 5 --analyse p8x8,b8x8,i4x4 --progress -o
$video_output_file - $output_size --fps $fps

[NOTE: you can add a -s $newsize near the end of the ffmpeg command -- before the "-" and pipe -- to allow resizing of the stream.]

where
* $size = original frame size in WxH

* $video_input_file = original source file

* $fps = frame rate of original source file

* $video_output_file = destination h264 file

* $output_size is the frame size of the final h264 movie; the same as ffmpeg's $newsize if you used that parameter; otherwise, the same as ffmpeg's $size parameter.

Audio:

In File Format, choose "Quicktime for Linux".

Enter name of file to render to.

Unselect Video; Select Audio.

In Audio properties, choose "Twos Complements".

Render.

When render complete, go to bash prompt.

> ffmpeg -i $audio_input_file -acodec aac -f mp4 $audio_output_file

where
* $audio_input_file and $audio_output_file are your respective
source and destination file.

Muxing Audio and Video:

> MP4Box -add $audio_output_file#audio $final_output_file

> MP4Box -fps $fps -add $video_output_file#video $final_output_file

where

* $final_output_file is the muxed mp4.

* $fps is the frames per second of your film.

Hopefully at this point, you'll be able to play $final_output_file in
Quicktime 7 on Mac or Windows.

thanks,

Roy

_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to