LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-08-2017, 12:06 PM   #1
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Rep: Reputation: 3
FFMPEG: Need Help with .Mov Output's Audio


2017-08-08

I was really overjoyed last night when I succeeded for the first time in merging an image file and an audio file into a video file, using the following command on my Linux Mint 18 machine.
The version number of ffmpeg is 7:2.8.11-0ub.
Code:
 ffmpeg -loop 1 -i Sino-123.jpg  -i Sino-123.wav  -shortest  -acodec  copy -f mov Sino-123.mov
ffmpeg produced Sino-123.mov successfully but when this output is played back with cvlc, the audio keeps repeating itself on and on. Is this feature inherent in the above command or it is due to something else. By the way, I am a total stranger to ffmpeg and would appreciate very much any help from this forum.

Julianvb
 
Old 08-08-2017, 01:59 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I think your looping both the video and the audio. If the audio track is shorter than the video track, then the audio must be repeated to equal the time of 1 loop of the video. But I'm not an expert.
 
Old 08-08-2017, 02:03 PM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,003
Blog Entries: 1

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
$ ffmpeg -loop 1 -i Sino-123.jpg -i Sino-123.wav -shortest -acodec copy -f mov Sino-123.mov

Probably add -f image2 before the -i input. And omit the -acodec copy. Some video formats cannot do WAV or want a very specific formatted WAV type.

so:

$ ffmpeg -loop 1 -f image2 Sino-123.jpg -i Sino-123.wav -shortest -f mov Sino-123.mov

Or try the libx264 .mp4 video types that are more common these days. When in doubt remove parameters and let ffmpeg figure it out.

$ ffmpeg -formats | less
$ ffmpeg -codecs | less

$ ffmpeg -loop 1 -f image2 -i IMAGE.jpg -i AUDIO.wav -shortest -vcodec libx264 -r:v 30000/1001 -y VIDEO.mp4

The default fps for ffmpeg is 25 or " -r:v 25 ", so unless you're european, you probably want to americanize it " -r:v 30000/1001 " which is 29.97 or basically 30 fps. With various other parameters to affect quality and filesize.
 
Old 08-08-2017, 02:14 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,003
Blog Entries: 1

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
Older versions of ffmpeg can be buggy and even have significantly different syntaxes. You can sometimes work around that by being more specific about the input. In the case of the looping image the size " -s 1920x1080 " and the frames per second " -r:v 30000/1001 " (should match the output), if specified before the input file should work around issues.

$ ffmpeg -loop 1 -f image2 -s 1920x1080 -r:v 30000/1001 -i IMAGE.jpg -i AUDIO.wav -shortest -vcodec libx264 -r:v 30000/1001 -y VIDEO.mp4

It could also be that you omitted the -y so it's appending the output file each attempt instead of overwriting it, which is why you're getting a file that loops. ffmpeg used to prompt if you want to overwrite it bitd. But ffmpeg has changed so much over the years, it's hard to keep up even when you have a pinch of a clue of what might be happening. Basically change the output name to something new and see if it "loops" to test that theory.
 
Old 08-12-2017, 07:09 PM   #5
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Hi, Awesome Machine and Shadow 7,

Thank you very much for your great advice. I am now using ffmpeg version 3.3.3 on a Linux Mint 18.2 machine. I see no runtime errors when I issue
the following code,
Code:
 ffmpeg -i sino-123.jpg -i sino-123.wav sino-123.mov
However,
Code:
cvlc sino-123.mov
reproduces the audio correctly but no screen image, and displays the following error report:
Quote:
libva info: VA-API version 0.39.4
libva info: va_getDriverNmae() returns 0
linva info: Trying to open /usr/lib/i386/-Linux-gnu/dri/i915_drv_video.so
libva info: va_openDriver() returns -1
[aaf03c60] vdpau_avcodec generic error: decoder profile not supported: 8
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/-386-linux-gnu/dri/i915_drv_video.so
libva info: va_openDRiver() returns -1
What can I do to fix this decoder-profile problem?

Julianvb

Last edited by julianvb; 08-12-2017 at 07:58 PM.
 
Old 08-15-2017, 01:13 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,003
Blog Entries: 1

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
Quote:
Originally Posted by julianvb View Post
What can I do to fix this decoder-profile problem?

Julianvb
Encode to something more supported?

[cdoe]$ ffmpeg -formats | grep -i mov
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
...
E mov QuickTime / MOV
D mov,mp4,m4a,3gp,3g2,mj2 QuickTime / MOV
...[/code]

The E is for Encode the D is for Decode. It doesn't seem that any of the .mov options has BOTH decode and encode options available. Your best bet is the choose another format. MKV has always worked well for me, when in doubt.

$ ffmpeg -i sino-123.jpg -i sino-123.wav sino-123.mkv
$ cvlc sino-123.mkv
 
2 members found this post helpful.
Old 08-15-2017, 01:13 PM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,003
Blog Entries: 1

Rep: Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847Reputation: 847
Quote:
Originally Posted by julianvb View Post
What can I do to fix this decoder-profile problem?

Julianvb
Encode to something more supported?

[cdoe]$ ffmpeg -formats | grep -i mov
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
...
E mov QuickTime / MOV
D mov,mp4,m4a,3gp,3g2,mj2 QuickTime / MOV
...[/code]

The E is for Encode the D is for Decode. It doesn't seem that any of the .mov options has BOTH decode and encode options available. Your best bet is the choose another format. MKV has always worked well for me, when in doubt.

$ ffmpeg -i sino-123.jpg -i sino-123.wav sino-123.mkv
$ cvlc sino-123.mkv
 
2 members found this post helpful.
Old 08-16-2017, 10:54 AM   #8
julianvb
Member
 
Registered: Apr 2009
Posts: 390

Original Poster
Rep: Reputation: 3
Shadow_7,

Thanks very much for the new suggestion. I think .mkv files are more friendly to cvlc.
Code:
 cvlc -i sino-123.jpg -i sino-123.wav sino-123-mkv
Now cvlc plays both the audio and image, but the picture disappears soon after the audio ends. Ideally I would like the image to stay until I delete it.

I need to point out that
Code:
"vlc sin0-123.mkv
also outputs
Quote:
"vapau_avcodec generic error: decoder profile not supported: 8
Julianvb

Last edited by julianvb; 08-16-2017 at 12:49 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
[SOLVED] Having a problem converting MOV files to MP4 using FFMPEG rstuff Linux - Newbie 14 12-02-2016 01:23 AM
saving bash script's audio-and-image output as .mov file julianvb Linux - Software 11 09-25-2014 01:15 AM
[SOLVED] Using ffmpeg to convert to .mov with h264 encoding. crosstalk Linux - Desktop 3 02-18-2011 01:36 AM
convert mp3 to mov using ffmpeg kirukan Linux - Newbie 4 09-17-2009 01:29 AM
ffmpeg with -sameq form .mov produces huge files ziocicion Linux - Software 2 06-01-2006 11:07 AM

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

All times are GMT -5. The time now is 02:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration