Newbie needs help encoding stuff for iPod
Hi to all of you. First of all I want to tell that I am a newbie at video encoding stuff. So there are a lot of things I don't know of and don't be aware of. Please be so kind and respect that when answering just because everyone needs to get started somehow. I really would love to know good places of RTFMs for ffmpeg-encoding stuff, if you have some stuff/links to enjoy! ;-) So reading is not the problem at all, mostly it's just about understanding the stuff... ;-) For now I tried to encode some videos in HD what most of the time worked out quite fine. Now that our kids got two ipods nano (5th gen) from us, I thought it might be useful to give them some sort of videos like the moonbear (in germany it's "The Mondb?r") and stuff like that. So I could convert a sample video extraction with XMedia recode (newest version) which plays nicely on the ipods. But as I don't want to do stuff with windows, I would love to do this encoding for the ipods with ffmpeg. In the meantime I compiled ffmpeg on my own Ubuntu 9.10 virtual machine. This is what I tried and what doesn't work at all and I have absolutely no clue why. Maybe you can help me?? --------------------------------------- root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac -ab 160k -ac 2 -aspect 16:9 -s 640x480 -vcodec libx264 -vpre ipod640 -b 1350k -bt 1350k -r 30.0 Der-Mondbaer-02-Schatzgraeber.mp4 FFmpeg version SVN-r21822, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 14 2010 19:14:56 with gcc 4.4.1 configuration: --disable-ffplay --disable-ffserver --disable-network --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac --enable-libfaad --enable-pthreads libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.54. 0 / 52.54. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, avi, from 'Der-Mondbaer-02-Schatzgraeber.avi': Duration: 00:12:12.00, start: 0.000000, bitrate: 1209 kb/s Stream #0.0: Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 25 tbr, 25 tbn, 25 tbc Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 32 kb/s [libx264 @ 0x20a8600]broken ffmpeg default settings detected [libx264 @ 0x20a8600]use an encoding preset (vpre) Output #0, mp4, to 'Der-Mondbaer-02-Schatzgraeber.mp4': Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 4:3 DAR 16:9], q=2-31, 1350 kb/s, 90k tbn, 30 tbc Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 160 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# --------------------------------------- Warm regards from germany, Michael
Hi to all of you.
First of all I want to tell that I am a newbie at video encoding stuff. So there are a lot of things I don't know of and don't be aware of. Please be so kind and respect that when answering just because everyone needs to get started somehow.
I really would love to know good places of RTFMs for ffmpeg-encoding stuff, if you have some stuff/links to enjoy! ;-) So reading is not the problem at all, mostly it's just about understanding the stuff... ;-)
For now I tried to encode some videos in HD what most of the time worked out quite fine. Now that our kids got two ipods nano (5th gen) from us, I thought it might be useful to give them some sort of videos like the moonbear (in germany it's "The Mondb?r") and stuff like that.
So I could convert a sample video extraction with XMedia recode (newest version) which plays nicely on the ipods.
But as I don't want to do stuff with windows, I would love to do this encoding for the ipods with ffmpeg.
In the meantime I compiled ffmpeg on my own Ubuntu 9.10 virtual machine.
This is what I tried and what doesn't work at all and I have absolutely no clue why. Maybe you can help me??
--------------------------------------- root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac -ab 160k -ac 2 -aspect 16:9 -s 640x480 -vcodec libx264 -vpre ipod640 -b 1350k -bt 1350k -r 30.0 Der-Mondbaer-02-Schatzgraeber.mp4 Your source is 25fps, so you shouldn't use the -r 30.0 option. -vpre ipod640 already sets options for bitrate among others. iPod accepts only 'square-pixels' so -aspect 16:9 is not acceptible. I would 1st read-up on what "-vpre ipod640" already sets. Probably this would work: ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec \
Michael Ludwig wrote: libfaac-ab 160k -ac 2 -vcodec libx264 -vpre ipod640 \ Der-Mondbaer-02-Schatzgraeber.mp4
FFmpeg version SVN-r21822, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 14 2010 19:14:56 with gcc 4.4.1 configuration: --disable-ffplay --disable-ffserver --disable-network --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac --enable-libfaad --enable-pthreads libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.54. 0 / 52.54. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, avi, from 'Der-Mondbaer-02-Schatzgraeber.avi': Duration: 00:12:12.00, start: 0.000000, bitrate: 1209 kb/s Stream #0.0: Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 25 tbr, 25 tbn, 25 tbc Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 32 kb/s [libx264 @ 0x20a8600]broken ffmpeg default settings detected [libx264 @ 0x20a8600]use an encoding preset (vpre) Output #0, mp4, to 'Der-Mondbaer-02-Schatzgraeber.mp4': Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 4:3 DAR 16:9], q=2-31, 1350 kb/s, 90k tbn, 30 tbc Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 160 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ---------------------------------------
Warm regards from germany, Michael _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Hi belcampo, thanks for answering! ;-) I didn't know that about square pixels. I will google that. The suggested code did not work. This is the output: --------------------------------------- root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre ipod640 Der-Mondbaer-02-Schatzgraeber.mp4 FFmpeg version SVN-r21822, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 14 2010 19:14:56 with gcc 4.4.1 configuration: --disable-ffplay --disable-ffserver --disable-network --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac --enable-libfaad --enable-pthreads libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.54. 0 / 52.54. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, avi, from 'Der-Mondbaer-02-Schatzgraeber.avi': Duration: 00:12:12.00, start: 0.000000, bitrate: 1209 kb/s Stream #0.0: Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 25 tbr, 25 tbn, 25 tbc Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 32 kb/s [libx264 @ 0x22805f0]broken ffmpeg default settings detected [libx264 @ 0x22805f0]use an encoding preset (vpre) Output #0, mp4, to 'Der-Mondbaer-02-Schatzgraeber.mp4': Stream #0.0: Video: libx264, yuv420p, 640x352 [PAR 1:1 DAR 20:11], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# --------------------------------------- Do you have any other ideas? I will now try to read on what the preset ipod640 says. Let's see if I can understand something... ;-) Warm regards from germany, Michael
Michael Ludwig wrote:
Hi belcampo,
thanks for answering! ;-)
I didn't know that about square pixels. I will google that. The suggested code did not work. This is the output:
--------------------------------------- root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre ipod640 Der-Mondbaer-02-Schatzgraeber.mp4 FFmpeg version SVN-r21822, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 14 2010 19:14:56 with gcc 4.4.1 configuration: --disable-ffplay --disable-ffserver --disable-network --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-avfilter --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libfaac --enable-libfaad --enable-pthreads libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.54. 0 / 52.54. 0 libavformat 52.52. 0 / 52.52. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 Input #0, avi, from 'Der-Mondbaer-02-Schatzgraeber.avi': Duration: 00:12:12.00, start: 0.000000, bitrate: 1209 kb/s Stream #0.0: Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 25 tbr, 25 tbn, 25 tbc Now I see, reading ain't that simple, that your video is already in the right format. PAR 1:1 means square pixels, bitrate has to be <= 1500kb/s and is 1209kb/sec and width is 640, which is the max for iPod, so the video part is already perfect. I don't know if the iPod accepts mp3, if not, only the audio has to be converted to aac. At last the container needs to be converted from avi to mp4. This should do it. ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac-ab 128k -ar 48000 -ac 2 -vcodec copy Der-Mondbaer-02-Schatzgraeber.mp4 Stream #0.1: Audio: mp3, 48000 Hz, 2 channels, s16, 32 kb/s [libx264 @ 0x22805f0]broken ffmpeg default settings detected [libx264 @ 0x22805f0]use an encoding preset (vpre) Output #0, mp4, to 'Der-Mondbaer-02-Schatzgraeber.mp4': Stream #0.0: Video: libx264, yuv420p, 640x352 [PAR 1:1 DAR 20:11], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# root at nw-vmw-dec:/DATALINK/mediathek1/VideoDB-TRANSCODING4/Der-Mondbaer# ---------------------------------------
Do you have any other ideas? I will now try to read on what the preset ipod640 says. Let's see if I can understand something... ;-)
Warm regards from germany, Michael _______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Hi belcampo, thank you again for answering! Indeed your code is working perfectly, but I would love to have all of my videos encoded as H.264 using libx264 with ffmpeg. I can't believe that this is impossible, so trying to figure out why I'm experiencing such troubles is a real challenge I think at the moment... ;-) It would be great if we could get this working somehow. Warm regards, Michael 2010/4/5 belcampo <belcampo at zonnet.nl>:
Now I see, reading ain't that simple, that your video is already in the right format. PAR 1:1 means square pixels, bitrate has to be <= 1500kb/s and is 1209kb/sec and width is 640, which is the max for iPod, so the video part is already perfect. I don't know if the iPod accepts mp3, if not, only the audio has to be converted to aac. At last the container needs to be converted from avi to mp4. This should do it. ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac-ab 128k -ar 48000 -ac 2 -vcodec copy Der-Mondbaer-02-Schatzgraeber.mp4
Michael Ludwig wrote:
Hi belcampo,
thank you again for answering! Indeed your code is working perfectly, but I would love to have all of my videos encoded as H.264 using libx264 with ffmpeg.
I can't believe that this is impossible, Sure this is NOT impossible so trying to figure out why I'm experiencing such troubles is a real challenge I think at the moment... ;-)
It would be great if we could get this working somehow. Could you upload a small sample so I could investigate myself?
Warm regards, Michael
2010/4/5 belcampo <belcampo at zonnet.nl>:
Now I see, reading ain't that simple, that your video is already in the right format. PAR 1:1 means square pixels, bitrate has to be <= 1500kb/s and is 1209kb/sec and width is 640, which is the max for iPod, so the video part is already perfect. I don't know if the iPod accepts mp3, if not, only the audio has to be converted to aac. At last the container needs to be converted from avi to mp4. This should do it. ffmpeg -y -i Der-Mondbaer-02-Schatzgraeber.avi -f mp4 -acodec libfaac-ab 128k -ar 48000 -ac 2 -vcodec copy Der-Mondbaer-02-Schatzgraeber.mp4
ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Hi belcampo, I will mail you a link where you can get an extract from the source. Maybe I should recompile with a fresh svn checkout. But I don't think this could solve the problem as this is a nearly fresh installation which I made a few months ago. Michael 2010/4/5 belcampo <belcampo at zonnet.nl>:
Could you upload a small sample so I could investigate myself?
Michael Ludwig wrote:
Hi belcampo,
I will mail you a link where you can get an extract from the source. Maybe I should recompile with a fresh svn checkout. But I don't think this could solve the problem as this is a nearly fresh installation which I made a few months ago. For several reasons I use an old svn-version SVN-r17923
Michael
2010/4/5 belcampo <belcampo at zonnet.nl>:
Could you upload a small sample so I could investigate myself?
ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
what are the reasons, btw? Just because I'm interested... 2010/4/5 belcampo <belcampo at zonnet.nl>:
For several reasons I use an old svn-version SVN-r17923
participants (2)
-
belcampo@zonnet.nl -
michaellud@googlemail.com