View previous topic :: View next topic |
Author |
Message |
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Thu May 02, 2013 7:25 pm Post subject: ffmpeg creates incompatible xvid? [SOLVED] |
|
|
Hi,
I've got a picky set of hardware, which play's AVI-files, but only if they're smaller than 720px, encoded with XviD, and a low enough bitrate. A DVD-player which can play stuff from USB etc. as well.
I can't recall the exact reason I upgraded to ~amd64-keyworded 1.0.6 ffmpeg, instead of the stable 0.10.7, but there was a reason of some sort.
I used to be able to create compatible videos with the following command: "ffmpeg -i MOVIE.mp4 -vtag xvid -vf "scale=720:-1" MOVIE.avi". And indeed that still successfully encodes a video that looks fine on the computer, with ffmpeg 1.0.6, but unfortunately it does not play on the hardware. It doesn't display any error messages or some such, so it's a tad difficult to discern exactly what's wrong.
Anyone here have any suggestions of a set of encoding variables for creating a AVI which might work?
For what it's worth, here's the USE-flags used for ffmpeg:
Code: | Installed versions: 1.0.6(22:08:50 2013-04-28)(X aac alsa bzip2 encode faac fftools_aviocat fftools_cws2fws fftools_ffeval fftools_fourcc2pixfmt fftools_graph2dot fftools_ismindex fftools_pktdumper fftools_qt-faststart fftools_trasher hardcoded-tables mmx mp3 network rtmp sdl theora threads truetype v4l vaapi vorbis vpx x264 xvid zlib -3dnow -3dnowext -aacplus -altivec -amr -avx -bindist -bluray -cdio -celt -cpudetection -debug -doc -examples -fdk -flite -fontconfig -frei0r -gnutls -gsm -iec61883 -ieee1394 -jack -jpeg2k -libass -libcaca -libv4l -mmxext -modplug -neon -openal -openssl -opus -oss -pic -pulseaudio -schroedinger -speex -ssse3 -static-libs -test -twolame -vdpau -vis) |
Last edited by krisse on Fri Jul 19, 2013 6:11 am; edited 1 time in total |
|
Back to top |
|
|
Christian99 Veteran
Joined: 28 May 2009 Posts: 1668
|
Posted: Thu May 02, 2013 11:57 pm Post subject: |
|
|
if u don't have a proper description, what your player can play, this could be a bit hard.
but with your commandline, the video file won't be reencoded, so if it doesn't have the right codec already, it won't have it afterwards. You only change the containerformat from mp4 to avi and write in the avi file, that the video is divx encoded no matter what it really is.
So first check what your file really contains (eg ffprobe movie.mp4) if it isn't divx u need to encode it |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Fri May 03, 2013 4:44 am Post subject: |
|
|
Thanks for chiming in, Christian99! Are you sure it doesn't re-encode? Well, let's add "-b:v 1500k", and it does it for sure. Yes, difficult to figure out! I was hoping someone would know what had changed between ffmpeg, v0.10 and v1.0.6 which could explain it. |
|
Back to top |
|
|
Christian99 Veteran
Joined: 28 May 2009 Posts: 1668
|
Posted: Fri May 03, 2013 5:10 am Post subject: |
|
|
not really, i just assumed it because u didn't give a video codec.
I just tried here without giving a video codec and here ffmpeg seems to choose x264 as "default" codec. What does the ffmpeg output look like at you? which codec is mentioned?
EDIT: ok the codec used depends on the output container too. if avi is used as output container, xvid is choosen as codec. So, this seems to be right.
So forget what i said |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Fri May 03, 2013 1:28 pm Post subject: |
|
|
I've got a file, both encoded from the same source file; both encoded using same set of variables for ffmpeg. One encoded by ffmpeg-1.0.6, the other by ffmpeg-0.10.7.
Having run midentify on both, a diff give only the following: Code: | < ID_CLIP_INFO_VALUE0=Lavf53.32.100
---
> ID_CLIP_INFO_VALUE0=Lavf54.29.104
6c6
< ID_FILENAME=from-ffmpeg-0.10.7.avi
---
> ID_FILENAME=from-ffmpeg-1.0.6.avi
9,11c9,11
< ID_VIDEO_BITRATE=1484304
---
> ID_VIDEO_BITRATE=1483264 |
The complete midentify-info from ffmpeg-1.0.6 is as follows: Code: | ID_VIDEO_ID=0
ID_AUDIO_ID=1
ID_CLIP_INFO_NAME0=Software
ID_CLIP_INFO_VALUE0=Lavf54.29.104
ID_CLIP_INFO_N=1
ID_FILENAME=from-ffmpeg-1.0.6.avi
ID_DEMUXER=avi
ID_VIDEO_FORMAT=xvid
ID_VIDEO_BITRATE=1483264
ID_VIDEO_WIDTH=700
ID_VIDEO_HEIGHT=394
ID_VIDEO_FPS=30.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=127992
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_START_TIME=0.00
ID_LENGTH=1320.83
ID_SEEKABLE=1
ID_CHAPTERS=0
ID_VIDEO_CODEC=ffodivx
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=mpg123
ID_EXIT=EOF |
In other words, no help there, really. :-/ |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Thu Jul 18, 2013 8:53 pm Post subject: |
|
|
Still having the same problems with stable ffmpeg 1.0.7... :-/ |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Thu Jul 18, 2013 9:14 pm Post subject: |
|
|
I used (ffmpeg 0.*) to be able to produce working avis with the following command: Code: | ffmpeg -i INPUT -sameq -vtag xvid OUTPUT.avi | (The "-vtag xvid" was needed to make it play.)
Now, it won't work. Tried to make it a bit more explicit, with Code: | ffmpeg -i INPUT -vcodec libxvid -sameq -acodec libmp3lame -vtag xvid -f avi OUTPUT.avi |
That did not help.
Ideas? |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Thu Jul 18, 2013 10:23 pm Post subject: |
|
|
This (mencoder) works: Code: | mencoder INPUT.mp4 -oac mp3lame -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1500 -ffourcc XVID -o OUTPUT.avi |
|
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Thu Jul 18, 2013 10:53 pm Post subject: |
|
|
OK. Think I finally found something that ticked the right boxes (and avoided ticking boxes that annoyed the hardware): Code: | ffmpeg -i INPUT.mp4 -c:v mpeg4 -b:v 1500k -ac 2 -b:a 160k -flags +loop+mv4 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -subq 7 -refs 5 -me_range 16 -g 250 -qmin 10 -qmax 51 -f avi -vtag xvid OUTPUT.avi |
I'm sure parts of the above aren't necessary --- and the result isn't too pretty either ---, but at least it works. At least I now know it can be made to function with >=ffmpeg-1.0 too. |
|
Back to top |
|
|
krisse Guru
Joined: 15 Mar 2005 Posts: 325 Location: Sweden
|
Posted: Fri Jul 19, 2013 6:10 am Post subject: |
|
|
This seems more silly than anything else, but seems I might've found out the crucial option: audio bitrate.
This command didn't produce material that played on hardware: Code: | ffmpeg -i INPUT.mp4 -b:v 1500k -vtag xvid OUTPUT.avi |
This did: Code: | ffmpeg -i INPUT.mp4 -b:v 1500k -b:a 160k -vtag xvid OUTPUT.avi |
What's odd, I think, is that the first line produces 128k audio, whereas the latter makes 160k. That's the only differing line I see, as per midentify output (grepped audio):
midentify WORKED.avi | grep -i audio Code: | ID_AUDIO_ID=1
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=160000
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_AUDIO_BITRATE=160000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=mpg123 |
midentify DIDNOTWORK.avi | grep -i audio Code: | ID_AUDIO_ID=1
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=mpg123 |
|
|
Back to top |
|
|
|