Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sorry, I am really new to this, and have problems doing some tasks without help.

So I have a terminal command:

ffmpeg \
-y \
-i '/media/levan/BEEA60D8EA608E89/Downloads/Videos/Tony Braxton - Un-Break My Heart.VOB' \
-s 1920x1080 \
-aspect 16:9 \
-r 25 \
-b 15550k \
-bt 19792k \
-vcodec libtheora \
-acodec libvorbis \
-ac 2 \
-ar 48000 \
-ab 320k \
ddd.ogg

and I want to have 3 pass video in output video, but how do I accomplish this?

I found that I must write -pass n command some where, but where to write it I do not know. I tested this and wrote -pass 3 at the end but then the terminal just showed a > symbol.

share|improve this question
1  
The shell will (usually, this can be changed) respond with > when it expects the command line to continue. Are you sure that you don't have any stray single or double quotes in the command you try to execute? (I tried the one from your post, and it does not exhibit that behavior when appending -pass 3 after the file name at the end.) –  Michael Kjörling Dec 2 '12 at 16:23
    
0_o say what :) I am new to this and got lost in your reply –  Levan Dec 2 '12 at 16:42
1  
Try copying the command from your post into a terminal, append -pass 3, and see if it works. It worked for me (except I didn't have ffmpeg installed, but the shell behaved as one would expect). –  Michael Kjörling Dec 2 '12 at 16:43
    
Thank you for the reply this is the commend I did with my mad skills levan@Dreamcast:~$ ffmpeg -y -i '/media/levan/BEEA60D8EA608E89/Downloads/Videos/Songbird.vob' -s 1920x1080 -aspect 16:9 -r 30000/1001 -b 15550k -bt 19792k -pass 3 -vcodec libtheora -acodec libvorbis -ac 2 -ar 48000 -ab 256k aa.ogg Cannot read file 'ffmpeg2pass-0.log': No such file or directory Error reading log file 'ffmpeg2pass-0.log' for pass-2 encoding this is what I got :) –  Levan Dec 2 '12 at 16:50
2  
I think you have to give it -pass 1 on the first pass, -pass 2 on the second and -pass 3 on the third, i.e. give the same command or similar three times, only changing the pass parameter. –  taneli Dec 2 '12 at 16:54
show 4 more comments

3 Answers 3

up vote 1 down vote accepted

Using your parameters, and your "one option per line", a two pass encode looks like:

ffmpeg \
-y \
-i '/media/levan/BEEA60D8EA608E89/Downloads/Videos/Tony Braxton - Un-Break My Heart.VOB' \
-s 1920x1080 \
-aspect 16:9 \
-r 25 \
-b 15550k \
-bt 19792k \
-vcodec libtheora \
-an \
-f ogg \
-pass 1 \
/dev/null \
&& \
ffmpeg \
-y \
-i '/media/levan/BEEA60D8EA608E89/Downloads/Videos/Tony Braxton - Un-Break My Heart.VOB' \
-s 1920x1080 \
-aspect 16:9 \
-r 25 \
-b 15550k \
-bt 19792k \
-vcodec libtheora \
-acodec libvorbis \
-ac 2 \
-ar 48000 \
-ab 320k \
-pass 2 \
ddd.ogg

You can exclude the audio from the first pass and output to /dev/null (as in the example). I don't see any reason why you need three passes.

share|improve this answer
add comment

So, what I understand is that first pass is to get informations for second... I've heard that the more pass you do the smallest is your file. Trying to get from a VOB file a mpeg-4 file, I'm having following function, could anybody help me?

My Function:

avconv -i $fileName -threads auto -c:v libx264 -preset veryslow -pass 1 /dev/null;
logInfo "First Pass done! doing second......"
avconv -i $fileName -pass 2 -threads auto -c:v libx264 -preset veryslow ${targetFile};

result:

pg@pipoTower: /var/autofs/removable/usbData/movies/.../VIDEO_TS$ source ~/bin/audio_video_conversions.sh ;my_convert_to_mpeg4_2pass VTS_01_1.VOB
INFO --> Converting with 2 passes source file:VTS_01_1.VOB- date is Fri Aug 30 15:15:28 CEST 2013
INFO --> Target file name:VTS_01_1_20130830_151528.mp4-
avconv version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav developers
built on Mar 30 2013 22:20:06 with gcc 4.7.2
[mpeg @ 0x11d6b80] max_analyze_duration reached
Input #0, mpeg, from 'VTS_01_1.VOB':
Duration: 00:17:10.62, start: 0.280000, bitrate: 8334 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 8500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Unable to find a suitable output format for '/dev/null'
INFO --> First Pass done! doing second......
avconv version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav developers
built on Mar 30 2013 22:20:06 with gcc 4.7.2
[mpeg @ 0x1952b80] max_analyze_duration reached
Input #0, mpeg, from 'VTS_01_1.VOB':
Duration: 00:17:10.62, start: 0.280000, bitrate: 8334 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 8500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[buffer @ 0x19620c0] w:720 h:576 pixfmt:yuv420p
[libx264 @ 0x195fd20] using SAR=16/15
[libx264 @ 0x195fd20] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX XOP FMA4 SSEMisalign LZCNT
[libx264 @ 0x195fd20] constant rate-factor is incompatible with 2pass.
Output #0, mp4, to 'VTS_01_1_20130830_151528.mp4':
Stream #0.0: Video: libx264, yuv420p, 720x576 [PAR 16:15 DAR 4:3], q=-1--1, pass 2, 90k tbn, 25 tbc
Stream #0.1: Audio: [0][0][0][0] / 0x0000, 48000 Hz, stereo, s16, 200 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (ac3 -> libvo_aacenc)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
share|improve this answer
1  
I am not good with the commend line so I will try to help but I am not sure if it will work or not. First this I know, you can have only 2 pass and not the more pass you have the file size does not change, file size is all about bit rate, what 2 pass do trying to make the quality better, it has more data to work with so there is a chance that the video will look closer to the original. I recommend you to use handbrake to convert videos a fantastic tool. about your commend I am not sure but when I am used to render with ffmpeg and 2 pass I used to copy the first commend and change 1 to 2 –  Levan Aug 30 '13 at 22:22
    
Thx for your comment, am already using handbrake which is nice yep! –  Philippe Gachoud Sep 1 '13 at 14:16
    
But if you want to use ffmpeg you can use "ffmpeg little helper" google it and there is a website that will help you with the commend –  Levan Sep 1 '13 at 18:36
add comment

I would suggest you not use the shell script source ~/bin/audio_video_conversions.sh and instead run the 2 commands on the command line, one after the other in order to find out where it is breaking.

I think you need to find out why you are getting this

Unable to find a suitable output format for '/dev/null'

on your first pass. Look in your directory with

ls 

command. Make sure you have a

ffmpeg2pass-0.log

file created after the pass-1.

You asked ffmpeg to do a 2-pass convert to find variance in the bitrate in the pass-1, log bitrate information to a file, and use the logfile to make a more efficient better pass-2. But you also told ffmpeg don't change the bitrate. Can not do both.

-bt 19792k \

Which do you want? You want ffmpeg to change the bitrate with 2-pass? OR You want ffmpeg keep -bt 19792k with only 1-pass?

[libx264 @ 0x195fd20] constant rate-factor is incompatible with 2pass.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.