2114 views|8 replies

247

Posts

4

Resources
The OP
 

[Mil MYC-J1028X development board trial] Build a DLNA streaming media server [Copy link]

In the previous article, I shared how to use Transmission to build a PT high-speed download server, which can be used to download media resources.

After successfully downloading the media resources, we also need to provide the media resources to other devices so that other devices can browse and play them. Otherwise, there is no point in downloading them.

To provide media resources to the outside world on the Mir MYC-J1028X development board system, you can use Samba or DLNA.

Samba is used to establish file sharing like network neighbors, while DLNA is specifically used to publish media resources to the outside world.

In this article, we will share how to build a DLNA media server on the Mir MYC-J1028X development board system and publish resources to the outside world.

1. Set the wired network card to start automatically:

In the previous article, we briefly talked about enabling the wired network card, but after restarting, it needs to be activated again.

Then, let's do some processing first so that the wired network card can be automatically activated after the system restarts:

[For some reason, the following code is invalid in markdown code mode, and it is a smart map]

After the operation is completed, you can see the following information:

The green active (running) means the status is normal and running.

Then, we can use nmcli to manage the network:

sudo nmcli connection  add con-name "my connection" type ethernet ifname eno0 autoconnect yes ipv4.method auto

The above statement means that the wired network card eno0 is automatically turned on and automatically obtains an IP address.

After the operation, check the network status through the following command:

As can be seen from the above picture, the corresponding wired network card eno0 has been successfully set up.

You can also set up other wired network cards in the same way.

Now, you can try sudo reboot to see if the wired network card starts automatically.

2. Prepare the media file directory

The eMMC space of the Mir MYC-J1028X development board is not large, so do not download media files on it.

We can plug in a USB mobile hard disk or a large-capacity SD card. In my demonstration, I used an SD card.

First, on other computers, format the SD card as exFAT, and then copy the media files to the Movie directory in the root directory of the SD card in advance.

Then, insert the SD card into the slot under the heat sink on the development board, and then use the following command to mount it:

View the device: lsblk

Among them, mmcblk0 represents our SD card

Storage device view: sudo fdisk -l

Among them, /dev/mmcblk0p1 indicates the partition we just formatted and can be used later.

Then, mount it:

sudo apt-get install exfat-fuse exfat-utils

sudo mkdir /sdcard

sudo mount.exfat -o pagecode=936,iocharset=cp936 /dev/mmcblk0p1 /sdcard

df -h

Now, the SD card is mounted successfully and can be used normally.

One thing to remind you is that in the mount command, -o pagecode=936,iocharset=cp936 can ensure that Chinese file names are displayed correctly, because it corresponds to the default file name encoding in the Chinese environment under the Windows system.

If you have copied the media files to the Movie directory of the SD card in advance, you can check them now:

When downloading media resources in Transmission, you can set the storage path to the following directory:

3. Install DLNA service:

The next step is to install the DLNA server.

I chose minidlna, which is a very small DLNA server software with very good functions.

Installation is also very simple:

sudo apt-get install minidlna

Then set it up:

sudo vim /etc/minidlna.conf

#Configure media file directory

media_dir=/sdcard/Movie

# Service port 8200
port=8200

# Automatically refresh the media file directory with new files

inotify=yes

# The DLNA service name presented to the outside world is
friendly_name=MYIR_DEVICE

You can comment out the original corresponding items in the configuration file /etc/minidlna.conf, and add the above items at the end to facilitate unified management.

After the configuration is complete, restart minidlna and check the status:

sudo /etc/init.d/minidlna force-reload

sudo /etc/init.d/minidlna status

Now that the DLNA server has been successfully run, we can perform a playback test.

4. Play DLNA media resources

To play DLNA media resources, you can use your mobile phone, Android TV, or computer.

On a computer, VLC is usually used, which can be downloaded from: VLC: Official Website - The free multimedia solution for all platforms! - VideoLAN .

After downloading, open the VLC player software and browse UPnP to see the media resources published by the DLNA server:

Click the corresponding media file to play it:

Thanks to the high performance and Gigabit Ethernet port of the Mir MYC-J1028X development board, external resource release is efficient and fast.

Playback is very smooth and the drag progress is very fast.

Just like that, a home streaming media server was successfully built.

Hurry up and get a large mobile hard drive, then you can download as much as you want and enjoy watching it!!!

This post is from NXP MCU

Latest reply

So where should I start? What materials do I need to prepare, what books do I need to buy, and what else do I need besides the development board? At present, I can only do some stm32 projects, and I want to learn this. I don't know if it is difficult.   Details Published on 2022-9-4 21:32
 

6555

Posts

0

Resources
2
 

Very good, the high performance and Gigabit Ethernet port of the Mir MYC-J1028X development board are quite interesting

This post is from NXP MCU

Comments

For the development board, how to test the Gigabit Ethernet port?  Details Published on 2022-8-22 09:13
 
 
 

5998

Posts

6

Resources
3
 
Jacktang published on 2022-8-22 07:25 Very good, the high performance and Gigabit Ethernet port of the Mir MYC-J1028X development board are quite interesting

For the development board, how to test the Gigabit Ethernet port?

This post is from NXP MCU

Comments

Test the two boards against each other. Or: Connect other devices that support Gigabit and perform output transmission test.  Details Published on 2022-9-3 21:10
 
 
 

6818

Posts

11

Resources
4
 

Teacher Qiao’s post is very well written. I learned a lot from it. Thanks for sharing!

This post is from NXP MCU
 
 
 

59

Posts

0

Resources
5
 
This post was last edited by 简单happy on 2022-8-23 12:25

Good post, I admire you. I don't know where to start to learn this level. I also want to make something like a cat disk. I feel that this hardware can realize this application.

This post is from NXP MCU

Comments

The hardware performance is strong and the network card speed is fast, so it is no problem to achieve  Details Published on 2022-9-3 21:10
 
 
 

247

Posts

3

Resources
6
 

Worship the great God!

This post is from NXP MCU
 
 
 

247

Posts

4

Resources
7
 
Qintianqintian0303 posted on 2022-8-22 09:13 For the development board, how to test the Gigabit Ethernet port?

Test the two boards against each other.

or:

If other devices support Gigabit, connect them and perform output transmission test.

This post is from NXP MCU
 
 
 

247

Posts

4

Resources
8
 
Simple happy posted on 2022-8-23 12:23 Good post, I worship the great god. I don't know where to start to learn this level. I also want to make something like a cat disk. I feel that this hardware can be implemented...

The hardware performance is strong and the network card speed is fast, so it is no problem to achieve

This post is from NXP MCU
 
 
 

59

Posts

0

Resources
9
 
HonestQiao posted on 2022-9-3 21:10 The hardware performance is strong, the network card speed is fast, and it is no problem to implement it

So where should I start? What materials do I need to prepare, what books do I need to buy, and what else do I need besides the development board? At present, I can only do some stm32 projects, and I want to learn this. I don't know if it is difficult.

This post is from NXP MCU
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list