View previous topic :: View next topic |
Author |
Message |
memborg Tux's lil' helper
Joined: 16 Jun 2003 Posts: 121 Location: Aalborg, Denmark
|
Posted: Wed Dec 14, 2005 9:26 am Post subject: Converting h264 to xvid [SOLVED] |
|
|
Hi there
I want to convert my h.264 movie with aac audio to xvid with mp3 audio. Hwo do I do that?
The reason for this conversion is that I cannot get mplayer to playback the video, so then I wanted to convert it.
Best Regards
Memborg _________________ The Penguin Credo: Never Swim Alone
Last edited by memborg on Mon Jan 02, 2006 3:16 pm; edited 1 time in total |
|
Back to top |
|
|
Shadow Skill Veteran
Joined: 04 Dec 2004 Posts: 1023
|
Posted: Wed Dec 14, 2005 9:56 am Post subject: |
|
|
First you need to demux the video from whatever file format it is contained in then you need to do the same for the audio and reencode them to your desired format. Try avidemux that might be what you are looking for.
May I ask what version of mplayer are you using, and what architecture are you running, and what use flags did you set for mplayer?
mine are Code: | These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild R ] media-video/mplayer-1.0_pre7-r1 (-3dfx) (-3dnow) (-3dnowext) +X +aac -aalib +alsa (-altivec) -arts -bidi -bindist -bl -cdparanoia -cpudetection -custom-cflags -debug -dga -directfb -doc +dts -dv -dvb +dvd +dvdread -edl +encode +esd -fbcon* -ggi +gif +gtk -i8x0 +ipv6 -jack -joystick +jpeg -libcaca -lirc -live -livecd -lzo +mad +matroska -matrox (-mmx) (-mmxext) -mythtv -nas +nls -nvidia +opengl -oss +png -real -rtc -samba +sdl (-sse) (-sse2) (-svga) -tga +theora +truetype -v4l -v4l2 +vorbis (-win32codecs) -xanim -xinerama -xmms +xv +xvid -xvmc 0 kB
Total size of downloads: 0 kB | H264 works for me I'm running amd64 though. _________________ Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.
"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it." |
|
Back to top |
|
|
memborg Tux's lil' helper
Joined: 16 Jun 2003 Posts: 121 Location: Aalborg, Denmark
|
Posted: Wed Dec 14, 2005 10:15 am Post subject: |
|
|
Sure, I am running x86
Code: |
media-video/mplayer-1.0_pre7-r1 -3dfx -3dnow -3dnowext +X +aac +aalib +alsa (-altivec) -arts -bidi -bindist -bl -cdparanoia -cpudetection -custom-cflags -debug -dga +directfb -doc +dts +dv -dvb +dvd +dvdread -edl +encode -esd +fbcon -ggi +gif -gtk -i8x0 -ipv6 -jack +joystick +jpeg -libcaca -lirc -live -livecd +lzo +mad -matroska -matrox +mmx -mmxext +mythtv -nas +nls -nvidia +opengl -oss +png -real -rtc +samba +sdl +sse +sse2 -svga -tga +theora +truetype -v4l -v4l2 +vorbis +win32codecs -xanim -xinerama -xmms +xv +xvid -xvmc
|
mencoder fail with this message: mencoder: h264.c:2306: mc_dir_part: Assertion `pic->data[0]' failed.
I am using these commands:
Code: |
mencoder video.mp4 -nosound -o pass1.avi -sws 2 -ovc xvid -xvidencopts pass=1:chroma_me:max_bframes=2:bvhq=1:vhq=1:trellis
|
_________________ The Penguin Credo: Never Swim Alone |
|
Back to top |
|
|
memborg Tux's lil' helper
Joined: 16 Jun 2003 Posts: 121 Location: Aalborg, Denmark
|
Posted: Wed Dec 14, 2005 11:14 am Post subject: |
|
|
Well I found how to do it with ffmpeg instead. Only problem is the sound conversion. The aac audio is to slow when it gets converted to mp3 _________________ The Penguin Credo: Never Swim Alone |
|
Back to top |
|
|
Shadow Skill Veteran
Joined: 04 Dec 2004 Posts: 1023
|
Posted: Wed Dec 14, 2005 11:07 pm Post subject: |
|
|
hmm I dont have any experience with transcoding in Linux so I can't really help you. I am curious though what error did you get when trying to play the H264 file with mplayer and what are your ffmpeg use flags? _________________ Ware wa mutekinari.
Wa ga kage waza ni kanau mono nashi.
Wa ga ichigeki wa mutekinari.
"First there was nothing, so the lord gave us light. There was still nothing, but at least you could see it." |
|
Back to top |
|
|
memborg Tux's lil' helper
Joined: 16 Jun 2003 Posts: 121 Location: Aalborg, Denmark
|
Posted: Thu Dec 15, 2005 7:39 am Post subject: |
|
|
Shadow Skill wrote: | hmm I dont have any experience with transcoding in Linux so I can't really help you. I am curious though what error did you get when trying to play the H264 file with mplayer and what are your ffmpeg use flags? |
Well... The error I get is:
Code: |
mplayer: h264.c:2306: mc_dir_part: Assertion `pic->data[0]' failed.
|
It is the same error mencoder gives me.
And the useflags for ffmpeg:
Code: |
media-video/ffmpeg-0.4.9_p20051120 +a52 +aac (-altivec) -debug -doc +dts +encode -ieee1394 -imlib +mmx +network +ogg -oss +sdl -test +theora +threads +truetype -v4l +vorbis +xvid +zlib
|
_________________ The Penguin Credo: Never Swim Alone |
|
Back to top |
|
|
ukl Apprentice
Joined: 05 Mar 2005 Posts: 228 Location: /dev/null
|
Posted: Sat Dec 31, 2005 8:18 am Post subject: |
|
|
That`s my problem too. Same error. _________________ Pozdrawiam
Paweł |
|
Back to top |
|
|
mr_maniac_2k6 n00b
Joined: 01 Jan 2006 Posts: 1
|
Posted: Sun Jan 01, 2006 3:09 pm Post subject: |
|
|
... so, this i my first post on the gentoo forums. I found most of the answers to my gentoo problems on this forum so i think it's time to give something back.
Yesterday i had exactly the same problem of converting a h264 file to xvid. First, using ffmpeg alone resulted in a xvid file with the audio beeing to slow. This is how i solved it:
1. Extract audio from h264 file using MP4Box (part of media-video/gpac)
Code: | MP4Box -raw 2 video.h264 |
This extracts the 2nd track in raw format (in my case aac). First track is the video track of course.
2. Convert aac to wav using media-libs/faad2
Code: | faad extracted_audio.aac |
This results in a wav file used in step 4.
3. Convert h264 video only to xvid using media-video/ffmpeg
Code: | ffmpeg -i video.h264 -vcodec mpeg4 -vtag xvid -b BITRATE -an video_noaudio.xvid |
The -an tag omitts the audio to be converted. Replace BITRATE with your desired encoding bitrate.
4. Copy the video track and encode the audio track into mp3 using media-video/ffmpeg
Code: | ffmpeg -i video_noaudio.xvid -vcodec copy -vtag xvid -i audio.wav video_ready.xvid |
Additional options for the audio track like bitrate and so on can be used, see the ffmpeg documentation.
For me this solution worked, i hope it works for you too. |
|
Back to top |
|
|
mean Guru
Joined: 25 Sep 2002 Posts: 313
|
Posted: Sun Jan 01, 2006 4:58 pm Post subject: |
|
|
avidemux 2.1.0 should be able to read such files and convert them to xvid/lame or whatever |
|
Back to top |
|
|
memborg Tux's lil' helper
Joined: 16 Jun 2003 Posts: 121 Location: Aalborg, Denmark
|
Posted: Mon Jan 02, 2006 3:15 pm Post subject: |
|
|
Happy new year!!
Thanx for the replies. I like the step-by-step guide.
I will mark this one solved!
Cheers! _________________ The Penguin Credo: Never Swim Alone |
|
Back to top |
|
|
|