You are not logged in.

#1 2008-08-13 21:06:09

11010010110
Member
Registered: 2008-01-14
Posts: 284

Encoding video for mp4 player

i want to encode videos to be opened in my new mp4 player

it came preloaded with an example videoclip and it has cam built in. it can play the original clip and stuff captured by the cam

when i try to encode something else with ffmpeg for it it does not work. the player shows error message and refuses to play the file

i tried various ffmpeg options

it came bundled with some converter.exe but it is for windows

computer (linux with ffmpeg) plays and converts successfully the clip and the cam captures




preloaded clip download (18 MB) (sorry if copyrights or something)

cam sample download (12 MB)

ffmpeg output on converting the original video to something else

preloaded clip

ffmpeg -i IamAlive.avi IamAlive.wmv
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-liba52 --enable-libxvid --enable-libx264 --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --enable-x11grab --enable-swscale                                                                 
  libavutil version: 49.7.0                                                         
  libavcodec version: 51.60.0                                                       
  libavformat version: 52.17.0                                                      
  libavdevice version: 52.0.0                                                       
  built on Jul 20 2008 05:42:19, gcc: 4.3.1 20080626 (prerelease)                   
Input #0, avi, from 'IamAlive.avi':                                                 
  Duration: 00:03:34.20, start: 0.000000, bitrate: 726 kb/s                         
    Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 20.00 tb(r)      
    Stream #0.1: Audio: mp2, 44100 Hz, stereo, 128 kb/s                             
Output #0, asf, to 'IamAlive.wmv':                                                  
    Stream #0.0: Video: msmpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 20.00 tb(c)                                                                      
    Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, 64 kb/s                       
Stream mapping:                                                                     
  Stream #0.0 -> #0.0                                                               
  Stream #0.1 -> #0.1

cam

ffmpeg -i mov0024.mp4 mov0024.wmv                                    
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.            
  configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-liba52 --enable-libxvid --enable-libx264 --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --enable-x11grab --enable-swscale                                                                 
  libavutil version: 49.7.0                                                         
  libavcodec version: 51.60.0                                                       
  libavformat version: 52.17.0                                                      
  libavdevice version: 52.0.0                                                       
  built on Jul 20 2008 05:42:19, gcc: 4.3.1 20080626 (prerelease)                   
[mjpeg @ 0xb7be69b0]mjpeg_decode_dc: bad vlc: 0:0 (0x98f8af0)                       
[mjpeg @ 0xb7be69b0]error dc                                                        
[mjpeg @ 0xb7be69b0]error y=14 x=1                                                  
Input #0, avi, from 'mov0024.mp4':                                                  
  Duration: 00:07:29.56, start: 0.000000, bitrate: 123 kb/s                         
    Stream #0.0: Video: mjpeg, yuvj422p, 320x240, 10.00 tb(r)                       
    Stream #0.1: Audio: adpcm_ms, 8000 Hz, mono, 32 kb/s                            
Output #0, asf, to 'mov0024.wmv':                                                   
    Stream #0.0: Video: msmpeg4, yuv420p, 320x240, q=2-31, 200 kb/s, 10.00 tb(c)    
    Stream #0.1: Audio: libmp3lame, 8000 Hz, mono, 64 kb/s                          
Stream mapping:                                                                     
  Stream #0.0 -> #0.0                                                               
  Stream #0.1 -> #0.1                                                               
Press [q] to stop encoding                                                          
[mjpeg @ 0xb7be69b0]mjpeg_decode_dc: bad vlc: 0:0 (0x9976eb0)                       
[mjpeg @ 0xb7be69b0]error dc                                                        
[mjpeg @ 0xb7be69b0]error y=14 x=1                                                  
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127             
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 1 dct coefficients to -127..127
[msmpeg4 @ 0xb7be69b0]warning, clipping 2 dct coefficients to -127..127
frame=  458 fps=268 q=14.9 Lsize=    1673kB time=45.80 bitrate= 299.2kbits/s
video:1245kB audio:361kB global headers:0kB muxing overhead 4.157723%
Received signal 2: terminating.
(me hit ctrl c)

Offline

#2 2008-08-13 21:29:21

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding video for mp4 player

Why are you converting the files to WMV? The first one is showing mpeg4 video and mpeg2 audio in an AVI container. WMV (in this case) is msmpeg4v2 (a MS specific format) and mpeg3. Just to test, encode a test video with:

ffmpeg -i <your_video> -vcodec mpeg4 -acodec mp2 output.avi

It's going to look like crap, but it will allow you to see if it works.

Alternatively you can encode with mjpeg as your video codec and  adpcm_ms as your audio codec. You could probably use libmp3lame for audio. And, if FAAC from the repos wasn't broken, you could use m4a. If you care about that, the fix is already known.

Offline

#3 2008-08-13 21:52:14

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: Encoding video for mp4 player

i tried both of them and renaming the files between avi and mp4. nothing worked

Offline

#4 2008-08-13 22:22:11

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding video for mp4 player

11010010110 wrote:

i tried both of them and renaming the files between avi and mp4. nothing worked

Renaming the files isn't going to work unless you're using something like MPlayer or VLC. mp4 and AVI are much different containers.

What did you try exactly?

Offline

#5 2008-08-14 00:21:00

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: Encoding video for mp4 player

ffmpeg -i video.wmv video1.avi
ffmpeg -i video.wmv video1.mp4
ffmpeg -i video.wmv -acodec mp2 -vcodec mpeg4 video2.avi
ffmpeg -i video.wmv -acodec mp2 -vcodec mpeg4 video2.mp4
ffmpeg -i video.wmv -acodec adpcm_ms -vcodec mjpeg video3.mp4
ffmpeg -i video.wmv -acodec adpcm_ms -vcodec mjpeg video3.mp4
cp video1.avi video4.mp4
cp video1.mp4 video4.avi
cp video2.avi video5.mp4
cp video2.mp4 video5.avi
cp video3.avi video6.mp4
cp video3.mp4 video6.avi

none of the resulting videos works

Offline

#6 2008-08-14 00:49:47

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Encoding video for mp4 player

I'd still like to try a bit more if you don't mind.

What's the player that you're using?

Offline

#7 2008-08-14 01:02:19

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: Encoding video for mp4 player

untitled chinese make with label '4play' sticked to it

Offline

#8 2008-08-16 00:49:54

waltm
Member
From: alabama
Registered: 2006-03-21
Posts: 69

Re: Encoding video for mp4 player

Try something like this with ffmpeg.   The mpg is a vcd clip I had laying around.  The  IAmLive.avi (from your player) is a XVID encoded avi with mp2 sound.

 ffmpeg -i dia01.mpg -vcodec mpeg4 -b 700k -s 320x240 -acodec mp2 -ar 44100 -ab 128k -vtag XVID ~/work/test.avi

Last edited by waltm (2008-08-16 15:08:45)

Offline

#9 2008-08-16 07:55:25

toorima
Member
Registered: 2007-11-06
Posts: 12

Re: Encoding video for mp4 player

I use mvPod to convert xvid, mpg etc movies for my iphone, perfect quality.
http://mvpod.sourceforge.net
if you use itunes file ending must be .mp4

Last edited by toorima (2008-08-16 07:57:54)

Offline

#10 2008-08-16 13:48:00

atordo
Member
Registered: 2007-04-21
Posts: 147

Re: Encoding video for mp4 player

If you want to try a different converter: http://handbrake.fr/ (available in extra).

Offline

#11 2008-08-16 15:45:09

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: Encoding video for mp4 player

Maybe, you could look to a small project I have:
http://www.4nakama.net/download/encX264.sh

The bash script came with cool options for .mp4...

Info (in french):
http://www.4nakama.net/projet.php

@+

Offline

#12 2008-08-16 20:03:41

11010010110
Member
Registered: 2008-01-14
Posts: 284

Re: Encoding video for mp4 player

Thanks you all iwll try that in the following couple of days

Offline

Board footer

Powered by FluxBB