Re: encoding mp4 to mpeg2 DVD format

Steven Boswell II <[email protected]>
Newsgroups gmane.comp.video.mjpeg.user
Message-ID <[email protected]>
If you're transcoding, you should be using something suited for that purpose, like ffmpeg.
Enclosed is a shell script that I use for transcoding arbitrary videos to DVD format.
Feel free to change the framerate, frame size, and aspect ratio to any legal values.

I use mpeg2enc only for creating MPEG2 video out of analog streams.  ffmpeg can do that too, but mpeg2enc is MUCH better at it.


Steven Boswell



________________________________
 From: JD <[email protected]>
To: [email protected] 
Sent: Friday, September 28, 2012 6:47 PM
Subject: [Mjpeg-users] encoding mp4 to mpeg2 DVD format
 

mjpegtools-2.0.0-1.fc16.i686

My question is if mpeg2enc is able to convert
mp4 videos to mpeg2 dvd format. This is how I am invoking it:

$ mpeg2enc  --no-constraints -o video_12.dvd  <
        $PWD/Video_12.mp4
   INFO: [mpeg2enc] SETTING EXTENDED MMX for MOTION!
   INFO: [mpeg2enc] SETTING SSE and MMX for TRANSFORM!
   INFO: [mpeg2enc] SETTING EXTENDED MMX for PREDICTION!
**ERROR: [mpeg2enc] Could not read YUV4MPEG2 header: bad header
        magic!

$ file Video_12.mp4
Video_12.mp4: ISO Media, MPEG v4 system, version 2

The mp4 video plays just fine using ffplay, mplayer, vlc, ...etc
on Linux.

Thank you. 
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Mjpeg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html

_______________________________________________
Mjpeg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-users
convert.sh (application/x-sh, 874 B)
#!/bin/bash

renice 10 $$

# Usage: convert.sh [input file] [videorate in kbps]
#	[audiorate in kbps] [output file]

ffmpeg -i "$1" \
	-an -vcodec mpeg2video -s 352x480 \
	-aspect 4:3 -b:v "${2}k" -r 30000/1001 \
	-maxrate "9350k" -bufsize 1835008 -dc 10 -qmin 1 -lmin '1*QP2LAMBDA' \
	-pass 1 -threads 2 -passlogfile /tmp/passlog-$$ \
	/tmp/convert-pass1-$$.m2v
rm -f /tmp/convert-pass1-$$.m2v

ffmpeg -i "$1" \
	-an -vcodec mpeg2video -s 352x480 \
	-aspect 4:3 -b:v "${2}k" -r 30000/1001 \
	-maxrate "9350k" -bufsize 1835008 -dc 10 -qmin 1 -lmin '1*QP2LAMBDA' \
	-pass 2 -threads 2 -passlogfile /tmp/passlog-$$ \
	/tmp/convert-pass2-$$.m2v

ffmpeg -i "$1" \
	-vn -acodec ac3 -ar 48000 -b:a "${3}k" -ac 2 /tmp/convert-$$.ac3

mplex -v 0 -f 8 /tmp/convert-pass2-$$.m2v /tmp/convert-$$.ac3 -o "$4"
rm -f /tmp/convert-pass2-$$.m2v /tmp/convert-$$.ac3 \
	/tmp/passlog-$$-0.log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.