-   Linux - General (
-   -   ffmpeg converting video (

jake20x 04-05-2011 11:29 PM

ffmpeg converting video
So I've already asked a similar question to this on another forum but thought I would try here. I have a movie file from itunes that I want to decode so that I can make it into an iso and also play in other programs besides itunes since I use ubuntu more than windows. I was told to try to use the built in to ubuntu program ffmpeg and did some research on the command line for it and still am having problems. I am no pro at reading about everything that comes up about the file but I managed to figure out the right command to convert a video to another format but ran into problems.

I used this command to find information about the file:
# ffmpeg -i /home/jacob/Videos/TheVillage.m4v

After doing so I found the different codec of the audio and video formats and used this along with the size of the video to compile a command to convert the program.

this command: # ffmpeg -i /home/jacob/Videos/TheVillage.m4v -vcodec [mjpeg/drmi] -s 640x344 -b 300k -r 10 -acodec aac -strict experimental -ar 22050 -ab 64k -f avi TheVillage.avi

note is []'s I list two different formats, but used a separate one each time such as -vcodec mjpeg once and the other format the second try. I mention this because this is where my problem occurs, and like I said I am new to this program so I might be doing something wrong that's very simple. The program shows me the info about the file and states under "Stream #0.4" that the video codec is "mjpeg, yuvj420p, 640x344 [PAR 96:96 DAR 80:43], 0 kb/s, PAR 43:80 DAR 1:1, 0k fps, 44100 tbr, 44100 tbn, 44100 tbc", and under another stream it states that the codec is drmi. Knowing this I tried first with drmi since it was listed before the other stream and thought logically it would work, but the program states that drmi is not a format recognized, so I tried with the mjpeg format and everything seems to work, except after it finishes it says the video wasn't created but I have a read only avi file that of course will not play when executed.

So basically I'm wondering if anyone knows the answer to this problem or could help explain to me another way to go about doing this since I have never used this program before.

H_TeXMeX_H 04-06-2011 06:15 AM


Originally Posted by jake20x (Post 4315247)
I used this command to find information about the file:
# ffmpeg -i /home/jacob/Videos/TheVillage.m4v

Can you post that info ? It would help.

jake20x 04-07-2011 03:27 AM

Here is the information that comes up

FFmpeg version 0.6-4:0.6-2ubuntu6, Copyright (c) 2000-2010 the FFmpeg developers
built on Oct 5 2010 22:35:47 with gcc 4.4.5
configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
WARNING: library configuration mismatch
libavutil configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libavcodec configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libavformat configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libavdevice configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libavfilter configuration: --extra-version=4:0.6-2ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libswscale configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libpostproc configuration: --extra-version=4:0.6-2ubuntu3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-vaapi --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-libmp3lame --enable-gpl --enable-postproc --enable-x11grab --enable-libfaad --enable-libxvid --enable-libx264 --enable-librtmp --enable-libdc1394 --shlibdir=/usr/lib/i686/cmov --cpu=i686 --enable-shared --disable-static --disable-ffmpeg --disable-ffplay
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9e58be0]max_analyze_duration reached

Seems stream 1 codec frame rate differs from container frame rate: 2997.00 (2997/1) -> 23.98 (2997/125)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/jacob/Videos/TheVillage.m4v':
major_brand : M4V
minor_version : 0
compatible_brands: M4V mp42isom
title : The Village
artist : M. Night Shyamalan
genre : Thriller
date : 2009-12-29T08:00:00Z
copyright : Buena Vista Home Entertainment, Inc.
Duration: 01:47:50.26, start: 0.000000, bitrate: 1404 kb/s
Chapter #0.0: start 0.000000, end 208.000000
title : Opening Titles
Chapter #0.1: start 208.000000, end 363.000000
title : Giving Thanks
Chapter #0.2: start 363.000000, end 465.000000
title : "Those We Don't Speak Of"
Chapter #0.3: start 465.000000, end 705.000000
title : The Request
Chapter #0.4: start 705.000000, end 916.000000
title : A Marriage Proposal
Chapter #0.5: start 916.000000, end 1535.000000
title : The Stump
Chapter #0.6: start 1535.000000, end 1822.000000
title : Lucius Enters The Woods
Chapter #0.7: start 1822.000000, end 2098.000000
title : "Don't Let Them In!"
Chapter #0.8: start 2098.000000, end 2313.000000
title : The Note
Chapter #0.9: start 2313.000000, end 2544.000000
title : The Wedding
Chapter #0.10: start 2544.000000, end 2933.000000
title : "We Will Go Together"
Chapter #0.11: start 2933.000000, end 3052.000000
title : The Inquiry
Chapter #0.12: start 3052.000000, end 3173.000000
title : Noah Visits Lucius
Chapter #0.13: start 3173.000000, end 3332.000000
title : A Bad Color
Chapter #0.14: start 3332.000000, end 3736.000000
title : "I Cannot See His Color"
Chapter #0.15: start 3736.000000, end 3904.000000
title : "Do Your Best Not To Scream"
Chapter #0.16: start 3904.000000, end 4454.000000
title : Leaving The Village
Chapter #0.17: start 4454.000000, end 4688.000000
title : "What Have You Done?"
Chapter #0.18: start 4688.000000, end 4874.000000
title : The Woods
Chapter #0.19: start 4874.000000, end 5123.000000
title : Something In The Woods
Chapter #0.20: start 5123.000000, end 5422.000000
title : The Sacrifice
Chapter #0.21: start 5422.000000, end 5551.000000
title : The Box
Chapter #0.22: start 5551.000000, end 6098.000000
title : An Act Of Kindness
Chapter #0.23: start 6098.000000, end 6470.263991
title : End Credits
Stream #0.0(eng): Audio: aac, 44100 Hz, stereo, s16, 128 kb/s
Stream #0.1(eng): Video: drmi / 0x696D7264, 640x344, 1270 kb/s, 23.98 fps, 23.98 tbr, 2997 tbn, 2997 tbc
Stream #0.2(eng): Data: tmcd / 0x64636D74
Stream #0.3(eng): Subtitle: text / 0x74786574
Stream #0.4(eng): Video: mjpeg, yuvj420p, 640x344 [PAR 96:96 DAR 80:43], 0 kb/s, PAR 43:80 DAR 1:1, 0k fps, 44100 tbr, 44100 tbn, 44100 tbc
At least one output file must be specified

H_TeXMeX_H 04-07-2011 06:08 AM

I see, so there are two different video streams, one mjpeg and one drmi (DRMed). There is no way to decode this drmi video legally, because it is DRMed.

It may be possible to decode the mjpeg one. Use the '-map 0:0 -map 0:4' option to select those streams. Your '-vcodec' can be anything you want, like 'libxvid' or 'libx264' or 'mjpeg'.

jake20x 04-07-2011 10:52 PM

Could you be a little more specific of where to use those options in the command, I'm new to this program. Also you said there's no legal way so is there another way of doing this or none at all?

Thanks a lot.

trillobyte 04-07-2011 11:34 PM

This page may help you and answer some of your questions.

Hope this helps.

H_TeXMeX_H 04-08-2011 05:28 AM



ffmpeg -i input.m4v -vcodec copy -acodec copy output.mp4 -map 0.0 -map 0.4
As for DRM, to be honest, there is no tool to do this on Linux, and even if there were, I couldn't post it here. Just stay away from DRMed stuff, I do.

trillobyte 04-09-2011 06:55 PM

Shouldn't he want to -map 0:0 and -map 0:4 ? -map 0:1 is the DRM stream.


ffmpeg -i input.m4v -vcodec copy -acodec copy output.mp4 -map 0:0 -map 0:4
Best regards

H_TeXMeX_H 04-10-2011 03:58 AM


Originally Posted by trillobyte (Post 4319511)
Shouldn't he want to -map 0:0 and -map 0:4 ? -map 0:1 is the DRM stream.


ffmpeg -i input.m4v -vcodec copy -acodec copy output.mp4 -map 0:0 -map 0:4
Best regards

Oh, yeah, you're right.

All times are GMT -5. The time now is 11:21 AM.