Active Topics

 


Reply
Thread Tools
Posts: 63 | Thanked: 106 times | Joined on Mar 2017
#1
Hi,

I'll openly admit that I haven't a clue what I'm doing, but as I've been having a few problems gstreamer, I thought I'd try some other options...
I've built ffmpeg (including ffplay), and when I try and play a video with ffplay, the video itself is fine (after rotating and resizing), but I'm getting no audio. I've seen various terms flying around, like alsa, oss, libaudioresource, pulseaudio etc., but I'm not really sure what I'm trying to achieve, let alone how to do it. Just wondered if anyone could give me any clues on what I should try, e.g. parameters to ffplay or building ffmpeg again with certain things enabled?

Thanks

Last edited by moodroid; 2017-06-22 at 11:59.
 

The Following 2 Users Say Thank You to moodroid For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#2
Like yourself, I find myself wanting to play with things I know little about. In my mind, this is one of the best ways to learn; by fiddling and of course, also accepting you may cause problems with your beloved device.
I ended up using FFMPEG by bloodyfoxy on Openrepos; https://openrepos.net/content/bloodyfoxy/ffmpeg. Then, with a few videos shot using my Jolla1, I had a go at different conversions, some worked, some didn't.

Okay, as FFMPEG is not specific to Sailfish, you can find plenty of help/walk-throughs/videos littering the net.

Here's what I just tried on my device and it worked, albeit very basic, but it allows one to get the gist of what's going on....bit by bit

OKay, shoot a short video, say 30 seconds worth with some audio; chatting, music, whatever, but do make some noise as the following steps will strip the soundtrack from an MP4 video leaving it as an MP3 audio track.

Then in terminal, try this;

ffmpeg -i 20170509_105924.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 audio.mp3 (replace '20170509_105924.mp4' with your own)

Once done, open Mediaplayer, find your track and play it.

Hope this helps, a little......

Regards,
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 3 Users Say Thank You to Markkyboy For This Useful Post:
Posts: 20 | Thanked: 40 times | Joined on Apr 2015
#3
Originally Posted by moodroid View Post
but I'm getting no audio. I've seen various terms flying around, like alsa, oss, libaudioresource, pulseaudio etc.
install "pulseaudio-devel" and recompile. I hope it helps.
 

The Following 2 Users Say Thank You to paolomi For This Useful Post:
Posts: 63 | Thanked: 106 times | Joined on Mar 2017
#4
Originally Posted by paolomi View Post
install "pulseaudio-devel" and recompile. I hope it helps.
Thanks. Still seem to have no sound though. I've found that with paplay I get sound, but with aplay I don't get sound, so wonder if I have an alsa problem?
 

The Following User Says Thank You to moodroid For This Useful Post:
Posts: 1,293 | Thanked: 4,319 times | Joined on Oct 2014
#5
Originally Posted by moodroid View Post
Thanks. Still seem to have no sound though. I've found that with paplay I get sound, but with aplay I don't get sound, so wonder if I have an alsa problem?
Hmm pulse audio is what SFOS should use. But I guess there are some things that needs to be specifically configured.
I will have a look next couple of days.
 

The Following 3 Users Say Thank You to nieldk For This Useful Post:
Posts: 20 | Thanked: 40 times | Joined on Apr 2015
#6
I've compiled ffplay now and there are no sounds, I don't know why.

Some months ago I've compiled mpv and it doesn't work on sailfish os.
 

The Following User Says Thank You to paolomi For This Useful Post:
Posts: 63 | Thanked: 106 times | Joined on Mar 2017
#7
Originally Posted by paolomi View Post
I've compiled ffplay now and there are no sounds, I don't know why.

Some months ago I've compiled mpv and it doesn't work on sailfish os.
Thanks for trying it, and glad it's not just me. Here's what I've discovered, but as I say, I don't really know what I'm doing...

# ffmpeg -i file.mp4 -f wav - | paplay
this plays sound, but I can't find a way to make ffplay play sound, and I can't get aplay (alsa) to work either

# ffmpeg -i file.mp4 -f avi - | tee >(ffplay -) >(ffmpeg -i - -f wav - | paplay) > /dev/null
this gives me sound and video, but it goes a bit mad when you pause and unpause
 

The Following 4 Users Say Thank You to moodroid For This Useful Post:
Posts: 20 | Thanked: 40 times | Joined on Apr 2015
#8
Thanks, your command line works, but on my jolla1 some videos pause and play too often... so i made a simple script file:

Code:
#!/bin/bash                                                                                                                   
BINPATH="/home/nemo"                                                                                                          
FILE="$1"                                                                                                                     
$BINPATH/ffmpeg -i $FILE -f wav /tmp/wav.wav                                                                                  
$BINPATH/ffplay -fs $FILE & paplay /tmp/wav.wav                                                                               
rm /tmp/wav.wav
don't run it with very long videos! otherwise you have to wait very long before it plays!

this is a temporary solution: i hope ffplay will be fixed soon
 

The Following 2 Users Say Thank You to paolomi For This Useful Post:
Posts: 63 | Thanked: 106 times | Joined on Mar 2017
#9
After reading https://stackoverflow.com/questions/...o-output-sound it definitely sounded like the problem was that ffplay needed to be patched for Sailfish to use libaudioresource, so I decided to give it a go, and depsite not having a clue what I was doing, it seems to work!

Attached is ffplay.c and ffbuild/config.mak. There may be some devel files that need to be pkcon install'ed, but I can't remember for sure, but it should be obvious from any compilation errors if there are.

The screen does go to sleep during playback, but https://openrepos.net/content/xmlich02/stay-awake can be used to work around this.

EDIT: In case anyone wants to try this, these are the devel files that I currently have installed, though I don't think all of them are required:
Installed SDL2-devel-2.0.3-1.4.1.armv7hl
Installed SDL2_sound-devel-1.0.1-1.2.3.armv7hl
Installed glib2-devel-2.48.0+git3-1.11.2.armv7hl
Installed glibc-devel-2.19+6.9-1.8.1.armv7hl
Installed jolla-developer-mode-0.3.26-10.27.4.jolla.armv7hl
Installed jolla-developer-mode-profile-0.3.26-10.27.4.jolla.armv7hl
Installed libaudioresource-devel-1.0.5-1.4.3.armv7hl
Installed libxml2-devel-2.9.1-1.3.5.armv7hl
Installed pcre-devel-8.31-1.3.1.armv7hl
Installed perl-devel-2:5.16.1-1.1.29.armv7hl
Installed pulseaudio-devel-8.0+git5-1.21.2.armv7hl
Installed smpeg-devel-2.0.0-1.1.6.armv7hl
Installed zlib-devel-1.2.8+git2-1.3.21.armv7hl

And to resize and rotate (for my device) I use:
ffplay -i <filename> -vf "transpose=1" -x 540 -y 960
Attached Files
File Type: zip ffplay.zip (43.3 KB, 231 views)

Last edited by moodroid; 2017-06-23 at 08:43.
 

The Following 5 Users Say Thank You to moodroid For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 23:24.