LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2009, 07:22 AM   #1
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Rep: Reputation: 32
To experts on transcode, mencoder, ffmpeg, avidemux


Hello guys!

I have a mp4 player that plays avi files.
Whenever I try to convert a video do play on this device I fail,
and I don't know why........

The source file, that comes shipped within the player, is the file src.avi,
and here is its spec:

erickfis@darkstar:~/tmp$ tcprobe -i src.avi
[tcprobe] RIFF data, AVI video
[tcprobe] summary for src.avi, (*) = not default, 0 = not detected
import frame size: -g 320x240 [720x576] (*)
aspect ratio: 4:3 (*)
frame rate: -f 20.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x50 [0x2000] (*)
bitrate=128 kbps
length: 1085 frames, frame_time=50 msec, duration=0:00:54.250

erickfis@darkstar:~/tmp$ file src.avi
src.avi: RIFF (little-endian) data, AVI, 320 x 240, 20.00 fps, video:
XviD, audio: MPEG-1 Layer 1 or 2 (stereo, 44100 Hz)

erickfis@darkstar:~/tmp$ mplayer -identify src.avi
Playing src.avi.
AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO: [XVID] 320x240 12bpp 20.000 fps 612.3 kbps (74.7 kbyte/s)
Clip info:
Software: MEncoder Sherpya-MinGW-20060312-4.1.0
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=MEncoder Sherpya-MinGW-20060312-4.1.0
ID_CLIP_INFO_N=1
ID_FILENAME=src.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=XVID
ID_VIDEO_BITRATE=612328
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=20.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=80
ID_AUDIO_BITRATE=128008
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=54.25
ID_SEEKABLE=1
ID_CHAPTERS=0


I've tried transcode, mencoder, ffmpeg and avidemux the best I could,
but the device keeps saying the the output is not a valid file.

Can u help me?
 
Old 08-12-2009, 12:00 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
1) Please put your output inside [noparse][code][\code][\noparse] tags. It makes the formatting easier to read.

2) You really haven't told us enough. I'm still not very clear about where your problems lie.

I take it the src.avi is a sample video that shows the specs your player handles? So does that video work? Is there any other documentation provided with your player, or found on the web, that details what the video parameters should be?

So what have you tried so far? Give us some examples of what commands you've attempted. What are your input files like? Have you succeeded in creating a video with similar specs to the above?

According to your output above (all 3 programs have essentially the same info), the sample video is in the following format:

Video:
AVI container
xvid codec
4:3 aspect ratio
320x240 frame size
framerate of 20 frames per second
bitrate of approximately 600kb
Audio:
mp2 codec
44100khz sampling frequency
stereo (2 channels)
bitrate 128kbs

I'm sure that there's some flexibility possible, particularly the bitrate, but you should try to get your output to be close to this. These are really very generic settings, so it should be a snap to produce something similar.

Apparently src.avi was produced using a Windows-based version of mencoder, so it should be possible to produce a playable file. Unfortunately from what I've seen on the web, it looks like some players require some precise advanced options settings. But without more info I can't say (and is beyond my ability anyway).
 
Old 08-13-2009, 08:39 AM   #3
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
Hello David!
Thanks for replying!

Here we go:

- src.avi is the file that comes shipped inside the player. Is the only video that I can play on it.

- there is no documentation. It is a mp4 that I bought from China/ebay

- no brand nor warranties.

- the last time I tried, I did:
Code:
ffmpeg -i input.avi -b 613000 -r 20.000 -s 320x240 -aspect 4:3 -vcodec libx264 -ab 128k -ar 44100 -acodec mp2 -ac 2 output.avi
It didn't work as well....

The specs of output.avi:

Code:
erickfis@darkstar:~/tmp/sandra$ file output.avi
output.avi: RIFF (little-endian) data, AVI, 320 x 240, 20.00 fps, video: X.264, audio: MPEG-1 Layer 1 or 2 (stereo, 44100 Hz)

erickfis@darkstar:~/tmp/sandra$ tcprobe -i output.avi
[tcprobe] RIFF data, AVI video
[tcprobe] summary for output.avi, (*) = not default, 0 = not detected
import frame size: -g 320x240 [720x576] (*)
     aspect ratio: 4:3 (*)
       frame rate: -f 20.000 [25.000] frc=0 (*)
      audio track: -a 0 [0] -e 44100,0,2 [48000,16,2] -n 0x50 [0x2000] (*)
                   bitrate=128 kbps
           length: 958 frames, frame_time=50 msec, duration=0:00:47.900


erickfis@darkstar:~/tmp/sandra$ mplayer -identify output.avi
MPlayer dev-SVN-r28306-4.2.4 (C) 2000-2009 MPlayer Team
CPU: AMD Sempron(tm) Processor 2800+ (Family: 15, Model: 44, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing output.avi.
AVI file format detected.
ID_VIDEO_ID=0
[aviheader] Video stream found, -vid 0
ID_AUDIO_ID=1
[aviheader] Audio stream found, -aid 1
VIDEO:  [H264]  320x240  24bpp  20.000 fps  723.8 kbps (88.4 kbyte/s)
Clip info:
 Software: Lavf52.25.0
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=Lavf52.25.0
ID_CLIP_INFO_N=1
ID_FILENAME=output.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=723792
ID_VIDEO_WIDTH=320
ID_VIDEO_HEIGHT=240
ID_VIDEO_FPS=20.000
ID_VIDEO_ASPECT=1.3333
ID_AUDIO_FORMAT=80
ID_AUDIO_BITRATE=127992
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_LENGTH=47.90
ID_SEEKABLE=1
ID_CHAPTERS=0
Reading theese specs, I can only conclude that the difference between src.avi and output.avi is the bpp parameter: 12 bpp in src.avi while 24 bpp in output.avi.

I'd already tried mencoder before, but just now I can't remember the parameters I used.

Any thoughts?
 
Old 09-18-2009, 11:32 AM   #4
darkone66669
Member
 
Registered: Mar 2004
Distribution: Fedora 10
Posts: 85

Rep: Reputation: 15
There is also another difference between src.avi and output.avi. src.avi uses the xvid codec and output.avi uses h264 codec. Are you sure your player plays h264 vids?
 
Old 09-18-2009, 01:11 PM   #5
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
To be honest I don't know.

But it's a clever idea to try xvid codec (x264, right?) to see what happens.

Thanks!
 
Old 09-18-2009, 07:41 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
avi is a container. It can contain any number of video codecs(mjpeg / msmpeg4v2 / xvid / ???) and audio codecs (pcm / mp2 / mp3 / ac3 / aac / ???). It's best to match the src.avi that works on the player. xvid is much older than x264, they are not always interchangeable.

mediainfo might better help you / us identify what the source file that works is. You should match that source. Portable players are generally stripped down to make room for content, not abilities. ffmpeg -i is another option to ID the source material. ffprobe, mplayer -identify, and many others...

Based on the provided info.

ffmpeg -i source.video -s 320x240 -r 20 -aspect 4:3 -ac 2 -ar 44100 -ab 128k -vcodec libxvid -b 600k -y output.avi

Although it looks like your source file was encoded with mencoder. Perhaps a little googling could identify a working encoding method.
 
Old 09-20-2009, 03:20 AM   #7
LightUnsigned
LQ Newbie
 
Registered: May 2009
Posts: 6

Rep: Reputation: 0
Its highly likely your player only plays xvid files with mp3 audio

Yet, you're trying to play an x264 encoded file

No wonder it doesnt work
 
Old 09-23-2009, 06:45 AM   #8
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
Hello everyone!

Thanks for replying!
But I'll have to wait until next week to try the new encoded videos,
because a friend of mine lend the mp4 player for a travel....
 
Old 09-23-2009, 07:06 AM   #9
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
For a while I had the same problem, I couldn't encode any videos to make them work with a Divx player. But, I found that something like this works every time:

Code:
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 1 -an -f rawvideo -y /dev/null

ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 2 -f avi output.avi
 
Old 09-28-2009, 01:55 PM   #10
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by LightUnsigned View Post
Its highly likely your player only plays xvid files with mp3 audio

Yet, you're trying to play an x264 encoded file

No wonder it doesnt work
today I tried libxvid,
but I get the same error on my player
 
Old 09-28-2009, 01:56 PM   #11
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by H_TeXMeX_H View Post
For a while I had the same problem, I couldn't encode any videos to make them work with a Divx player. But, I found that something like this works every time:

Code:
ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 1 -an -f rawvideo -y /dev/null

ffmpeg -i input.avi -vcodec libxvid -qscale 5 -s 320x240 -r 23.976 -aspect 4:3 -g 240 -bf 2 -acodec libmp3lame -ab 128k -ar 44100 -async 44100 -ac 2 -pass 2 -f avi output.avi
Thanks for helping,
but yet no success....

this (my mp4 player) is a really tough guy!
 
Old 09-28-2009, 02:00 PM   #12
erickFis
Member
 
Registered: Jun 2003
Location: Brasil
Distribution: Slackware 13.1_64 Gold Edition
Posts: 209

Original Poster
Rep: Reputation: 32
well, whenever I try libmp3lame I get

[libmp3lame @ 0x808e0f0]lame: output buffer too small (buffer index: 9195, free bytes: 597)
Audio encoding failed


Code:
erickfis@darkstar:~/tmp/sandra$ ffmpeg -i input.avi -b 613000 -r 20.000 -s 320x240 -aspect 4:3 -vcodec libxvid -ab 128k -ar 44100 -acodec libmp3lame -ac 2 output3.avi
FFmpeg version SVN-r16702, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/usr --mandir=/usr/man --disable-static --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-pthreads --enable-x11grab --enable-bzlib --enable-libamr-nb --enable-libamr-wb --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --arch=i686
  libavutil     49.14. 0 / 49.14. 0
  libavcodec    52.11. 0 / 52.11. 0
  libavformat   52.25. 0 / 52.25. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 2. 0 /  0. 2. 0
  libswscale     0. 6. 1 /  0. 6. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Jan 20 2009 20:28:40, gcc: 4.2.4
Input #0, avi, from 'input.avi':
  Duration: 00:00:47.80, start: 0.000000, bitrate: 259 kb/s
    Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 24.96 tb(r)
    Stream #0.1: Audio: mp2, 22050 Hz, mono, s16, 128 kb/s
Output #0, avi, to 'output3.avi':
    Stream #0.0: Video: libxvid, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 613 kb/s, 20.00 tb(c)
    Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[libmp3lame @ 0x808e0f0]lame: output buffer too small (buffer index: 9195, free bytes: 597)
Audio encoding failed
 
Old 09-28-2009, 02:01 PM   #13
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292Reputation: 1292
I say you try with a different video, maybe that one is corrupt or something.

As for the lame error, I recommend you use lame version 3.97, newer versions seem to have this bug. Maybe there a patch somewhere ? Either way I use version 3.97 and there is no such bug.

Last edited by H_TeXMeX_H; 09-28-2009 at 02:02 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to burn subtitles : issues in both Avidemux and ffmpeg ordealbyfire83 Linux - Software 1 07-06-2009 04:12 AM
Help me in installing ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encod mitesh.ever Red Hat 5 05-16-2009 12:14 PM
any Mencoder or Transcode gurus out there? Vindane Linux - Software 3 06-18-2006 06:27 PM
ffmpeg mencoder transcode Lobais Linux - Software 3 01-09-2006 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration