converting and subtitle questions !
Hello Everyone! There have two questions need your help: (1) To convert rmvb to mp4 for my cellphone, i had to convert two times. First, rmvb should be converted to avi with mencoder; Second, avi could be converted to mp4 wth ffmpeg . My commands are: mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4 Is there a way to do that just with mencoder in one time ? If it can, please tell me the command ( i have tried much times, but failed all the time) ! (2) After adding subtitles to movie with mencoder, only striping (--) could be seen when playing! I'm sure the subtitle can works well when it working with the movie together. The language of the subtitle file is simple chinese and the encoder mode is utf8. My command is: mencoder test.avi -ovc lavc -oac copy -sub test.srt -font "/usr/share/fonts/truetype/arphic/uming.ttf" -subcp utf8 -subfont-encoding unicode -subfont-text-scale 3 new.avi I don't know why, please tell me if somebody know. --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
On Wed, Mar 19, 2008 at 02:40:01PM +0800, zechao wang wrote:
Hello Everyone!
There have two questions need your help:
(1) To convert rmvb to mp4 for my cellphone, i had to convert two times. First, rmvb should be converted to avi with mencoder; Second, avi could be converted to mp4 wth ffmpeg . my limited experience with mencoder and mp4, tells me you can't create mp4 from mencoder, you have to create avi files and then use MP4Box to extract the video and the audio and then re mux them back into mp4 container.
you seems to be doing the same thing but with ffmpeg
My commands are:
mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4
Is there a way to do that just with mencoder in one time ? If it can, please tell me the command ( i have tried much times, but failed all the time) !
(2) After adding subtitles to movie with mencoder, only striping (--) could be seen when playing! I'm sure the subtitle can works well when it working with the movie together. The language of the subtitle file is simple chinese and the encoder mode is utf8.
My command is: mencoder test.avi -ovc lavc -oac copy -sub test.srt -font "/usr/share/fonts/truetype/arphic/uming.ttf" -subcp utf8 -subfont-encoding unicode -subfont-text-scale 3 new.avi
I don't know why, please tell me if somebody know.
--------------------------------- ?????????????????????????????????????? _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- "I got to know Ken Lay when he was head of the What they call the Governor's Business Council in Texas. He was a supporter of Ann Richards in my run in And she had named him the head of the Governor's Business Council. And I decided to leave him in place, just for the sake of continuity. And that's when I first got to know Ken and worked with Ken." - George W. Bush 01/10/2002 Washington, DC attempting to distance himself from his biggest political patron, Enron Chairman Ken Lay, whom he nicknamed Kenny Boy
Thank you very much, Alex Samad! Does anybody have some idea about the second question ? Is't the command problem or the font file problem ? Alex Samad <alex@samad.com.au> 写道: On Wed, Mar 19, 2008 at 02:40:01PM +0800, zechao wang wrote:
Hello Everyone!
There have two questions need your help:
(1) To convert rmvb to mp4 for my cellphone, i had to convert two times. First, rmvb should be converted to avi with mencoder; Second, avi could be converted to mp4 wth ffmpeg . my limited experience with mencoder and mp4, tells me you can't create mp4 from mencoder, you have to create avi files and then use MP4Box to extract the video and the audio and then re mux them back into mp4 container.
you seems to be doing the same thing but with ffmpeg
My commands are:
mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4
Is there a way to do that just with mencoder in one time ? If it can, please tell me the command ( i have tried much times, but failed all the time) !
(2) After adding subtitles to movie with mencoder, only striping (--) could be seen when playing! I'm sure the subtitle can works well when it working with the movie together. The language of the subtitle file is simple chinese and the encoder mode is utf8.
My command is: mencoder test.avi -ovc lavc -oac copy -sub test.srt -font "/usr/share/fonts/truetype/arphic/uming.ttf" -subcp utf8 -subfont-encoding unicode -subfont-text-scale 3 new.avi
I don't know why, please tell me if somebody know.
--------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
On Wed, Mar 19, 2008 at 3:40 AM, zechao wang <wzc0066@yahoo.com.cn> wrote:
Hello Everyone!
There have two questions need your help:
(1) To convert rmvb to mp4 for my cellphone, i had to convert two times. First, rmvb should be converted to avi with mencoder; Second, avi could be converted to mp4 wth ffmpeg .
My commands are:
mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi This command reencodes the movie. Video codec is from lavc. Since you did not specify which video codec you wanted from the ones supported by lavc, mencoder uses the default MPEG-4 part 2. Audio codec is mp3 from mp3lame
ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4
This reencodes the movie again! This loses quality! Also, you are encoding with fixed bitrate in only one pass. This results in bad quality. I recommend you do the following: 1) Encode with mencoder, two pass. It would be something like this First pass: mencoder -o mov.avi -ovc lavc -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp=yes:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo -oac faac -faccopts br=
Is there a way to do that just with mencoder in one time ? If it can, please tell me the command ( i have tried much times, but failed all the time) !
(2) After adding subtitles to movie with mencoder, only striping (--) could be seen when playing! I'm sure the subtitle can works well when it working with the movie together. The language of the subtitle file is simple chinese and the encoder mode is utf8.
My command is: mencoder test.avi -ovc lavc -oac copy -sub test.srt -font "/usr/share/fonts/truetype/arphic/uming.ttf" -subcp utf8 -subfont-encoding unicode -subfont-text-scale 3 new.avi
I don't know why, please tell me if somebody know.
--------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- Software is like sex: it is better when it is free - Linus Torvalds
You are right, quality of the film is not very good, especially in the dark frame ! Could you tell me the full commands with two pass ? Thank you very much ! Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> 写道: On Wed, Mar 19, 2008 at 3:40 AM, zechao wang wrote:
Hello Everyone!
There have two questions need your help:
(1) To convert rmvb to mp4 for my cellphone, i had to convert two times. First, rmvb should be converted to avi with mencoder; Second, avi could be converted to mp4 wth ffmpeg .
My commands are:
mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi This command reencodes the movie. Video codec is from lavc. Since you did not specify which video codec you wanted from the ones supported by lavc, mencoder uses the default MPEG-4 part 2. Audio codec is mp3 from mp3lame
ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4
This reencodes the movie again! This loses quality! Also, you are encoding with fixed bitrate in only one pass. This results in bad quality. I recommend you do the following: 1) Encode with mencoder, two pass. It would be something like this First pass: mencoder -o mov.avi -ovc lavc -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp=yes:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo -oac faac -faccopts br=
Is there a way to do that just with mencoder in one time ? If it can, please tell me the command ( i have tried much times, but failed all the time) !
(2) After adding subtitles to movie with mencoder, only striping (--) could be seen when playing! I'm sure the subtitle can works well when it working with the movie together. The language of the subtitle file is simple chinese and the encoder mode is utf8.
My command is: mencoder test.avi -ovc lavc -oac copy -sub test.srt -font "/usr/share/fonts/truetype/arphic/uming.ttf" -subcp utf8 -subfont-encoding unicode -subfont-text-scale 3 new.avi
I don't know why, please tell me if somebody know.
--------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋! _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- Software is like sex: it is better when it is free - Linus Torvalds _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
My previous email was sent incomplete due to a bug in Gmail. Here is the full text:
mencoder mov.rmvb -ovc lavc -oac mp3lame -o mov.avi
This command re-encodes the movie. Video codec is from lavc. Since you did not specify which video codec you want from the ones supported by lavc, mencoder uses the default MPEG-4 part 2. Audio codec is mp3 from mp3lame
ffmpeg -y -i mov.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 mov.mp4
This re-encodes the movie again! This diminishes quality! Also, you are encoding with fixed bitrate in only one pass. This results in very bad quality. I recommend the following: 1) Encode with mencoder, two pass. It would be something like this First pass: mencoder -o mov.avi -ovc lavc -vf scale=400:240 -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb Second pass: mencoder -o mov.avi -ovc lavc -vf scale=400:240 -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2 -oac faac -faacopts br=128 mov.rmvb Note: why did you explicitly specify the framerate (29.97), audio sampling frequency (48000) and number of audio channels (2) ? Usually people just accept the default. For more information about mencoder, read http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html and http://www.mplayerhq.hu/DOCS/HTML/en/encoding-guide.html 2) Now you should *remux* your avi file to mp4. ***remux is different from re-encoding***. Another person suggested you to use the muxer MP4Box. I have never used this program, but it seems may people use it. It is probably a good choice.
My email is wrong again. This time because of a typo... Instead of this: -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo Use this: -lavcopts vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo The difference is that there is a space between lavcopts and vmax_b_frames, instead of a ':' .
The commands could run successfully this time! Thank you very much ! Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> 写道: My email is wrong again. This time because of a typo... Instead of this: -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo Use this: -lavcopts vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo The difference is that there is a space between lavcopts and vmax_b_frames, instead of a ':' . _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
Hello, sorry for troubling again. If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ? Thanks again. Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> 写道: My email is wrong again. This time because of a typo... Instead of this: -lavcopts:vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo Use this: -lavcopts vmax_b_frames=2:vb_strategy=2:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=1:turbo The difference is that there is a space between lavcopts and vmax_b_frames, instead of a ':' . _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
Hello, sorry for troubling again.
If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ?
First, I don't know about Xvid options. Second, my testing has showed that lavc mpeg4 yields better quality and speed than Xvid. Why do you want to use Xvid? Oh, and I forgot to ask. With your latest two-pass encoding (which you already told me that it worked), was the quality good? Oh, and so we can help you more, you should tell us something about your video. Is it a live action movie, or is it anime? Also, use the command midentify YOURMOVIE And post the output here
Hello : My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone. I have searched about mp4box, and i found it has nothing to do with Linux. All documentation and software are based on Windows(but i have no Windows). Yes, quality of the movie is good with 2-pass enc. But it's still avi . And it should be converted to mp4 . I don't know how to do it besides ffmpeg . My idea is : if i can use xvid to convert to aiv, then i could use command ffmpeg -y -i $avi -vcodec copy -acodec copy -f mp4 $avi.mp4 to make the destination. With this method, the quality could be maintained i think. My video is anime . zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.rmvb ID_AUDIO_ID=0 ID_VIDEO_ID=1 ID_CLIP_INFO_NAME0=name ID_CLIP_INFO_VALUE0=Ӱ�ӵ۹�(bbs.cnxp.com)[rockman_exe_the_movie] ID_CLIP_INFO_NAME1=author ID_CLIP_INFO_VALUE1=��Ӱ�ӵ۹�CNXP����������������� ID_CLIP_INFO_NAME2=copyright ID_CLIP_INFO_VALUE2=www.cnxp.com(C)2006 ID_CLIP_INFO_N=3 ID_FILENAME="mymov.rmvb" ID_DEMUXER=real ID_VIDEO_FORMAT=RV40 ID_VIDEO_BITRATE=0 ID_VIDEO_WIDTH=704 ID_VIDEO_HEIGHT=396 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=ffcook ID_AUDIO_FORMAT=cook ID_AUDIO_BITRATE=64080 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2989.00 ID_VIDEO_CODEC=rv3040 zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.avi ID_VIDEO_ID=0 ID_AUDIO_ID=1 ID_CLIP_INFO_NAME0=Software ID_CLIP_INFO_VALUE0=MEncoder 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.1 ID_CLIP_INFO_N=1 ID_FILENAME="mymov.avi" ID_DEMUXER=avi ID_VIDEO_FORMAT=FMP4 ID_VIDEO_BITRATE=523832 ID_VIDEO_WIDTH=400 ID_VIDEO_HEIGHT=240 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=faad ID_AUDIO_FORMAT=28781 ID_AUDIO_BITRATE=128000 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2987.22 ID_VIDEO_CODEC=ffodivx Any ideas ? Thank you ! Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> д���� > Hello, sorry for troubling again.
If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ?
First, I don't know about Xvid options. Second, my testing has showed that lavc mpeg4 yields better quality and speed than Xvid. Why do you want to use Xvid? Oh, and I forgot to ask. With your latest two-pass encoding (which you already told me that it worked), was the quality good? Oh, and so we can help you more, you should tell us something about your video. Is it a live action movie, or is it anime? Also, use the command midentify YOURMOVIE And post the output here _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- �Ż����䴫������ף�������Ժؿ�������
Hello :
My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone. you should check out the difference between xvid and dixv. (from my
On Fri, Mar 21, 2008 at 10:16:00AM +0800, zechao wang wrote: limited knowledge - basically the same standard, but one is a closed src and the other is open source). I have never had any problem playing xvid on a divx or vis versa
I have searched about mp4box, and i found it has nothing to do with Linux. All documentation and software are based on Windows(but i have no Windows).
I use it on linux, I am running debian
Yes, quality of the movie is good with 2-pass enc. But it's still avi . And it should be converted to mp4 . I don't know how to do it besides ffmpeg .
I have a version running on linux, it is part of the gpac deb package
My idea is : if i can use xvid to convert to aiv, then i could use command ffmpeg -y -i $avi -vcodec copy -acodec copy -f mp4 $avi.mp4 to make the destination. With this method, the quality could be maintained i think.
My video is anime .
zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.rmvb ID_AUDIO_ID=0 ID_VIDEO_ID=1 ID_CLIP_INFO_NAME0=name ID_CLIP_INFO_VALUE0=Ӱ?ӵ۹?(bbs.cnxp.com)[rockman_exe_the_movie] ID_CLIP_INFO_NAME1=author ID_CLIP_INFO_VALUE1=??Ӱ?ӵ۹?CNXP????????????????? ID_CLIP_INFO_NAME2=copyright ID_CLIP_INFO_VALUE2=www.cnxp.com(C)2006 ID_CLIP_INFO_N=3 ID_FILENAME="mymov.rmvb" ID_DEMUXER=real ID_VIDEO_FORMAT=RV40 ID_VIDEO_BITRATE=0 ID_VIDEO_WIDTH=704 ID_VIDEO_HEIGHT=396 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=ffcook ID_AUDIO_FORMAT=cook ID_AUDIO_BITRATE=64080 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2989.00 ID_VIDEO_CODEC=rv3040
zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.avi ID_VIDEO_ID=0 ID_AUDIO_ID=1 ID_CLIP_INFO_NAME0=Software ID_CLIP_INFO_VALUE0=MEncoder 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.1 ID_CLIP_INFO_N=1 ID_FILENAME="mymov.avi" ID_DEMUXER=avi ID_VIDEO_FORMAT=FMP4 ID_VIDEO_BITRATE=523832 ID_VIDEO_WIDTH=400 ID_VIDEO_HEIGHT=240 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=faad ID_AUDIO_FORMAT=28781 ID_AUDIO_BITRATE=128000 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2987.22 ID_VIDEO_CODEC=ffodivx
Any ideas ? Thank you !
Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> ?????? > Hello, sorry for troubling again.
If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ?
First, I don't know about Xvid options. Second, my testing has showed that lavc mpeg4 yields better quality and speed than Xvid. Why do you want to use Xvid?
Oh, and I forgot to ask. With your latest two-pass encoding (which you already told me that it worked), was the quality good?
Oh, and so we can help you more, you should tell us something about your video. Is it a live action movie, or is it anime? Also, use the command midentify YOURMOVIE
And post the output here _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
--------------------------------- ?????????????????????????????????????? _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- "No question that the enemy has tried to spread sectarian violence. They use violence as a tool to do that." - George W. Bush 03/22/2006 Washington, DC
Hello :
My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone. you should check out the difference between xvid and dixv. (from my
I'm using ubuntu. And after package gpac (i have searched long time about the package name) was installed, MP4Box could be found in my system. Step of my operation: user the 2-pass enc to convert rmvb to avi (-ovc lavc -oac faac) MP4Box -aviraw audio mymov.avi MP4Box -aviraw video mymov.avi ## I don't know why it should be renamed, just following the others. mv mymov_audio.raw "$movie".aac mv mymov_video.FMP4 "$movie".m4v MP4Box -add mymov.aac -add mymov.m4v mymov.mp4 But file mymov.mp4 could not be played in my cellphone! Please give me some advice, thank you very much. Alex Samad <alex@samad.com.au> 写道: On Fri, Mar 21, 2008 at 10:16:00AM +0800, zechao wang wrote: limited knowledge - basically the same standard, but one is a closed src and the other is open source). I have never had any problem playing xvid on a divx or vis versa
I have searched about mp4box, and i found it has nothing to do with Linux. All documentation and software are based on Windows(but i have no Windows).
I use it on linux, I am running debian
Yes, quality of the movie is good with 2-pass enc. But it's still avi . And it should be converted to mp4 . I don't know how to do it besides ffmpeg .
I have a version running on linux, it is part of the gpac deb package
My idea is : if i can use xvid to convert to aiv, then i could use command ffmpeg -y -i $avi -vcodec copy -acodec copy -f mp4 $avi.mp4 to make the destination. With this method, the quality could be maintained i think.
My video is anime .
zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.rmvb ID_AUDIO_ID=0 ID_VIDEO_ID=1 ID_CLIP_INFO_NAME0=name ID_CLIP_INFO_VALUE0=Ӱ?ӵ۹?(bbs.cnxp.com)[rockman_exe_the_movie] ID_CLIP_INFO_NAME1=author ID_CLIP_INFO_VALUE1=??Ӱ?ӵ۹?CNXP????????????????? ID_CLIP_INFO_NAME2=copyright ID_CLIP_INFO_VALUE2=www.cnxp.com(C)2006 ID_CLIP_INFO_N=3 ID_FILENAME="mymov.rmvb" ID_DEMUXER=real ID_VIDEO_FORMAT=RV40 ID_VIDEO_BITRATE=0 ID_VIDEO_WIDTH=704 ID_VIDEO_HEIGHT=396 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=ffcook ID_AUDIO_FORMAT=cook ID_AUDIO_BITRATE=64080 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2989.00 ID_VIDEO_CODEC=rv3040
zwang@wzc:~/Downloads$ sudo /usr/share/doc/mplayer/examples/midentify mymov.avi ID_VIDEO_ID=0 ID_AUDIO_ID=1 ID_CLIP_INFO_NAME0=Software ID_CLIP_INFO_VALUE0=MEncoder 2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.1 ID_CLIP_INFO_N=1 ID_FILENAME="mymov.avi" ID_DEMUXER=avi ID_VIDEO_FORMAT=FMP4 ID_VIDEO_BITRATE=523832 ID_VIDEO_WIDTH=400 ID_VIDEO_HEIGHT=240 ID_VIDEO_FPS=23.000 ID_VIDEO_ASPECT=0.0000 ID_AUDIO_CODEC=faad ID_AUDIO_FORMAT=28781 ID_AUDIO_BITRATE=128000 ID_AUDIO_RATE=44100 ID_AUDIO_NCH=2 ID_LENGTH=2987.22 ID_VIDEO_CODEC=ffodivx
Any ideas ? Thank you !
Jorge Peixoto de Morais Neto
?????? > Hello, sorry for troubling again.
If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ?
First, I don't know about Xvid options. Second, my testing has showed that lavc mpeg4 yields better quality and speed than Xvid. Why do you want to use Xvid?
Oh, and I forgot to ask. With your latest two-pass encoding (which you already told me that it worked), was the quality good?
Oh, and so we can help you more, you should tell us something about your video. Is it a live action movie, or is it anime? Also, use the command midentify YOURMOVIE
And post the output here _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
--------------------------------- ?????????????????????????????????????? _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- "No question that the enemy has tried to spread sectarian violence. They use violence as a tool to do that." - George W. Bush 03/22/2006 Washington, DC _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
I'm using ubuntu. And after package gpac (i have searched long time about the package name) was installed, MP4Box could be found in my system.
Step of my operation:
user the 2-pass enc to convert rmvb to avi (-ovc lavc -oac faac) MP4Box -aviraw audio mymov.avi MP4Box -aviraw video mymov.avi ## I don't know why it should be renamed, just following the others. mv mymov_audio.raw "$movie".aac mv mymov_video.FMP4 "$movie".m4v MP4Box -add mymov.aac -add mymov.m4v mymov.mp4
But file mymov.mp4 could not be played in my cellphone! Please give me some advice, thank you very much. When encoding with mencoder, use the option -ffourcc DX50 . This is sometimes necessary for your video to be recognized by a player (see
2008/3/21 zechao wang <wzc0066@yahoo.com.cn>: the man page for details).
On Wed, Mar 26, 2008 at 2:54 AM, Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> wrote:
2008/3/21 zechao wang <wzc0066@yahoo.com.cn>:
But file mymov.mp4 could not be played in my cellphone! Please give me some advice, thank you very much. When encoding with mencoder, use the option -ffourcc DX50 . This is sometimes necessary for your video to be recognized by a player (see the man page for details).
Try these options, they have a greater chance of working (see the documentation for their meaning): First pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb Second pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=2 -oac faac -faacopts br=128 mov.rmvb
Hello, "Jorge Peixoto de Morais Neto", thank you very much really. You have given me so much advice . mencoder -ffourcc DX50 -o /dev/null -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=2 -oac faac -faacopts br=128 mov.rmvb MP4Box -aviraw audio mov.avi MP4Box -aviraw video mov.avi mv mov_audio.raw mov.aac mv mov_video.cmp mov.m4v MP4Box -add mov.aac -add mov.m4v mov.mp4 The quality of the mp4 file is good, but still can not be played in phone. May be the MP4Box was used in a wrong way, anyone who can tell me how to use it correctly . Thanks. Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> 写道: On Wed, Mar 26, 2008 at 2:54 AM, Jorge Peixoto de Morais Neto wrote:
2008/3/21 zechao wang :
But file mymov.mp4 could not be played in my cellphone! Please give me some advice, thank you very much. When encoding with mencoder, use the option -ffourcc DX50 . This is sometimes necessary for your video to be recognized by a player (see the man page for details).
Try these options, they have a greater chance of working (see the documentation for their meaning): First pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb Second pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=2 -oac faac -faacopts br=128 mov.rmvb _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱,您的终生邮箱!
2008/3/27 zechao wang <wzc0066@yahoo.com.cn>:
Hello, "Jorge Peixoto de Morais Neto", thank you very much really. You have given me so much advice .
mencoder -ffourcc DX50 -o /dev/null -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb
mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=2 -oac faac -faacopts br=128 mov.rmvb
MP4Box -aviraw audio mov.avi
MP4Box -aviraw video mov.avi
mv mov_audio.raw mov.aac
mv mov_video.cmp mov.m4v
MP4Box -add mov.aac -add mov.m4v mov.mp4
The quality of the mp4 file is good, but still can not be played in phone. May be the MP4Box was used in a wrong way, anyone who can tell me how to use it correctly . Does your cell phone output any useful error message? I'm lost. But try this (although the quality will be bad, this may work):
First pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=16:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vrc_buf_size=327:vrc_maxrate=1152:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb Second pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=16:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vrc_buf_size=327:vrc_maxrate=1152:vpass=2 -oac faac -faacopts br=128 mov.rmvb
Thanks.
Jorge Peixoto de Morais Neto <please.no.spam.here@gmail.com> 写道: On Wed, Mar 26, 2008 at 2:54 AM, Jorge Peixoto de Morais Neto
wrote:
2008/3/21 zechao wang :
But file mymov.mp4 could not be played in my cellphone! Please give me some advice, thank you very much. When encoding with mencoder, use the option -ffourcc DX50 . This is sometimes necessary for your video to be recognized by a player (see the man page for details).
Try these options, they have a greater chance of working (see the documentation for their meaning): First pass: mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=1:turbo -oac faac -faacopts br=128 mov.rmvb
Second pass:
mencoder -ffourcc DX50 -o mov.avi -ovc lavc -vf scale=400:240,harddup -lavcopts vstrict=0:keyint=32:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vbitrate=512:vpass=2 -oac faac -faacopts br=128 mov.rmvb
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
--------------------------------- 雅虎邮箱,您的终生邮箱! _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- Software is like sex: it is better when it is free - Linus Torvalds
Alex Samad wrote:
My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone. you should check out the difference between xvid and dixv. (from my limited knowledge - basically the same standard, but one is a closed src and the other is open source). I have never had any problem playing xvid on a divx or vis versa
DivX and Xvid both are video encoders (mostly called "codec") that implement a part (!) of the mpeg4-part2 (aka mpeg4-vc aka mpeg4-asp) standard. Mpeg4-part2 (and thus divx and xvid) are quite obsolete now. Also most cell phones want to see proper mpeg4 these days, that means a mp4 container (OP already figured that out) and mpeg4-part10 (aka h264 aka mpeg4-avc) video. Xvid and DivX won't give you that. The easiest way to convert an arbitrary media file into mp4 that can be played by most cell phones is using ffmpeg because it can generate mp4 out-of-the-box (almost compliant) also using b-frames (which mencoder can't). OP should use something like ffmpeg -i inputfile -r <frame rate phone likes> -s <resolution phone likes> -vcodec libx264 -b <bitrate phone likes> -acodec libfaac -ab 128 -ar 48000 -f mp4 outputfile.mp4 If the phone chokes on this, use mp4box (gpac) to remux the mp4 into an isma file: mp4box -isma outpfile.mp4
Alex Samad wrote:
My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone. you should check out the difference between xvid and dixv. (from my limited knowledge - basically the same standard, but one is a closed src and the other is open source). I have never had any problem playing xvid on a divx or vis versa
DivX and Xvid both are video encoders (mostly called "codec") that implement a part (!) of the mpeg4-part2 (aka mpeg4-vc aka mpeg4-asp) standard.
Mpeg4-part2 (and thus divx and xvid) are quite obsolete now. Also most cell phones want to see proper mpeg4 these days, that means a mp4 container (OP already figured that out) and mpeg4-part10 (aka h264 aka mpeg4-avc) video. Xvid and DivX won't give you that.
The easiest way to convert an arbitrary media file into mp4 that can be played by most cell phones is using ffmpeg because it can generate mp4 out-of-the-box (almost compliant) also using b-frames (which mencoder can't). I was under the understanding that using mencoder to produce an avi and
On Mon, Mar 24, 2008 at 01:19:03PM +0100, Erik Slagter wrote: then using MP4Box to extract the video + audio and then remuxing would be the same as ffmpeg ? (I have used mencoder for a while and am getting used to using it) but what you seem to be saying its that it would be better to encode with ffmpeg directly.
OP should use something like
ffmpeg -i inputfile -r <frame rate phone likes> -s <resolution phone likes> -vcodec libx264 -b <bitrate phone likes> -acodec libfaac -ab 128 -ar 48000 -f mp4 outputfile.mp4
If the phone chokes on this, use mp4box (gpac) to remux the mp4 into an isma file: mp4box -isma outpfile.mp4
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
-- Don't you feel more like you do now than you did when you came in?
Alex Samad wrote:
I was under the understanding that using mencoder to produce an avi and then using MP4Box to extract the video + audio and then remuxing would be the same as ffmpeg ? (I have used mencoder for a while and am getting used to using it) but what you seem to be saying its that it would be better to encode with ffmpeg directly.
If I were in a situation where I could choose between mplayer/avi+mp4box and ffmpeg (i.e. no filtering and no subtitles), I'd definitely choose for ffmpeg. FFmpeg has most codecs and formats native, and keeping all frames within one application imho gives less chance to a/v desync; it can maintain the original timestamps with the frames. FFmpeg also has some options to force a/v sync where it doesn't come naturally ;-) (i.e. the timestamps are wrong). Using avi as intermediate file will probably work, but is prone to problems (especially if the input is an mpeg stream with b frames) as avi has a very different way of representing "timestamps" than the various types of mpeg streams.
Hello Erik Slagter: I want to convert rmvb files to mp4 for my cellphone. mencoder my.rmvb -ovc lavc -oac mp3lame -o my.avi ffmpeg -y -i my.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4 With above commands, it can works well. But the quality is not good, especially when playing the dark frames, there are too much mosaic. If you are familiar with ffmepg, how should i do if i want to get the high-quailty mp4 file ? Please give me some advice, thanks you very much. Erik Slagter <erik@slagter.name> 写道: Alex Samad wrote:
I was under the understanding that using mencoder to produce an avi and then using MP4Box to extract the video + audio and then remuxing would be the same as ffmpeg ? (I have used mencoder for a while and am getting used to using it) but what you seem to be saying its that it would be better to encode with ffmpeg directly.
If I were in a situation where I could choose between mplayer/avi+mp4box and ffmpeg (i.e. no filtering and no subtitles), I'd definitely choose for ffmpeg. FFmpeg has most codecs and formats native, and keeping all frames within one application imho gives less chance to a/v desync; it can maintain the original timestamps with the frames. FFmpeg also has some options to force a/v sync where it doesn't come naturally ;-) (i.e. the timestamps are wrong). Using avi as intermediate file will probably work, but is prone to problems (especially if the input is an mpeg stream with b frames) as avi has a very different way of representing "timestamps" than the various types of mpeg streams. _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱,您的终生邮箱!
zechao wang wrote:
Hello Erik Slagter:
I want to convert rmvb files to mp4 for my cellphone.
mencoder my.rmvb -ovc lavc -oac mp3lame -o my.avi
ffmpeg -y -i my.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4
With above commands, it can works well. But the quality is not good, especially when playing the dark frames, there are too much mosaic.
If you are familiar with ffmepg, how should i do if i want to get the high-quailty mp4 file ? Please give me some advice, thanks you very much.
Something like: ffmpeg -i my.rmvb -vcodec libx264 -acodec aac -s 400x240 -r 29.97 -b 600 -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4 Why do you need the extra pass with mencoder anyway? This command is a for a "proper" (imho) mp4-implementation, using h264 (aka mpeg4-avc). If your phone cannot handle that, replace -vcodec libx264 by -vcodec mpeg4, this will output mpeg-vc ("traditional mpeg4"). You do not need xvid for this.
Thank you very much, "Erik Slagter" ! Some medias are not supported by ffmpeg in my system, such as rm, rmvb, wmv. So mencoder was used to convert rmvb to avi firstly. I don't know why it can work in you system ! Information of my ffmpeg is: zwang@wzc:~/Downloads/tmp$ ffmpeg -version ffmpeg version CVS, build 3211266, Copyright (c) 2000-2004 Fabrice Bellard configuration: --enable-gpl --enable-pp --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-shared --prefix=/usr built on Feb 24 2008 14:35:12, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5) ffmpeg CVS libavcodec 3211266 libavformat 3211520 Any ideas ? Thanks. Erik Slagter <erik@slagter.name> 写道: zechao wang wrote:
Hello Erik Slagter:
I want to convert rmvb files to mp4 for my cellphone.
mencoder my.rmvb -ovc lavc -oac mp3lame -o my.avi
ffmpeg -y -i my.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4
With above commands, it can works well. But the quality is not good, especially when playing the dark frames, there are too much mosaic.
If you are familiar with ffmepg, how should i do if i want to get the high-quailty mp4 file ? Please give me some advice, thanks you very much.
Something like: ffmpeg -i my.rmvb -vcodec libx264 -acodec aac -s 400x240 -r 29.97 -b 600 -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4 Why do you need the extra pass with mencoder anyway? This command is a for a "proper" (imho) mp4-implementation, using h264 (aka mpeg4-avc). If your phone cannot handle that, replace -vcodec libx264 by -vcodec mpeg4, this will output mpeg-vc ("traditional mpeg4"). You do not need xvid for this. _______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users --------------------------------- 雅虎邮箱,您的终生邮箱!
zechao wang wrote:
Thank you very much, "Erik Slagter" !
Some medias are not supported by ffmpeg in my system, such as rm, rmvb, wmv. So mencoder was used to convert rmvb to avi firstly.
I don't know why it can work in you system !
Information of my ffmpeg is:
zwang@wzc:~/Downloads/tmp$ ffmpeg -version ffmpeg version CVS, build 3211266, Copyright (c) 2000-2004 Fabrice Bellard configuration: --enable-gpl --enable-pp --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-shared --prefix=/usr built on Feb 24 2008 14:35:12, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5) ffmpeg CVS libavcodec 3211266 libavformat 3211520
Any ideas ? Thanks.
Then probably mencoder uses a windows binary dll for decoding, ffmpeg doesn't work that way. In that case I'd recommend using mencoder (or mplayer) to decode your rmvb file to either yuv4mpeg (lossless) or mjpeg (almost lossless, use quantiser=2) in an avi container and hand that to ffmpeg. This will minimize/eliminate double encoding loss. I don't think you can't get it any more simple than this; mplayer/mencoder's strength is the ability to decode almost anything but it doesn't handle containers other than avi very well. FFmpeg can produce good quality containers but doesn't handle "binary-only" dll's. You might complain at the mplayer-devel mailing, but don't forget to wear your flame-proof coat. BTW maybe this little script is helpful, it uses mplayer, x264, faac and gpac, ffmpeg is not needed. See "man x264" for x264 parameters. You may need to use lame instead of faac if your phone doesn't understand aac. Also you may need to add a filter to mplayer to resize for your phone. #!/bin/sh vpipe1="dvd2avc1.y4m" apipe1="dvd2avc1.apipe" avc="$1.264" aac="$1.aac" mp4="$1.mp4" rm "$vpipe1" "$apipe1" 2> /dev/null mknod "$vpipe1" p mknod "$apipe1" p mplayer -noconsolecontrols -vf-clr \ -vf-add kerndeint=10:0:0:1:1 -benchmark \ -vo "yuv4mpeg:file=$vpipe1" \ -ao "pcm:waveheader:file=$apipe1:fast" \ "$1" 1>&2 /dev/null | \ x264 --bframes 8 --b-pyramid --ref 2 --crf 22 \ --trellis 1 --nr 2000 --level 41 \ --threads 2 --subme 5 -o "$avc" "$vpipe1" | \ (faac --mpeg-vers 4 -b 192 -o "$aac" "$apipe1" 2> /dev/null) rm "$vpipe1" "$apipe1" 2> /dev/null MP4Box -lang en -new "$mp4" -add "$avc" -add "$aac" -isma
On Wed, Mar 26, 2008 at 11:23 AM, Erik Slagter <erik@slagter.name> wrote:
zechao wang wrote:
Hello Erik Slagter:
I want to convert rmvb files to mp4 for my cellphone.
mencoder my.rmvb -ovc lavc -oac mp3lame -o my.avi
ffmpeg -y -i my.avi -vcodec xvid -s 400x240 -r 29.97 -b 600 -acodec aac -ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4
With above commands, it can works well. But the quality is not good, especially when playing the dark frames, there are too much mosaic.
If you are familiar with ffmepg, how should i do if i want to get the high-quailty mp4 file ? Please give me some advice, thanks you very much.
Something like:
ffmpeg -i my.rmvb -vcodec libx264 -acodec aac -s 400x240 -r 29.97 -b 600
-ac 2 -ar 48000 -ab 128 -vol 200 -f mp4 my.mp4
Why do you need the extra pass with mencoder anyway?
This command is a for a "proper" (imho) mp4-implementation, using h264 (aka mpeg4-avc). If your phone cannot handle that, replace -vcodec libx264 by -vcodec mpeg4, this will output mpeg-vc ("traditional mpeg4"). [...] I think it is much more common that a device supports "Divx" (meaning MPEG-4 part 2 with certain restraints) than H.264.
-- Software is like sex: it is better when it is free - Linus Torvalds
Jorge Peixoto de Morais Neto wrote:
I think it is much more common that a device supports "Divx" (meaning MPEG-4 part 2 with certain restraints) than H.264.
That is true for devices like DVD players. Phones tend to support mp4 (and not avi, which you'll need for "Divx") and h264 in it. BTW the container is mostly called "3gp" or similar, but it's actually very slightly modified mp4.
On Fri, Mar 28, 2008 at 11:16 AM, Erik Slagter <erik@slagter.name> wrote:
Jorge Peixoto de Morais Neto wrote:
I think it is much more common that a device supports "Divx" (meaning MPEG-4 part 2 with certain restraints) than H.264.
That is true for devices like DVD players.
Phones tend to support mp4 (and not avi, which you'll need for "Divx") and h264 in it. BTW the container is mostly called "3gp" or similar, but it's actually very slightly modified mp4. Interesting. Thank you for the infornation And this is good, because in my experience, H.264 absolutely kicks the butt of MPEG-4 part 2. I was told that the difference was not very big, but they were wrong. The difference is huge.
On Fri, 28 Mar 2008 18:06:30 -0300 "Jorge Peixoto de Morais Neto" <please.no.spam.here@gmail.com> wrote:
And this is good, because in my experience, H.264 absolutely kicks the butt of MPEG-4 part 2. I was told that the difference was not very big, but they were wrong. The difference is huge.
At very low bitrates, H.264 does a very good job masking artifacts, and preserving more detail. Once you get up even just to medium bitrates though, where ASP codecs don't have terribly obvious heavy artifacts, the two are much more closely matched. In my testing, x264 (encoding DVD with the recomended x264 options) has a nasty habit of strongly smoothing and removing lots of detail in certain parts of the picture, while at the same time leaving other parts of the same frame very noisy. What's worse, x264 makes odd choices of the noise to preserve, which looks completely unlike the original (where the noise does a good job helping to mask blockiness), and very different from the noise Xvid encodes (which I don't happen to like, but is at least non-irritating). This heavy, seemingly non-random, noise actually makes the picture look worse instead of better. In addition, many parts of the picture appear to have had their contrast lowered, and this makes the video look washed out in areas. This effect is all the worse when contrasted with neighboring extremely noisy blocks. All strange effects, that make the lower-bitrate x264 encodes actually look better than somewhat higher bitrate versions. Though, then the medium bitrate FMP4 encodes look generally better than either. Even if you don't have very good eyes, you should be able to see this effect very clearly just by turning up the contrast and saturation.
RC wrote:
"Jorge Peixoto de Morais Neto" <please.no.spam.here@gmail.com> wrote:
And this is good, because in my experience, H.264 absolutely kicks the butt of MPEG-4 part 2. I was told that the difference was not very big, but they were wrong. The difference is huge.
Agree. [ ... ]
In my testing, x264 (encoding DVD with the recomended x264 options) has a nasty habit of strongly smoothing and removing lots of detail in certain parts of the picture, while at the same time leaving other parts of the same frame very noisy. What's worse, x264 makes odd choices of the noise to preserve, which looks completely unlike the original (where the noise does a good job helping to mask blockiness), and very different from the noise Xvid encodes (which I don't happen to like, but is at least non-irritating). This heavy, seemingly non-random, noise actually makes the picture look worse instead of better.
In addition, many parts of the picture appear to have had their contrast lowered, and this makes the video look washed out in areas. This effect is all the worse when contrasted with neighboring extremely noisy blocks. All strange effects, that make the lower-bitrate x264 encodes actually look better than somewhat higher bitrate versions. Though, then the medium bitrate FMP4 encodes look generally better than either.
Even if you don't have very good eyes, you should be able to see this effect very clearly just by turning up the contrast and saturation.
Also agree. I exactly recognize the artifacts you mention. But I'd like to add: - on a phone you won't see the difference anyway ;-) - I assume the artifacts are a result of a suboptimal implementation, not per se h264 itself, I am convinced we will see improvement here, over time. - at least with ffmpeg's mpeg4-2 implementation I never managed to get an acceptable picture quality, using bit rates lower than a comparable mpeg2 encoding (so what's the point then...) - I've noticed that h264's artifacts are far worse on my computer monitors (various TFT) than on my television (CRT). Actually I have that with mpeg4-2 as well. - encoding with the crf option seems to be the wisest choice, but that won't impose any vbv requirements the device might impose. The last video I encoded for my Playstation 3 (also h264+aac in mp4) tends to stutter, I am afraid we have a vbv-problem here :-/ Interesting stuff...
On Sat, 29 Mar 2008 11:43:01 +0100 Erik Slagter <erik@slagter.name> wrote:
- at least with ffmpeg's mpeg4-2 implementation I never managed to get an acceptable picture quality, using bit rates lower than a comparable mpeg2 encoding (so what's the point then...)
There's inherently going to be generation loss, so if you're looking for perfect you won't find it. That said, I think it's pretty clear you just haven't been using the right options.
- I've noticed that h264's artifacts are far worse on my computer monitors (various TFT) than on my television (CRT). Actually I have that with mpeg4-2 as well.
It's all a question of the sharpness, saturation, and contrast settings you use. On my TV artifacts are certainly much more obvious than my or any others' LCDs I've used...
On Fri, 28 Mar 2008 18:06:30 -0300 "Jorge Peixoto de Morais Neto" <please.no.spam.here@gmail.com> wrote:
And this is good, because in my experience, H.264 absolutely kicks the butt of MPEG-4 part 2. I was told that the difference was not very big, but they were wrong. The difference is huge.
At very low bitrates, H.264 does a very good job masking artifacts, and preserving more detail. Once you get up even just to medium bitrates though, where ASP codecs don't have terribly obvious heavy artifacts, the two are much more closely matched. So your experience is that H.264 is always superior to MPEG-4, but
On Fri, Mar 28, 2008 at 10:51 PM, RC <cooleyr@gmail.com> wrote: they are close for medium/high bitrates? So maybe it is a good idea to chose a) H.264 for low-bitrate encoding when you have little storage b) MPEG-4 part 2 for high-bitrate encoding when you need little CPU usage. My interesting experience is that H.264 is excellent for low bitrate. I am encoding Futurama episodes with the best multimedia technology: H.264 video, Vorbis audio, Matroska muxing. For audio, oggenc -q 0 audiodump.wav For video, mencoder -profile anime0 -x264encopts crf=36 -o ${TEMP} ${ORIG} Where profile anime0 means ovc=x264=yes oac=copy=yes x264encopts=subq=6:8x8dct=yes:frameref=4:bframes=1:nob_adapt=yes:keyint=512:partitions=all:me=umh:me_range=15:trellis=1:direct_pred=auto The episode length is 21m42.4s . The vorbis stream is 9795482 bytes (about 60 kbps), and it sounds identical the the original 192 kbps mp3 stream. The video stream is 17824588 bytes (about 109 kbps), and even at this absurdly low bitrate (for a 512x384 25 fps cartoon) the video looks good after the intro. And it is no wonder the intro looks bad, since it has lots of objects flying rapidly in several directions. Fortunately I don't care about the intro. My remarks: a) x264's constant quality (crf) option is excellent. In my testing, it yields nearly the same encoding efficiency (in terms of bitrate at a given PSNR) as 2-pass encoding. It has two advantages over two pass: 1) It allows the user to select the quality instead of the bitrate. This is appropriate when you are not planning to exactly fill a CD or DVD. 2) It is faster. It is a huge shame that lavc's MPEG-4 part 2 doesn't have such an option. Specially for people like me who capture video from TV. Obviously I cannot use two-pass. and one-pass constant bitrate is about 15% less efficient than two-pass in my testing (meaning, the bitrate is about 15% bigger for a certain PSNR). It would be great if I could use a constant quality. The man page briefly suggests this: HINT: To do constant quantizer encoding with different quantizers for I/P- and B-frames you can use: lmin= <ip_quant>:lmax=<ip_quant>:vb_qfactor= <b_quant/ip_quant>. I have toyed around with these parameters and I have managed to get a little bit closer to two-pass efficiency. But it is hard to test because there is very terse documentation for these parameters. Can someone explain to me? It is hard to understand what lmin and lmax exactly do. I have studied lagrange multipliers, but I cannot understand what lmin and lmax really do. My specific requirement is to capture TV at (of course) realtime with constant quality. The quality should probably be quite high, so I can later (if I decide so) reencode with a super-high encoding efficiency (probably H.264). b) H.264's crf option does not really yield 'constant' quality. The quality varies a lot; in my case, the intro looked bad, probably because it has lots of motion. While I don't care about the intro of my cartoons, I wouldn't like a, say, war movie to have bad looking high motion scenes. Can the Mencoder guys fix this? Also, what is the progress of Matroska for mencoder? That would be great. -- Software is like sex: it is better when it is free - Linus Torvalds
On Sat, 29 Mar 2008 17:43:34 -0300 "Jorge Peixoto de Morais Neto" <please.no.spam.here@gmail.com> wrote:
So your experience is that H.264 is always superior to MPEG-4, but they are close for medium/high bitrates?
No. x264 does very well at low bitrates, where FMP4 artifacts heavily and looks terrible (say, significantly below 800k for 720x480 @24fps). Once you get above that, I much prefer FMP4. I've already explained why.
Jorge Peixoto de Morais Neto wrote:
a) H.264 for low-bitrate encoding when you have little storage b) MPEG-4 part 2 for high-bitrate encoding when you need little CPU usage.
Myself I am convinced that h264 is always superior to mpeg4-2, given the right options. I found an article when googling (about something else) that explains why h264 sometimes looks "washed out" compared to mpeg4-2 clips. They state that actually the h264 picture is "better" (more truthful to the original) but the deblocking filter masks blocky artifacts that in it's turn tend to mask missing details. So you're actually masking the masking ;-). It sounds a bit like sharpening and denoising filters in photo camera's. Once you're used to them, you need to get used to the "clean" pictures shot with a more expensive camera. At first sight it looks like it lacks details (of course you turn off completely the sharpening and denoising in the camera itself) and then when you apply just a very mild sharpening, suddenly the picture is stunning. You just don't get the details that aren't there ;-)
My remarks: a) x264's constant quality (crf) option is excellent.
I also like that one. One disadvantage is that is completely ignores any buffer requirements imposed by the device you're going to play the video on. If your device doesn't care, you're fine.
It is hard to understand what lmin and lmax exactly do. I have studied lagrange multipliers, but I cannot understand what lmin and lmax really do.
Seconded. I have been staring at these options (including the source) for hours, but it doesn't get any clearer. Also the docs do not help. One time even Michael has had a go at explaining it (in two sentences...) but it didn't quite help. It looks like lmin and lmax are the counterparts of qmin and qmax, but then for encoding at a target bitrate and vbv. It seems though you still can use qmin and qmax then...
My specific requirement is to capture TV at (of course) realtime with constant quality. The quality should probably be quite high, so I can later (if I decide so) reencode with a super-high encoding efficiency (probably H.264).
I have done this for year, until I bought me a satellite dish :-)
b) H.264's crf option does not really yield 'constant' quality. The quality varies a lot; in my case, the intro looked bad, probably because it has lots of motion. While I don't care about the intro of my cartoons, I wouldn't like a, say, war movie to have bad looking high motion scenes. Can the Mencoder guys fix this?
No, the x264 guys need to fix this :-) Although don't put your money on bitrate control, the computer cannot ever exactly "see" what you see.
2008/3/20, zechao wang <wzc0066@yahoo.com.cn>:
My destination is mp4, and it's ovc and oac should be xvid and aac, or it could not be played in my cellphone.
The ovc doesn't matter, as long as it outputs MPEG-4 Part 2. Xvid, Divx and lavc MPEG-4 are all compatible. You just need the right fourcc if you're using avi, but since you are using mp4, it doesn't matter. Also, as you are using a cellphone, avoid at most the cpu-heavy codec options and downscale your movie with -vf scale if needed. Check the cellphone manual for information on the supported mpeg features. See also if it uses the Divx profiles or the official MPEG profiles, they are different. I have searched about mp4box, and i found it has nothing to do with Linux.
All documentation and software are based on Windows(but i have no Windows).
I think the ffmpeg command line you are using is fine too (can't test now). You can even leave the '-f mp4' out.
If i want to use "-ovc xvid -xvidopts $str", what the $str should be here to instead of "-ovc lavc -lavcopts vmax_b_frames=2:vb_strategy=0:brd_scale=2:mbd=2:trell:v4mv:last_pred=3:predia=3:dia=3:cbp:preme=2:vqcomp=0.6:vbitrate=600:vpass=2:turbo" ?
If you really want to use xvid, see the man page. Also, you could put 'vcodec=libxvid' among the lavcopts and it would use xvid internally and you could leave the rest of the parameters as-is, but the default mpeg4 may be better.
participants (6)
-
Alex Samad -
Diogo Franco -
Erik Slagter -
Jorge Peixoto de Morais Neto -
RC -
zechao wang